dhbora / AppShop---Programming-Kingston-University

1 stars 0 forks source link

Chamandeep please review your last changes #2

Open dhbora opened 12 years ago

dhbora commented 12 years ago

Hi Chamandeep, I've looked at your changes and unfortunately there are some issues with them. 1) It seems that you've added getPrice(), the problem is that it was already done by me before you even said you're working on them. look at my changes that I pushed last night. 2) When 2 people work on the same file at the same time, they have 2 different versions of the file. When the first person wants to push the changes it's fine but when the second person tries to push the files git shows an error and tells you that you cannot fast-forward these changes. Now you have to merge the 2 versions of the file. Git makes it easier by attaching the old version at the end of the file. You should now paste the old lines of code to where they are supposed to be and remove the lines of code that are not needed. Please check paidApp.h which shows that you haven't done that. The program would not compile if you don't do it properly. 3) I can see in the iamWorkingOn.txt that you want to work on the orders but I've already put it in my section so I am working on it

I'll have to remove your last commits from the server. Please review your changes and if there is something that we haven't done before, please push those changes but getPrice() is already done.

Mateusz

chamandeep commented 12 years ago

Hi Mateusz,

Sorry about that last commit. I had a lot of trouble making that commit. I did get a lot of errors about the fast forwarding etc. But i couldn't make much sense of them if i'm being totally honest with you. As for the order section. I saw your txt file last night. And realised that you were working on it. Please could you suggest another section that needs doing and i will try my best to do it? I feel i'm not contributing enough to this project. I really want to but my limited knowledge of programming is preventing me from coding (this is not an excuse). Please can you suggest a section for me to complete.

Thanks Chamandeep -----Original Message----- From: dhbora [mailto:reply@reply.github.com] Sent: 27 December 2011 14:37 To: chamandeep Subject: [AppShop---Programming-Kingston-University] Chamandeep please review your last changes (#2)

Hi Chamandeep, I've looked at your changes and unfortunately there are some issues with them. 1) It seems that you've added getPrice(), the problem is that it was already done by me before you even said you're working on them. look at my changes that I pushed last night. 2) When 2 people work on the same file at the same time, they have 2 different versions of the file. When the first person wants to push the changes it's fine but when the second person tries to push the files git shows an error and tells you that you cannot fast-forward these changes. Now you have to merge the 2 versions of the file. Git makes it easier by attaching the old version at the end of the file. You should now paste the old lines of code to where they are supposed to be and remove the lines of code that are not needed. Please check paidApp.h which shows that you haven't done that. The program would not compile if you don't do it properly. 3) I can see in the iamWorkingOn.txt that you want to work on the orders but I've already put it in my section so I am working on it

I'll have to remove your last commits from the server. Please review your changes and if there is something that we haven't done before, please push those changes but getPrice() is already done.

Mateusz


Reply to this email directly or view it on GitHub: https://github.com/dhbora/AppShop---Programming-Kingston-University/issues/2

dhbora commented 12 years ago

Don't worry, I know it happens, especially that git isn't the easiest thing to use :). Yesterday I uploaded a file called toBeDone.txt it's got a list of what needs to be done. Tomasz is working on the last thing which is the interface. The interface seems to be a bit complicated but I hope he'll manage to do it. All the other things on the list seem quite easy so try to do as many as you can. Currently I'm busy doing something else so I'm not working on the project at the moment.

Here is a list of what you can do:

chamandeep commented 12 years ago

Hi,

Thanks. I'll try my best to do as much as possible. Hope your break is going good!

-----Original Message----- From: dhbora [mailto:reply@reply.github.com] Sent: 28 December 2011 13:54 To: chamandeep Subject: Re: [AppShop---Programming-Kingston-University] Chamandeep please review your last changes (#2)

Don't worry, I know it happens, especially that git isn't the easiest thing to use :). Yesterday I uploaded a file called toBeDone.txt it's got a list of what needs to be done. Tomasz is working on the last thing which is the interface. The interface seems to be a bit complicated but I hope he'll manage to do it. All the other things on the list seem quite easy so try to do as many as you can. Currently I'm busy doing something else so I'm not working on the project at the moment.

Here is a list of what you can do:


