it\'s required for the steps to be like this answer in the second and third pape
ID: 3822676 • Letter: I
Question
it's required for the steps to be like this answer in the second and third papers
Explanation / Answer
#include <stdlib.h>
#include <stdio.h>
#define COBALT_PRICE 5.99
#define NICKEL_PRICE 3.99
#define TIN_PRICE 4.99
#define ZINC_PRICE 5.99
#define IRON_PRICE 4.99
#define URANIUM_PRICE 6.99
main(){
int ch = 0;
double tp = 0;
printf("Welcome to MINING CO.! ");
printf("May a take your order? ");
do{
printf("Menu: ");
printf("1. Cobalt $%.2lf ", COBALT_PRICE );
printf("2. Nickel $%.2lf ", NICKEL_PRICE );
printf("3. Tin $%.2lf ", TIN_PRICE );
printf("4. Zinc $%.2lf ", ZINC_PRICE );
printf("5. Iron $%.2lf ", IRON_PRICE);
printf("6. Uranium $%.2lf ", URANIUM_PRICE);
printf("7. Exit ");
printf("Enter an your choice: );
switch(ch){
case 1:
tp += COBALT_PRICE ;
break;
case 2:
tp += NICKEL_PRICE ;
break;
case 3:
tp += TIN_PRICE ;
break;
case 4:
tp += ZINC_PRICE ;
break;
case 5:
tp += IRON_PRICE;
break;
case 6:
tp += URANIUM_PRICE;
break;
case 7:
printf("Than you for ordering at MINING CO.! ");
break;
default:
printf("Invalid Selection. ");
break;
}
printf("Total so far: $%.2lf ", tp);
} while (ch != 7);
printf("Your order is $%.2lf ", tp);
printf("Thankyou For Shopping With Us. ");
printf("Have a nice day!. ");
system("pause");
}
Hope it helps.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.