USING SWITCH and LOOPING. A local school needs aprogram written to compute funds
ID: 3610084 • Letter: U
Question
USING SWITCH and LOOPING. A local school needs aprogram written to compute funds raised based on sales of varioustypes of $10.00 gift cards. Students have a choice of which type ofgift card they want to sell: Starbucks, Jamba Juice or Cold Stone.Each gift card carries with it a different contribution amount fromthe company to the fund raiser event. In the table below, pleasenote how much each company contributes towards the fund raisingbased on sales of their gift card. Category Type of Gift Card FundRaising Contribution "S" or "s" Starbucks 50% "J" or "j" Jamba Juice 30% "C" or "c" Cold Stone 25%Write a program that: Asks the user for the student ID (a 4-digit numericidentification number), the type of gift card the student chose tosell ("S", "s", "J", "j", "C", "c") and how many of that gift cardthe student sold. Computes and prints the amount of funds raised by thestudent. Keeps a running total of the number of gift cards sold foreach company. Keeps a running total of the funds raised from sales for typeof gift card. Keeps a running total of the overall number of gift cardssold. Keeps a running total of the overall amount of fundsraised. Outputs the running totals.
***************************Your Name Fund RaiserCalculator**********************
Do you have data to enter regarding student sales? (1=yes,0=no) 1
Please enter the Student ID 1111 Please enter the type of gift card sold (S=Starbucks, J=Jamba Juice, C=Cold Stone): S Please enter the number of cards sold: 20
The funds raised by Student 1111 is: 100.00
Do you have more data to enter? (1=yes, 0=no)? 1
Category Type of Gift Card FundRaising Contribution "S" or "s" Starbucks 50% "J" or "j" Jamba Juice 30% "C" or "c" Cold Stone 25%
Write a program that: Asks the user for the student ID (a 4-digit numericidentification number), the type of gift card the student chose tosell ("S", "s", "J", "j", "C", "c") and how many of that gift cardthe student sold. Computes and prints the amount of funds raised by thestudent. Keeps a running total of the number of gift cards sold foreach company. Keeps a running total of the funds raised from sales for typeof gift card. Keeps a running total of the overall number of gift cardssold. Keeps a running total of the overall amount of fundsraised. Outputs the running totals.
***************************Your Name Fund RaiserCalculator**********************
Do you have data to enter regarding student sales? (1=yes,0=no) 1
Please enter the Student ID 1111 Please enter the type of gift card sold (S=Starbucks, J=Jamba Juice, C=Cold Stone): S Please enter the number of cards sold: 20
The funds raised by Student 1111 is: 100.00
Do you have more data to enter? (1=yes, 0=no)? 1
Explanation / Answer
please rate - thanks (note-nothing was said about error checking) #include using namespace std; int main() {int id, numsold,yorno,counts=0,countj=0,countc=0,totcount=0; char category; doublecontrib,totals=0,totalj=0,totalc=0,cont=0,student=0,totraised=0; coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.