Hey there, I am learning C++ and I need help to build a program the exercise: A
box of cookies can hold 24 cookies, and a container can hold 75 boxes of cookies. Write a program that prompts the user to enter the total number of cookies. The program then outputs the number of boxes and containers to ship the cookies. Note that each box must contain the specified number of cookies and each container must contain the specified number of boxes. If the last box of cookies contains less than the number of specified cookies, you can discard it, and output the number of leftover cookies. Similarly, if the last container contains less than the number of specified boxes, you can discard it and output the number of leftover boxes.
1- The user to enter the number of cookies (24 cookies equals 1 box and 75 boxes equal 1 container)
2- the program would show the number of boxes and containers needed
3- If the user has leftovers cookies the program should show the reminder with the message you have X else not show the expression " you have X cookies left". Thank you :)
#include<iostream>
usingnamespace std;
int main()
{
int cookie;
constint box=cookie/24;
constint container=box/75;
float leftC;
int leftB;
int numC;
int numB;
cout<<"enter the number of cookies";
cin>>numC;
cout<<"the number of boxes needed to hold the cookies"<<endl;
box=numC/cookie;
cout<<box<<endl;
leftC=numC%box;
cout<<"leftover cookies = "" "<<leftC<<endl;
cout<<"the number of container needed to store the boxes"<<endl;
cout<<container<<endl;
leftB=box%container;
cout<<"leftover boxes =" <<leftB;
return 0;
}