Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

You have been hired to write an application by your employer, Crying Four Year O

ID: 674968 • Letter: Y

Question

You have been hired to write an application by your employer, Crying Four Year Olds Inc. Your company produces a miracle elixir that when given to a crying four year old (let’s say if his name is Brendan…), he will immediately turn his day around with a smile.

Your product comes in two varieties – Fruit Punch Smile & Pucker Face Nap. Your application must ask the user for their name, address, and the flavor desired, and the number of cases. The product is $29.99 a case. Print an invoice showing the flavor, quantity, & price. Assume a 7.25% sales tax.  

written in c++ programming, simplest way to program it

Explanation / Answer

#include <iostream>
using namespace std;

int main()
{
char choice = 'Y';
string name, address1, address2;
int flavor, number;
double finalPrice;
while(choice == 'Y')
{
cout<<"Crying Four Years Old Inc"<<endl;
cout<<"Flavors:"<<endl<<"1. Fruit Punch Smile"<<"2. Pucker Face Nap"<<endl;
cout<<"Enter your name: ";
cin>>name;
cout<<"Enter your address:"<<endl<<"Line 1:";
cin>>address1;
cout<<"Line 2: ";
cin>>address2;
cout<<"Enter your desired flavor: ";
cin>>flavor;
cout<<"Enter the number of cases: ";
cin>>number;
finalPrice = number * 29.99 * 1.0725;
cout<<"Hello "<<name;
cout<<"Thanks for your purchase. You bought "<<number<<" ";
if(flavor == 1)
cout<<"Fruit Punch Smiles.";
else
cout<<"Pucker Face Naps.";
cout<<"And your bill sums up to: "<<finalPrice<<endl;
cout<<"Do you want to purchase something else? : ";
cin>>choice;
if(choice != 'Y')
{
cout<<"Have a happy day for your child. Bye..."<<endl;
exit(0);
}
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote