Menu

[Solved]Include Include Define Newgear 150 Define Usedgear 50 Int Main Int Type Int Numitems Float Q37290624

#include<stdio.h>
#include<stdlib.h>

#define NEWGEAR 15.0
#define USEDGEAR 5.0

int main(){

int type;
int num_items;
float total;

printf(“Welcome to the marketn”);
printf(“What would you like to don”);
printf(“t1-Buy New Gearn”);
printf(“t2-Buy used gearn”);
printf(“t3-Quitn”);

scanf(“%d”,&type);

while(type!=3){
switch (type){
case 1:
printf(“How many new items would you like?n”);
scanf(“%d”, &num_items);
total = num_items * 15.0;
break;

case 2:
printf(“How many old items would you like?n”);
scanf(“%d”, &num_items);
total = num_items * USEDGEAR;

case 3:
break;

default:
printf(“Not a valid optionn”);
break;

}
}

printf(“Your total cost is %fn”,total);

return 0;
}

what mistake am i making?

Expert Answer


Answer to #include #include #define NEWGEAR 15.0 #define USEDGEAR 5.0 int main(){ int type; int num_items; float total; printf(“We… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *