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

  Design effective graphics for visual presentations

Design effective graphics for visual presentations

  What are the methods of motion specifications

Define Computer animation. What are the methods of motion specifications? What are the steps in animation sequence?

  Find spanning tree of g with maximum number of vertices

Given an undirected graph G = (V, E). Find a spanning tree of G with the maximum number of vertices that have degree 1. Show that this problem is NP-complete.

  Research a nonprofit organization that has faced a public

research a nonprofit organization that has faced a public relations crisis within the past few years.imagine that you

  Task apple corpyou will assess the recent acquisitions of

task apple corp.you will assess the recent acquisitions of your selected firm apple. use print and online sources to

  Ethernet equipment to modernize the network

An older network using ten baseT technology needs an upgrade. The network haves a total of 220 workstations and ten servers and has a network diameter of three-hundred meters.

  It security report and presentation

The presentation must include appropriate graphics, and may be in a Microsoft PowerPoint presentation format.Online students will submit a presentation that must include detailed speaker notes.

  Practices for web graphics

Assume your Web design firm has just hired a talented graphic artist with years of expertise in print media and no experience with creating image production.

  Distinguish distinguish between uniform scaling and

distinguish between uniform scaling and differential scaling.differentiate between translation and

  What is the importance of bandwidth

What would the Web be like if there were no limit to bandwidth?

  Provide a snapshot of a large amount of data

provide a snapshot of a large amount of data or to illustrate a topic. Poorly-designed pages can take away from the intended message of the document.

  Gui that takes text input from the user for name

You have a GUI that takes text input from the user for name, favorite color, and favorite food. On the GUI, the user will click "Enter the Information.

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