Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need a Flowchart for this code: int main() { // main method printf( tWelcome to the Best Friend Dog Rescue Charity Night at the

I need a Flowchart for this code:

int main() { // main method printf(" \tWelcome to the Best Friend Dog Rescue Charity Night at the Movies!"); printf(" \tTicket Sales for Adults: "); int adult[6], child[4],expenses[5]; // decleration of arrays to store the respective price. int adult_total=0, child_total=0, expenses_total=0, charity=0, total_ticket=0; // variables to store the total respective prices. int i; for(i=1;i<=6;i++){ // for loop to get the price of adult tickets printf("\tAdult Ticket Price: $"); scanf("%d", &adult[i]); // storing the user input to the respective array } for(i=1;i<=6;i++){ // for loop to calculate the total. adult_total=adult_total+adult[i]; } printf(" \tTotal Adult Tickets sales are $%d", adult_total); // showing the total. printf(" \tTicket Sales for Children: "); for(i=1;i<=4;i++){ // for loop to get the price of child tickets printf("\tChild Ticket Price: $"); scanf("%d", &child[i]); // storing the user input to the respective array } for(i=1;i<=4;i++){ // for loop to calculate the total. child_total=child_total+child[i]; } printf(" \tTotal Child Tickets sales are $%d", child_total); // showing the total. printf(" \tSnack Sales: "); for(i=1;i<=5;i++){ // for loop to get the price of printf("\tSnack Prices: $"); scanf("%d", &expenses[i]); // storing the user input to the respective array } for(i=1;i<=5;i++){ // for loop to calculate the total. expenses_total=expenses_total+expenses[i]; } printf(" \tTotal Snack sales are $%d", expenses_total); // showing the total. total_ticket=adult_total+child_total+expenses_total; // calculating the total sales of tickets printf(" \tTotal Tickets Sales are $%d",total_ticket); // showing the total sale. charity=total_ticket*0.45; // calculating the charity percentage as 45% i.e 0.45 of total sale. printf(" \tThe Total donation for the Charity Event is $%d", charity); // showing the charity return 0; }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

New Trends In Databases And Information Systems Adbis 2019 Short Papers Workshops Bbigap Qauca Sembdm Simpda M2p Madeisd And Doctoral Consortium Bled Slovenia September 8 11 2019 Proceedings

Authors: Tatjana Welzer ,Johann Eder ,Vili Podgorelec ,Robert Wrembel ,Mirjana Ivanovic ,Johann Gamper ,Mikolaj Morzy ,Theodoros Tzouramanis ,Jerome Darmont

1st Edition

3030302776, 978-3030302771

More Books

Students also viewed these Databases questions

Question

suggest a range of work sample exercises and design them

Answered: 1 week ago