Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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;

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote