Make a flowchart in the below code? #include int main() { int number, quantity = 0; int quantity1, quantity2 , quantity3 , quantity4 , quantity5 ,quantity6 ,quantity7 ,quantity8...


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:
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;
}

Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here