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

  Your task is to carry out a critical analysis and

your task is to carry out a critical analysis and evaluation of strategy development in a well established

  What type of animation is produced by the line

what type of animation is produced by the line y=mx+c

  Create the movement of the car from the left

Create the movement of the car from the left o the screen to the right - Add the 2 wheels to the vehicle using the GlutWireSphere

  How to work on datasturetur assignment how to work on

how to work on datasturetur assignment how to work on datasturetur assignment how to work on datasturetur assignment

  Rewrite programming to create a gui

Rewrite Programming Exercise to create a GUI. Your probram should let the user eanter the loan amound and loan period in the the number of years from the tests fields and it should sisplay the monthly and total payments for each interest rate start..

  Write the girlscout class assuming a girl scout object

Write the GirlScout class assuming a girl scout object is described by two pieces of instance data:name of girl scout(a String) andboxesSold(an integer that represents the number of boxes of cookies the girl scout has sold in the fundraiser).

  Find the normal to the triangle

Find the normal to the triangle. Assume that the triangle is given clockwise. Normalize the vector. Draw a figure showing that your normal is correct.

  What is cadastral surveying and mapping what is spatial

1.what is cadastral surveying and mapping?2.what is spatial data information sdi?3.what is the bathurst declaration and

  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

  Develop an animated application

In this assignment you will develop an animated application that uses linked lists as the basis of the implementation. This application builds on the application that you worked with for tutorial 3.

  How the product positioning is aligned with mcdonalds

how the product positioning is aligned with mcdonalds corporate strategy. identify potential gaps in the product line

  Display the average in the student information

Use this class so that you can input the student's name, their grades and then display the average in the student's information in a label (include the name and their average).

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