homework help

0 nana kodjo · September 22, 2016
Write a program that prompts the user for the amount of change in bills that he/she needs. If the  user provides a negative amount, print “Invalid amount!” to the screen and exit the program.  Otherwise, the program is to print the amount of change (in bills) with hundreds, twenties, tens,  fives, and ones (yes, there are other bills out there, but we'll only worry about these bills

Post a Reply

Replies

Oldest  Newest  Rating
+2 Scott Walker · September 23, 2016
No one will do your homework for you. If you have problems they will help. How will you ever improve if you don't try?
0 john shaw · September 28, 2016
Get the best Dissertation & Custom Essay Writing Service from our Qualified Writers. Trust the best and never regret. Try our Essay Help and see the difference in your grades.

http://academicessaywritingservice.co.uk
0 Yvan Sinues · September 28, 2016
if change < 0 {
exit
}
else{
output change
}

This would help I think.
0 Zahra Shokrollahi · September 28, 2016
#include <iostream>
using namespace std;

int main()
{
    int change;
    cout << "Enter the amount of change: "<< endl;
    cin>>change;
    if (change<0){
        cout<< "Invalid amount!";
        }else{
            int m100=change/100;
            change=change%100;
            int m20=change/20;
            change=change%20;
            int m10=change/10;
            change=change%10;
            int m5=change/5;
            change=change%5;
            cout << "The number of hundreds are: "<< m100 << endl;
            cout << "The number of twenties are: "<< m20 << endl;
            cout << "The number of tens are: "<< m10 << endl;
            cout << "The number of fives are: "<< m5 << endl;
            cout << "The number of ones are: "<< change << endl;


    }
}
+3 pwntastic _ · September 29, 2016
The coding help provided by users is a nice gesture but I would suggest not encouraging this type of behavior.  The user did not even provide an attempt to see what they were doing wrong making it seem that they are only interested in turning something in instead of actually learning.

It's been a few days since this was posted and it may be likely that the assignment was already due but still why waste time with something like this?
  • 1

C++

131,221 followers
About

Used in many types of software including music players, video games, and many large scale applications.

Links
Moderators
Bucky Roberts Administrator