Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1.  
  2.  
  3. #include <iostream>
  4. #include <fstream>
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. int hugeAmount; //50 doodles
  10. int largeAmount; //25 doodles
  11. int mediumAmount; //10 doodles
  12. int smallAmount; //1 doodle
  13. int shippedDoodles; //total shipped
  14. int temp;
  15. cout<<"How many doodles were shipped?"<<endl;
  16. cin>>shippedDoodles;
  17. temp=shippedDoodles; //Assigns a temp value for calculations so
  18. //shipped can be displayed later
  19.  
  20. if(temp-50>0) //Calculates the huge amount
  21. {
  22. hugeAmount++;
  23. temp-=50;
  24. }
  25. if(temp-25>0) //Calculates the large amount
  26. {
  27. largeAmount++;
  28. temp-=25;
  29. }
  30. if(temp-10>0) //Calculates the medium amount
  31. {
  32. mediumAmount++;
  33. temp-=10;
  34. }
  35. if(temp-1>0) //Calculates the small amount
  36. {
  37. smallAmount++;
  38. temp-=1;
  39. }
  40. cout<<temp<<endl; //To show the remaining amount
  41. cout<<hugeAmount<<endl; //Displays huge amount
  42. cout<<largeAmount<<endl; //Displays large amount
  43. cout<<mediumAmount<<endl; // Displays medium amount
  44. cout<<smallAmount<<endl; //Displays small amount
  45. system("pause");
  46. return 0;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement