Speedy overnight shipping uses four shipping methods: air, truck, rail, and hand
ID: 3542508 • Letter: S
Question
Speedy overnight shipping uses four shipping methods: air, truck, rail, and hand delivery. Write a program that allows the user to type in a shipping method code: 'a', 't', 'r', or 'h'. Have the program display the shipping rate according to the following table:
method rate
a 14.95
t 10.25
r 8.75
h 25.99
Explanation / Answer
int main(){
char method;
scanf("%c",&method);
switch(method){
case 'a':
printf("14.95");
break;
case 't':
printf("10.25");
break;
case 'r':
printf("8.75");
break;
case 'h':
printf("25.99");
break;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.