Skip to main content
+
Source Link
DinoCoderSaurus
  • 28.6k
  • 2
  • 12
  • 31

The program is sending users input value dollars to the function here greedyAlgorithm(dollars); // Run the greedy algorithm. Is that what you meant? Probably not, since the previous line is int n=round(dollars*100);, you probably meant to send n to the function.

Review the lecture notes (or the lecture) to see how to use do ... while to do "something first, then checks a condition, and repeats until the condition is no longer true.". It needs a do/while loop. Did you do mario? If so, use the same strategy. If not, review the lecture or the lecture notes, there is an example in "positive.c".

The program is sending users input value dollars to the function here greedyAlgorithm(dollars); // Run the greedy algorithm. Is that what you meant?

Review the lecture notes (or the lecture) to see how to use do ... while to do "something first, then checks a condition, and repeats until the condition is no longer true."

The program is sending users input value dollars to the function here greedyAlgorithm(dollars); // Run the greedy algorithm. Is that what you meant? Probably not, since the previous line is int n=round(dollars*100);, you probably meant to send n to the function.

Review the lecture notes (or the lecture) to see how to use do ... while to do "something first, then checks a condition, and repeats until the condition is no longer true.". It needs a do/while loop. Did you do mario? If so, use the same strategy. If not, review the lecture or the lecture notes, there is an example in "positive.c".

Source Link
DinoCoderSaurus
  • 28.6k
  • 2
  • 12
  • 31

The program is sending users input value dollars to the function here greedyAlgorithm(dollars); // Run the greedy algorithm. Is that what you meant?

Review the lecture notes (or the lecture) to see how to use do ... while to do "something first, then checks a condition, and repeats until the condition is no longer true."