Can you explain what "the condition" is you are talking about? And why it is always going to be true.
Type: Posts; User: Norm
Can you explain what "the condition" is you are talking about? And why it is always going to be true.
Do the same as these:
...donationQuantity=0, maxDonation=0 ...
highestDonation=newDonation;
That sets highestDonation to the value of newDonation changing the old value of highestDonation.
Then the next statement:
if(newDonation>highestDonation)
can...
What value will it hold?
What data is the currentDonation variable supposed to hold?
If you don't have any use for it, get rid of it.
Have you defined what each of those three variables will hold?
What's the difference between new and current?
Take a look at that. Does it look correct? It changes the value of newdonation.
What value is in currentDonation? Is that the correct variable?
You need to define in English what each of...
Suppose you can determine that the new donation is bigger than the current biggest donation:
What should be done now that the code has found the new donation is more than the current biggest...
How would you detect if the new donation is more than the current biggest donation?
Then what?
Step 1. should be broken down into separate, very simple steps. Each step should fit on a line.
For example:
initialize total and highest
begin loop
ask user for name
read name and save
ask...
Try making the list of steps the program needs to do to solve the problem. When you have the list of steps, then worry about how to code it.
Have you tried to think how to program this problem? What steps must the code take to do what you want it to do?
Try making a list of the steps and if you have problems, post the list and the...