Description
Explanation & Answer
Q.1
#include<stdio.h>
#include<conio.h>
void main()
{
int i,choice;
float prefix,price=0.0;
char *country[4] = {"California","Texas","NewYork","Hawaii"};
float tax[4] = {10,8.25,8.875,4.712};
printf("Please enter the prefix amount: ");
scanf("%f",&prefix);
printf("\nselect your state:\n");
for(i = 0;i<4;i++)
{
printf("1%d - %s",i+1,country[i]);
}
printf("Enter your input: \n");
scanf("%d",&choice);
switch(choice)
{
case 1:price =prefix *(tax[choice-1]/100);break;
case 2:price =prefix *(tax[choice-1]/100);break;
case 3:price =prefix *(tax[choice-1]/100);break;
case 4:price =prefix *(tax[choice-1]/100);break;
default: printf("Please enter a valid choice");
}
printf("\nThe sale price of the product is %f",price);
printf("\nPress any key to continue...");
}
Please choose as best answer.Review
Review
24/7 Homework Help
Stuck on a homework question? Our verified tutors can answer all questions, from basic math to advanced rocket science!
Similar Content
Related Tags
Sounds Like Titanic
by Jessica Chiccehito Hindman
The Secret Garden
by Frances Hodgson Burnett
Team of Vipers
by Cliff Sims
Fools Crow
by James Welch
The Glass Castle
by Jeannette Walls
The Sun Is Also a Star
by Nicola Yoon
Girl Stop Apologizing
by Rachel Hollis
The Dispossessed
by Ursula Kroeber Le Guin
Ezperanza Rising
by Pam Muñoz Ryan