Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int main()
- {
- int hugeAmount; //50 doodles
- int largeAmount; //25 doodles
- int mediumAmount; //10 doodles
- int smallAmount; //1 doodle
- int shippedDoodles; //total shipped
- int temp;
- cout<<"How many doodles were shipped?"<<endl;
- cin>>shippedDoodles;
- temp=shippedDoodles; //Assigns a temp value for calculations so
- //shipped can be displayed later
- if(temp-50>0) //Calculates the huge amount
- {
- hugeAmount++;
- temp-=50;
- }
- if(temp-25>0) //Calculates the large amount
- {
- largeAmount++;
- temp-=25;
- }
- if(temp-10>0) //Calculates the medium amount
- {
- mediumAmount++;
- temp-=10;
- }
- if(temp-1>0) //Calculates the small amount
- {
- smallAmount++;
- temp-=1;
- }
- cout<<temp<<endl; //To show the remaining amount
- cout<<hugeAmount<<endl; //Displays huge amount
- cout<<largeAmount<<endl; //Displays large amount
- cout<<mediumAmount<<endl; // Displays medium amount
- cout<<smallAmount<<endl; //Displays small amount
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement