Calculate and print the store location, sales and tax rate

Assignment Help Computer Graphics
Reference no: EM13951016

Attached is a code file that works accept when a correct dollar amount an location number is entered, the result flashes on the screen and disappears. How do I get the output results to stay on the screen?

#include <stdio.h>

/*Using define macros for assigning tax to different stores */
#define DelMar 7.25
#define Encinitas 7.5
#define LaJolla 7.75

/*
Input:
• Del Mar - 7.25%
• Encinitas - 7.5%
• La Jolla - 7.75%

Output:
The sales tax amount for each store of the $ Purchase amount for each.
*/
float user_input(){
float amount;
printf("Please Enter the sales amountn");
scanf("%f", &amount);
fflush(stdin);
return amount;
}

int displayMenu(){
int choice;
printf("1. Del Mar - (7.25%%)n");
printf("2. Encinitas - (7.5%%)n");
printf("3. La Jolla - (7.75%%)n");
printf("nnSelect a store for tax calculation [1-3]:");

scanf("%d",&choice);
return choice;
}

int main(){
// The total sales for each store is
float sales = 0.00;
int storenum;

sales = user_input();
if (sales <= 0.0) {
printf(" n");
printf("ERROR! Sales must be greater than 0.00");

}

storenum = displayMenu();

//Display Program Header
printf(" n");
printf(" Tax Calculator for Kudler Fine Foodsnnn");

printf("STORE LOCATIONtSALES AMOUNTtTAX RATEtTAX AMOUNTn");
printf("==============t============t========t==========n");
printf("==============t============t========t==========n");

switch (storenum){
case 1:
//Calculate and print the store location, Sales, Tax rate, and Tax amnt for Del Mar
printf("Del Mar t$%.2ftt%.2f%%tt%.2f%tn",sales, DelMar, sales*DelMar/100);
break;
case 2:
//Calculate and print the store location, Sales, Tax rate, and Tax amnt for Encinitas
printf("Encinitast$%.2ftt%.2f%%tt%.2f%tn",sales, Encinitas, sales*Encinitas/100);
break;
case 3:
//Calculate and print the store location, Sales, Tax rate, and Tax amnt for La Jolla
printf("La Jolla t$%.2ftt%.2f%%tt%.2f%tn",sales, LaJolla, sales*LaJolla/100);
break;
} //Switch ends
printf("================================================================n");
printf(" +++++++++++++++++++++++++++n");
printf(" ### Press ENTER to Exit Program ###n");
printf(" +++++++++++++++++++++++++++n");
getchar();

return 0;

}
Attachment:- 119930-StoreTax-2.zip

Reference no: EM13951016

Questions Cloud

Does this sampling plan result in a random sample : A handler loads one item every 5 minutes, so 480 items are completed in his first week of work. His manager checks his work by randomly selecting a day of the week, then reviewing all the item she completed that day. Does this sampling plan result..
How many subjects have missing values for medloinc : How many subjects have missing values for medloinc and act94 - Is there a severe split in frequencies between groups and what are the cutoff values for outliers in each group?
Descartes argument - proving god existence : For a moment assume that Descartes' argument works in proving God's existence, does the ultimate conclusion follow as stated in premise 6
How is theme idealize or stereotyped in contemporary society : How is the theme idealized or stereotyped (justifiably or not) in contemporary society? How does the song's depiction of the theme resonate with your own life?
Calculate and print the store location, sales and tax rate : Attached is a code file that works accept when a correct dollar amount an location number is entered, the result flashes on the screen and disappears. How do I get the output results to stay on the screen?
A corporation life cycle be extended : What is reengineering? What are the seven principles for reengineering proposed by Michael Hammer? Explain which principle is most important in your opinion.
What is george t-score on the risk-taking scale : T-scores are used on some psychological tests, such as the MMPI. T-scores have a mean of 50 and a standard deviation of 10, and therefore a z-score of -1 (one standard deviation below the mean) would be converted to a T-score of 40. What is George..
Recommend the key decision-making criteria : From the scenario for Katrina's Candies, determine the relevant costs for the expansion decision, and distinguish between the short run and the long run costs.
What are some emerging technologies available : What are some emerging technologies available in the marketplace today?

Reviews

Write a Review

Computer Graphics Questions & Answers

  Bullhow might swot and pest value chain analysis

bullhow might swot and pest value chain analysis statistical data methodologies and other research processes used to

  Discuss website design basics

Juan arrived the end of his online course program. His family was so proud of him. Juan's wife wish to throw a party to celebrate Juan's online graduation together with all of his family, and started planning the special event.

  How to submit the assignment please suggest how to submit

please suggest how to submit the assignment for website? how to submit the assignment? how to submit the

  How would you describe way vision was use at mentor graphics

How would you describe the way vision was used at Mentor Graphics? Did it strengthen or weaken the company? How? Why?

  Create a complex vector illustration drawing an object

create a complex vector illustration of your own, drawing an object or group of objects designed with a background in Adobe Illustrator. Or, you may draw a portrait or scene

  Are junk sms/mms worse than e-mail spam

Are Web page pop-ups, pop-unders, and Flash ads encroaching on the main page extremely annoying?

  Discussion on internet development

In 1990s, the Internet offered primarily text based web-sites. At present the Internet is rich in multimedia sites that include audio and video.

  Write a program that uses girlscout objects to track

For each girl scout, after reading in the sales, invoke the update Boxes Sold and update Sales method to update the total sales by that girl scout.

  Write applet that reads in the size of the side of a square

Your program should work for squares of all side lengths between 1 and 20.

  What design features stand out on each site

Are these features unique to the Web sites you selected or are they used by their competitors or similar sites? Are these design features used to be visual appealing or promote usability

  A graduate student has four job offers and needs to accept

a graduate student has four job offers and needs to accept one. the following table lists the four jobsnbspnbspthese

  What role does corporate-level strategy play in relation to

what role does corporate-level strategy play in relation to business-level strategy?what roles do a firms core

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd