Make a flowchart in the below code? #include int main() { int number, quantity = 0; int quantity1, quantity2 , quantity3 , quantity4 , quantity5 ,quantity6 ,quantity7 ,quantity8 ,quantity9,quantity10; double amount1 , amount2, amount3 , amount4 , amount5 ,amount6 ,amount7 ,amount8 ,amount9 ,amount10 ; for( ;number != -1;) { printf("Enter product number (enter -1 to end): ") ; scanf("%d",&number); printf("and quantity sold (enter -1 to end): ") ; scanf("%d",&quantity); switch( number ) { case 1: quantity1 += quantity; amount1 += quantity * 6.00; break; case 2: quantity2 += quantity; amount2 += quantity * 8.50; break; case 3:

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Make a flowchart in the below code?

#include <stdio.h>
int main()
{
int number, quantity = 0;
int quantity1, quantity2 , quantity3 , quantity4 , quantity5 ,quantity6 ,quantity7 ,quantity8 ,quantity9,quantity10;
double amount1 , amount2, amount3 , amount4 , amount5 ,amount6 ,amount7 ,amount8 ,amount9 ,amount10 ;

for( ;number != -1;)
{

printf("Enter product number (enter -1 to end): ") ;
scanf("%d",&number);
printf("and quantity sold (enter -1 to end): ") ;
scanf("%d",&quantity);

switch( number )
{
case 1:
quantity1 += quantity;
amount1 += quantity * 6.00;
break;
case 2:
quantity2 += quantity;
amount2 += quantity * 8.50;
break;
case 3:
quantity3 += quantity;
amount3 += quantity * 10.15;
break;
case 4:
quantity4 += quantity;
amount4 += quantity * 3.50;
break;
case 5:
quantity5 += quantity;
amount5 += quantity * 14.13;
break;
case 6:
quantity6 += quantity;
amount6 += quantity * 25.50;
break;
case 7:
quantity7 += quantity;
amount7 += quantity * 23.98;
case 8:
quantity8 += quantity;
amount8 += quantity * 19.11;
break;
case 9:
quantity9 += quantity;
amount9 += quantity * 31.21;
break;
case 10:
quantity10 += quantity;
amount10 += quantity * 34.64;
break;
default:
printf("Enter correct product number!") ;
break;
}


}
printf("Sold product number: %lf\n", (quantity1 + quantity2 + quantity3 + quantity4 + quantity5 + quantity6 + quantity7 + quantity8 + quantity9 + quantity10)) ;
printf("Sold product value $: %lf\n", (amount1 + amount2 + amount3 + amount4 + amount5 + amount6 + amount7 + amount8 + amount9 + amount10) ) ;


return 0;
}

Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY