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

  Create a simple warm-up program using your g3d

Create a simple warm-up program using your G3D programming and graphics environment.

  Shadow effect while rolling a sphere

Shadow effect while rolling a sphere as well as the options of shading and lighting.

  Relative positioning and interactive positioning

Relative Positioning and Interactive Positioning by Dragging and Clicking and some Simple Animation

  Draw a teapot at the global origin

Draw a teapot at the global origin

  Concepts of computer graphics

Concepts of Computer Graphics and develop a program using OpenGL

  The security policy document outline

Using the GDI Case Study below, complete the Security Policy Document Outline

  Develop the image manipulations

Develop the image manipulations

  What does resolution mean

What does resolution mean How is resolution connected to ppi and dpi units

  Differentiate between a bitmap image and a vector image

Differentiate between a bitmap image and a vector image Explain the following terms

  Essential elements of a design pattern

configuration of an Iterator pattern, patterns could be used in a Library System, Singleton, Template, Decorator, Façade,What does Alexander means by the following declaration "But it is impossible to form anything which has the temperament of natu..

  Framework of user interface design

design of user interfaces, natural mapping, GUI applications, web page design different to designing for printed media, risks exposed in this "phone as individual proxy" approach, interaction designers of ubicomp applications, Storyboards are usual..

  What are the factors affecting picture composition

Define picture composition What are the factors affecting picture composition. Elaborate on each factor Describe the basic lines present in a composition

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