Reply to this email directly or view it on GitHub: https://github.com/dhbora/AppShop---Programming-Kingston-University/issues/2#issuecomment-3290947

dhbora commented 12 years ago

Hi, so how is it going? can you push the changes everytime you achieve one of the things from the list so we can test it? Thanks. Mateusz

dhbora commented 12 years ago

Hi Chamandeep, How are you doing? I've just seen that you've done some commits but to be honest I can't work out what you have changed so can you briefly list all the changes that you've made, please? Also I can see that since your last commits the program can't compile anymore so can you fix that? I'm not sure if I'm right but I think you haven't made any changes to the code and you've only changed the iamWorkingOn.txt. Let me know If that's the case and I'll remove your commit, you'll have to clone the repository again and that's gonna be easier than fixing the code that isn't compiling now. Also you're saying that sometimes you can't commit the changes but why, what's wrong with that, maybe I can help you? You're also saying that some previous code was lost, what do you mean? Please answer as soon as possible because I've made some changes as well and I need to push it to github but if I push it now and then you tell me that it's better to remove the commits rather than fixing the code I won't be able to do it anymore.

chamandeep commented 12 years ago

hello,

I am doing ok thanks. What about you? I am really sorry for all these issues with the code. After your last commit i tried to clone the files but something didn't seem to work. I was seeing the same lines of code in more than one place. And the methods i was previously working didn't seem to be there any more. My recent commit should have only been for the iamWorkingOn.txt file (that is the only one i added). Please feel free to remove my last commited code.

And can you please tell me how i can clone the git repository properly this time after you push your changes? Again sorry about all this. It seems to be taking me for ever to work out methods and how to use methods from other classes lol. I am trying to use the method from either the user or the customer class to get the profession, age and grade point to calculate the discount in the basket class.

Do you know how Tomasz is getting on with the GUI?

Thanks

Date: Sun, 1 Jan 2012 13:41:52 -0800 From: reply@reply.github.com To: chaman_grover@hotmail.com Subject: Re: [AppShop---Programming-Kingston-University] Chamandeep please review your last changes (#2)

Hi Chamandeep, How are you doing? I've just seen that you've done some commits but to be honest I can't work out what you have changed so can you briefly list all the changes that you've made, please? Also I can see that since your last commits the program can't compile anymore so can you fix that? I'm not sure if I'm right but I think you haven't made any changes to the code and you've only changed the iamWorkingOn.txt. Let me know If that's the case and I'll remove your commit, you'll have to clone the repository again and that's gonna be easier than fixing the code that isn't compiling now. Also you're saying that sometimes you can't commit the changes but why, what's wrong with that, maybe I can help you? You're also saying that some previous code was lost, what do you mean? Please answer as soon as possible because I've made some changes as well and I need to push it to github but if I push it now and then you tell me that it's better to remove the commits rather than fixing the code I won't be able to do it anymore.


Reply to this email directly or view it on GitHub: https://github.com/dhbora/AppShop---Programming-Kingston-University/issues/2#issuecomment-3326128

dhbora commented 12 years ago

yeah, i'm ok as well, thanks. I've just uploaded my commits so you can download them. Basically what I would recommend: 1) git clone git@github.com:chamandeep/AppShop---Programming-Kingston-University.git this will remove all the files that you have in your folder and download the version that's currently on github so if you've created some new methods or modified something it will be removed. In this case I would backup the modified files somewhere else and copy and paste the changes once cloning is finished.

Now, let's say you decide to add some new methods or modify some files. BEFORE you start doing that make sure that you download the latest commits from github. To do that you need to use the following commands: 1) git fetch origin 2) git merge origin

Now you can start working on the program, do all the changes, add the new methods, etc. Once you're done with that you have to upload your changes using the following commands: 1) git commit -a 2) git push origin

This way you shouldn't have problems like you've had before.Just make sure that you download the latest changes from github just before you start working on the program and upload your changes as soon as you complete your modifications.

And about Tomasz, I'm not sure, I've been trying to call and email him and I have no answer so I'm not sure what's happening. I hope he'll do it soon because we can't really test the program without GUI.

chamandeep commented 12 years ago

Hi,

I downloaded your recent commit but the order.h and order.cpp file seems to be missing? After looking at the order list, it seems that it is no longer needed? But just wanted to check. If you still haven't heard from Tomasz, can i start on the gui and use the examples from the workshop to create something. Lol i'm not sure how successful i'll be but i can try.

Thanks -----Original Message----- From: dhbora [mailto:reply@reply.github.com] Sent: 01 January 2012 23:21 To: chamandeep Subject: Re: [AppShop---Programming-Kingston-University] Chamandeep please review your last changes (#2)

yeah, i'm ok as well, thanks. I've just uploaded my commits so you can download them. Basically what I would recommend: 1) git clone git@github.com:chamandeep/AppShop---Programming-Kingston-University.git this will remove all the files that you have in your folder and download the version that's currently on github so if you've created some new methods or modified something it will be removed. In this case I would backup the modified files somewhere else and copy and paste the changes once cloning is finished.

Now, let's say you decide to add some new methods or modify some files. BEFORE you start doing that make sure that you download the latest commits from github. To do that you need to use the following commands: 1) git fetch origin 2) git merge origin

Now you can start working on the program, do all the changes, add the new methods, etc. Once you're done with that you have to upload your changes using the following commands: 1) git commit -a 2) git push origin

This way you shouldn't have problems like you've had before.Just make sure that you download the latest changes from github just before you start working on the program and upload your changes as soon as you complete your modifications.

And about Tomasz, I'm not sure, I've been trying to call and email him and I have no answer so I'm not sure what's happening. I hope he'll do it soon because we can't really test the program without GUI.


Reply to this email directly or view it on GitHub: https://github.com/dhbora/AppShop---Programming-Kingston-University/issues/2#issuecomment-3326450

dhbora commented 12 years ago

Hi, yes it's in the title of the commit: "... Removed order.cpp and order.h as those classes are now implemented inside of orderList.cpp and orderList.h ...". I just figured that the order class is only needed in the orderList class (becasue order list consists of objects of order class), as it's not needed anywhere else it's better to implement the order class inside of order list. Tomasz sent me a message today that he's not sure how to create the gui but don't worry I'll call him and explain how to do it so you can just carry on doing other things from the list. I'm currently improving the classes I've done before because there are some important things to add (I'm not adding anything new, just changing the way some methods work) but don't worry it should affect the things you're working on.

Thanks

chamandeep commented 12 years ago

Hi,

I am trying to create this method to return the discount. The way i did it:

In the academic class, you had some if statements with criteria for each case and the discount variable. I have turned those if statements into a method which should return the value of discount after excicuting the if statements. Now i want to access this method from the basket class so i can use the value from the variable "discount" to apply the discount.

I can't seem to access the academic class from the basket class. I think its because of it not being linked to the basket class directly? Is there a way i can access the calculateDiscount method from the academic class using the basket class?

Thanks -----Original Message----- From: dhbora [mailto:reply@reply.github.com] Sent: 02 January 2012 15:36 To: chamandeep Subject: Re: [AppShop---Programming-Kingston-University] Chamandeep please review your last changes (#2)

Hi, yes it's in the title of the commit: "... Removed order.cpp and order.h as those classes are now implemented inside of orderList.cpp and orderList.h ...". I just figured that the order class is only needed in the orderList class (becasue order list consists of objects of order class), as it's not needed anywhere else it's better to implement the order class inside of order list. Tomasz sent me a message today that he's not sure how to create the gui but don't worry I'll call him and explain how to do it so you can just carry on doing other things from the list. I'm currently improving the classes I've done before because there are some important things to add (I'm not adding anything new, just changing the way some methods work) but don't worry it should affect the things you're working on.

Thanks


Reply to this email directly or view it on GitHub: https://github.com/dhbora/AppShop---Programming-Kingston-University/issues/2#issuecomment-3330617

dhbora commented 12 years ago

So, I'm not sure if you're doing it right because from what I understand you have some method to return the discount and you're calling this method from the CONSTRUCTOR, is that right? What you should do is to create a VIRTUAL method in the customer class (or in the user class whichever way you think is better), You can call this method e.g. getDiscount(). Obviously customer doesn't have a discount so when you implement the method in customer class you can return 0 (which means that the customer has 0% discount). As you've declared the method as virtual it means that all derived classes (academic in this case) will have to have a method called getDiscount(). When you're implementing getDiscount() for academic class you can return the discount variable.

Now, you can't really access the method from basket class, but what you can do (e.g. in the workoutTotal()) is to add an argument that will be send to the workoutTotal() (so the workoutTotal will be like this: workoutTotal(short discount)). Then you need to apply the discount when working out the total and then when we are calling the workoutTotal from the main.cpp you can send the result of getDiscount() as an argument of workoutTotal(). You can call getDiscount from main.cpp by this command:

myShop.getCurrentUser()->getDiscount()

that's how I would do that and I think it should work. Obviously there are many different ways to complete this task so you don't have to do it like that.

I hope it answers your question?

chamandeep commented 12 years ago

hi.

I don't think i am calling this method in the constructor. Its a seperet method (i could be wrong of course!) Here is my code for the basket and the academic class.

include "academic.h"

include

include

academic::academic(const int ID, const char fName, const char sName, const char adrs1, const char adrs2, const char pCode, const char pass, const char *prof, const short years, const short grade) : customer(ID, fName, sName, adrs1, adrs2, pCode, pass, prof, years), gradePoint(grade) {

} short academic::workoutDiscount() { if ((profession == "academic") && age > 25) //what discount to apply discount = 0.1; else if((profession == "student") && (age < 25) && (gradePoint > 7)) discount = 0.25; else discount = 0; //user doesn't meet discount requirements return discount; }

academic::~academic() { }

the workout total method:

double basket::workoutTotal() { double total = 0.0; for(int i = 0; i < basketList.numberOfApps(); i++) total += basketList.getAppByPosition(i)->getPrice(); //go throgh all apps from the basket and add their prices to total short discount = basket * academic::workoutDiscount(); return total; }

I hope that makes sense?

Date: Mon, 2 Jan 2012 09:24:59 -0800 From: reply@reply.github.com To: chaman_grover@hotmail.com Subject: Re: [AppShop---Programming-Kingston-University] Chamandeep please review your last changes (#2)

So, I'm not sure if you're doing it right because from what I understand you have some method to return the discount and you're calling this method from the CONSTRUCTOR, is that right? What you should do is to create a VIRTUAL method in the customer class (or in the user class whichever way you think is better), You can call this method e.g. getDiscount(). Obviously customer doesn't have a discount so when you implement the method in customer class you can return 0 (which means that the customer has 0% discount). As you've declared the method as virtual it means that all derived classes (academic in this case) will have to have a method called getDiscount(). When you're implementing getDiscount() for academic class you can return the discount variable.

Now, you can't really access the method from basket class, but what you can do (e.g. in the workoutTotal()) is to add an argument that will be send to the workoutTotal() (so the workoutTotal will be like this: workoutTotal(short discount)). Then you need to apply the discount when working out the total and then when we are calling the workoutTotal from the main.cpp you can send the result of getDiscount() as an argument of workoutTotal(). You can call getDiscount from main.cpp by this command:

myShop.getCurrentUser()->getDiscount()

that's how I would do that and I think it should work. Obviously there are many different ways to complete this task so you don't have to do it like that.

I hope it answers your question?


Reply to this email directly or view it on GitHub: https://github.com/dhbora/AppShop---Programming-Kingston-University/issues/2#issuecomment-3331610

dhbora commented 12 years ago

Oh, yeah. I understood that you're calling it from constructor, my mistake.

Cool, so like I'm saying you need to send the discount as an argument to workoutTotal() because you can't access your method directly from the basket (if it were static method then you could but in this case you can't declare it as static - it's not allowed) so just send the result of workoutDiscount() to workoutTotal(short discount)

dhbora commented 12 years ago

And like I said make sure that your method for returning discount is also in the customer class (as virtual and returning 0). Otherwise the program may not compile

chamandeep commented 12 years ago

So do i understand this correctly? I should have a method in the customer and the academic class for workoutDiscount and getDiscount?

Both the methods in the customer class will return 0 but in the academic class both will return the value of discount?

Do the methods only need to be virtual in the customer class? They are done by adding a "~" cymbol in front of the declaration right?

Date: Mon, 2 Jan 2012 10:08:47 -0800 From: reply@reply.github.com To: chaman_grover@hotmail.com Subject: Re: [AppShop---Programming-Kingston-University] Chamandeep please review your last changes (#2)

And like I said make sure that your method for returning discount is also in the customer class (as virtual and returning 0). Otherwise the program may not compile


Reply to this email directly or view it on GitHub: https://github.com/dhbora/AppShop---Programming-Kingston-University/issues/2#issuecomment-3332007

dhbora commented 12 years ago

no no, getDiscount was just my suggestion for the name of your method but you called it workoutDiscount (which is fine, obviously) so you only need one of them.

The method has to be virtual in customer class - in academic it can be a normal method (non-virtual)

The symbol "~" is used only for destructor. It has nothing to do with virtual methods. If you want to declare a virtual method you add "virtual" before the method in header file, so your class could be declared like that: virtual short workoutDiscount();

chamandeep commented 12 years ago

o ok. Thanks i'll try to complete this today definitely. and work on other things. Is the submission online on thursday? I forget.

Date: Mon, 2 Jan 2012 10:23:13 -0800 From: reply@reply.github.com To: chaman_grover@hotmail.com Subject: Re: [AppShop---Programming-Kingston-University] Chamandeep please review your last changes (#2)

no no, getDiscount was just my suggestion for the name of your method but you called it workoutDiscount (which is fine, obviously) so you only need one of them.

The method has to be virtual in customer class - in academic it can be a normal method (non-virtual)

The symbol "~" is used only for destructor. It has nothing to do with virtual methods. If you want to declare a virtual method you add "virtual" before the method in header file, so your class could be declared like that: virtual short workoutDiscount();


Reply to this email directly or view it on GitHub: https://github.com/dhbora/AppShop---Programming-Kingston-University/issues/2#issuecomment-3332119

dhbora commented 12 years ago

Apparently we need to submit it online and hard copy on 5th of January but they said on blackboard that if we're not in the UK we can submit the hard copy after the deadline (by 9th of January) ... but yes the online one has to be in by 5th of Janury 10 am

dhbora commented 12 years ago

But do you know what we're supposed to submit as the hard copy? Do they want the source code on the CD or what, because I'm not sure?

chamandeep commented 12 years ago

We need to submit a printed copy of our code, self-assessment forms and a cd with the project. This is what it says in the specifications.

"Submit the complete work (in hard copy) or however far you have got (only one submission per group). Submit also a CD with the source code, together with the self-assessment forms."

Date: Mon, 2 Jan 2012 10:41:51 -0800 From: reply@reply.github.com To: chaman_grover@hotmail.com Subject: Re: [AppShop---Programming-Kingston-University] Chamandeep please review your last changes (#2)

But do you know what we're supposed to submit as the hard copy? Do they want the source code on the CD or what, because I'm not sure?


Reply to this email directly or view it on GitHub: https://github.com/dhbora/AppShop---Programming-Kingston-University/issues/2#issuecomment-3332283

dhbora commented 12 years ago

Oh Ok, so there's gonna be a lot of printing :D Thanks

dhbora commented 12 years ago

Hi Chamandeep, I'm afraid the code you've made is wrong again. Did you try to compile it? It won't compile and ... you know .. the code has to compile I looked at your code and I can find 2 mistakes there: 1) The program is working out the discount when we create a new user so you don't need to work it out again, the discount is already saved to the discount variable (read the addUser method from userList.cpp and you'll see what I mean). Your method only needs to return the discount. 2) The way you're working out the total in workoutTotal(short discount) is not correct. I'm talking about this line of code: total = total * discount; Let's take as an example an app that costs £100 and a customer that has 10% discount. If you apply your formula you'll get total price of £10.

Please test the code you've made before you upload it, and I'm not saying "make it compile" but I'm saying "test it whether it works the way you want it to work"

Thanks Mateusz

chamandeep commented 12 years ago

hello,

I compiled the code more than once before i pushed the changes, and each time it compiled successfully. If it didn't compile i would not have pushed it. As for working out the discount, i was not aware of it previously calculating when creating the user (i'll have a look at that now). And the calculation in the basket is wrong (its something i just realised).

Thanks

Date: Mon, 2 Jan 2012 13:54:32 -0800 From: reply@reply.github.com To: chaman_grover@hotmail.com Subject: Re: [AppShop---Programming-Kingston-University] Chamandeep please review your last changes (#2)

Hi Chamandeep, I'm afraid the code you've made is wrong again. Did you try to compile it? It won't compile and ... you know .. the code has to compile I looked at your code and I can find 2 mistakes there: 1) The program is working out the discount when we create a new user so you don't need to work it out again, the discount is already saved to the discount variable (read the addUser method from userList.cpp and you'll see what I mean). Your method only needs to return the discount. 2) The way you're working out the total in workoutTotal(short discount) is not correct. I'm talking about this line of code: total = total * discount; Let's take as an example an app that costs 100 and a customer that has 10% discount. If you apply your formula you'll get total price of 10.

Please test the code you've made before you upload it, and I'm not saying "make it compile" but I'm saying "test it whether it works the way you want it to work"

Thanks Mateusz


Reply to this email directly or view it on GitHub: https://github.com/dhbora/AppShop---Programming-Kingston-University/issues/2#issuecomment-3334088

dhbora commented 12 years ago

hmm, I'm not sure why it compiles for you but it definitely shouldn't. I've even compared the files that are on github with those on my computer to make sure that I have the latest version of the files and I do. I tried compiling it in code::blocks and in MS Visual Studio as well. It just doesn't compile on any of them. Maybe the files got corrupted on the server for some reason but this version that's on github wouldn't compile for sure. For example in the main.cpp in line 31 we've got this line of code:

    cout << "Total: " << myShop.getCurrentUser()->getBasket()->workoutTotal() << endl << endl;

This is calling a method from the basket called workoutTotal() with empty brackets. This cannot compile because you've changed the method workoutTotal() to be workoutTotal(short discount), this means that a method called workoutTotal which takes no arguments doesn't exist anymore. It means it cannot be compiled. Also in the academic.cpp you've got:

short workoutDiscount()

but it should be:

short academic::workoutDiscount()

otherwise it wouldn't compile. So if the files got corrupted while being sent to the server can you upload them again, please?

Thanks

dhbora commented 12 years ago

Oh, actually working out the discounts and saving it in the discount variable is done in academic constructor not in userList but when you modified the files the code was moved from the constructor to the method you've created. I think you've done that accidentally but yeah it should be in the constructor.

chamandeep commented 12 years ago

hi,

It seems that the files wern't coropted i'm still having some issues with compiling; i could have sworn it was compiling before i pushed yesterday. There are a few that make sense, but a lot of the errors are from files that i haven't even touched? the following is returned for most classes: user.h, customer.h, applist.h etc. "applist.h(17): warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow)" I'm not sure what exactly that means. Another error i'm finding difficult to workout, is in the academic class, i have got an error saying that the attribute "discount" does not exist, when it has been declared in academic.h as short?

Thanks and sorry about all these issues.

dhbora commented 12 years ago

Hi, the things in most classes are only warnings, they don't affect whether the program can compile (unless you changed the default settings in the compiler to stop compilation when warning comes up). Honestly i'm not sure what these warnings are about but I guess is nothing important because they're not shown in code::blocks. You only need to take care of errors

chamandeep commented 12 years ago

Hi,

Thanks. It didn't really say it was worning or errors so got confused :)

All my other classes now compile, apart from the main.cpp. I am getting the below errors on 2 lines.

cout << "Total: " << myShop.getCurrentUser()->getBasket()->workoutTotal(short discount) << endl << endl; 1>c:\apc\appshop---programming-kingston-university\main.cpp(35): error C2144: syntax error : 'short' should be preceded by ')' 1>c:\apc\appshop---programming-kingston-university\main.cpp(35): error C2660: 'basket::workoutTotal' : function does not take 0 arguments 1>c:\apc\appshop---programming-kingston-university\main.cpp(35): error C2059: syntax error : ')' 1>

It's the same error for both lines 31, 35. I can't workout what i've done wrong? I have specified the "short discount" argument in the workoutTotal(short discount) but it still comes up with this.

Hopefully its a simple problem to fix. Otherwise all other classes compile apart from the wornings

thanks -----Original Message----- From: dhbora [mailto:reply@reply.github.com] Sent: 03 January 2012 14:07 To: chamandeep Subject: Re: [AppShop---Programming-Kingston-University] Chamandeep please review your last changes (#2)

Hi, the things in most classes are only warnings, they don't affect whether the program can compile (unless you changed the default settings in the compiler to stop compilation when warning comes up). Honestly i'm not sure what these warnings are about but I guess is nothing important because they're not shown in code::blocks. You only need to take care of errors


Reply to this email directly or view it on GitHub: https://github.com/dhbora/AppShop---Programming-Kingston-University/issues/2#issuecomment-3340193

chamandeep commented 12 years ago

Hello,

I started to work on returning the total number of purchases. I have added a method in the orderlist class to return the numberOfPurchases as follows.

int orderList::getNumberOfPurchases() { return numberOfPurchases; }

I am wanting to add something like the following in the main class to display the numberofpurchases, but not sure where to add. myShop.getCurrentUser()->getNumberOfPurchases();

Also returning the number of purchases will return the number of orders will it not. But an order can have many applications that have been purchased.

Please can you get back to me? -----Original Message----- From: dhbora [mailto:reply@reply.github.com] Sent: 03 January 2012 14:07 To: chamandeep Subject: Re: [AppShop---Programming-Kingston-University] Chamandeep please review your last changes (#2)

Hi, the things in most classes are only warnings, they don't affect whether the program can compile (unless you changed the default settings in the compiler to stop compilation when warning comes up). Honestly i'm not sure what these warnings are about but I guess is nothing important because they're not shown in code::blocks. You only need to take care of errors


Reply to this email directly or view it on GitHub: https://github.com/dhbora/AppShop---Programming-Kingston-University/issues/2#issuecomment-3340193

dhbora commented 12 years ago

Hi Chamandeep, Sorry I was busy yesterday and couldn't reply. So did you manage to solve these problems?

chamandeep commented 12 years ago

Hi,

No problem, unfortunetly not I have tried many possibilities, but nothing works.

-----Original Message----- From: dhbora [mailto:reply@reply.github.com] Sent: 04 January 2012 14:04 To: chamandeep Subject: Re: [AppShop---Programming-Kingston-University] Chamandeep please review your last changes (#2)

Hi Chamandeep, Sorry I was busy yesterday and couldn't reply. So did you manage to solve these problems?


Reply to this email directly or view it on GitHub: https://github.com/dhbora/AppShop---Programming-Kingston-University/issues/2#issuecomment-3354841

dhbora commented 12 years ago

OK, so for the first problem, you can't send (short discount) to a method when you're calling it because what value does short discount have in this case? Undefined value so it doesn't make sense. Instead you need to call your method (the one for returning discount) and send the result of your method to workoutTotal. That's the solution for first problem.

And for the second problem, well, you can call it wherever you want as long as a customer is logged in in that place. But yes it will return the number of orders not number of apps so you need to add a variable in order class which will store how many apps have been purchased and modify the methods that I have created for placing order so it will add the number of apps purchased to the new variable, alternatively you can create some method that will count how many apps are in each order and return the value. That's it.

Also I remember some time ago we agreed on who is doing what and I remember you said you'll create methods for editing customer's and app's details. I can see it's mostly done but not finished yet, still some data (e.g. age of an academic customer) is can't be edited so it would be nice if finish those them as well.

Anyway it's the last day and we need to finish the program and test it today so let's do it this way: first you'll fix the first problem as it's very easy to fix, then you'll do all the remaining methods for editing data and the last thing you'll do is the method for returning total number of apps purchased by a user. I'll do all the other things from the list. Is it ok?

dhbora commented 12 years ago

I mean the third thing you could do is return total number of apps purchased .... not by the user but in the whole system.

chamandeep commented 12 years ago

Hi.

Thanks for your email. I'll do that. The editing of age and the rest as you suggested.

thanks -----Original Message----- From: dhbora [mailto:reply@reply.github.com] Sent: 04 January 2012 15:45 To: chamandeep Subject: Re: [AppShop---Programming-Kingston-University] Chamandeep please review your last changes (#2)

I mean the third thing you could do is return total number of apps purchased .... not by the user but in the whole system.


Reply to this email directly or view it on GitHub: https://github.com/dhbora/AppShop---Programming-Kingston-University/issues/2#issuecomment-3356163

dhbora commented 12 years ago

Oh and also, you know, the thing with applying discount to app prices, can you push the working version to github now, I need it Thanks

chamandeep commented 12 years ago

Hi,

I've tried to do things like adding the getdiscount before the workoutTotal but its not working. Is that something you could possibly fix please? I tried it in a few places but nothing seems to work.

Thanks -----Original Message----- From: dhbora [mailto:reply@reply.github.com] Sent: 04 January 2012 16:12 To: chamandeep Subject: Re: [AppShop---Programming-Kingston-University] Chamandeep please review your last changes (#2)

Oh and also, you know, the thing with applying discount to app prices, can you push the working version to github now, I need it Thanks


Reply to this email directly or view it on GitHub: https://github.com/dhbora/AppShop---Programming-Kingston-University/issues/2#issuecomment-3356579

chamandeep commented 12 years ago

Hi

I have been trying to return the number of apps purchased but really stuck on how to do it? I thought a vector was being used in the basket class so i could do something like basketList.size and store that in a variable before adding the basket to the orderlist. But that doesn't seem to be the case. I also wanted to try and find the number of apps in each specific order but as the order is an item within the vector , i don't know how i can find the number of apps within 1 vector item.

Sorry about all this. I pushed all my last changed to git a few hours back.

Thanks

-----Original Message----- From: dhbora [mailto:reply@reply.github.com] Sent: 04 January 2012 16:12 To: chamandeep Subject: Re: [AppShop---Programming-Kingston-University] Chamandeep please review your last changes (#2)

Oh and also, you know, the thing with applying discount to app prices, can you push the working version to github now, I need it Thanks


Reply to this email directly or view it on GitHub: https://github.com/dhbora/AppShop---Programming-Kingston-University/issues/2#issuecomment-3356579

chamandeep commented 12 years ago

Hey Mateusz,

Happy birthday! I just spoke to Tomasz and he said you 2 have been up all night for the programming. Your a life saver seriously, i wouldn't have got anywhere near what we have now. Thanks a lot for doing that. Please let me know if there is anything i can do at this stage? It's a shame that it has to be on your birthday. I feel bad for not doing enough. I tried to text u but the text failed.

Thanks

-----Original Message----- From: dhbora [mailto:reply@reply.github.com] Sent: 04 January 2012 16:12 To: chamandeep Subject: Re: [AppShop---Programming-Kingston-University] Chamandeep please review your last changes (#2)

Oh and also, you know, the thing with applying discount to app prices, can you push the working version to github now, I need it Thanks


Reply to this email directly or view it on GitHub: https://github.com/dhbora/AppShop---Programming-Kingston-University/issues/2#issuecomment-3356579

dhbora commented 12 years ago

Hi, thanks for the wishes. Well, we haven't finished the gui unfortunately but I hope they'll look at the code itself and see that most things are done. Now we can only wait

chamandeep commented 12 years ago

Hi,

That's great. Well i think the marks should be given for the back end code rather than the gui so hopefully it will be ok. The main marks are in the exam so lets see how that goes. How did your birthday go?

Can you please also push the final changes to github? Also, if you want me to print or make a disk of the code then let me know for submission on Monday. The deadline is at 10AM. I'm not sure what time your exam is?

Thanks -----Original Message----- From: dhbora [mailto:reply@reply.github.com] Sent: 06 January 2012 16:35 To: chamandeep Subject: Re: [AppShop---Programming-Kingston-University] Chamandeep please review your last changes (#2)

Hi, thanks for the wishes. Well, we haven't finished the gui unfortunately but I hope they'll look at the code itself and see that most things are done. Now we can only wait


Reply to this email directly or view it on GitHub: https://github.com/dhbora/AppShop---Programming-Kingston-University/issues/2#issuecomment-3386886