Computer Science Homework Solutions
Problem
#117852

Design a flow chart looping the program code

//student name
#include     
main ()                   
{
//declare variables
float fStore1=.0725;   //use floats due to possibility of using decimals
float fStore2=.075;    //here is where taxes are hard coded in the program
float fStore3=.0775;
int iStore=0;
float fPurchase=0.0;
float fTax=0.0;  
float fTotal=0.0;  

printf("student name,C Programming Service Request, February26,2007n");  
printf("n1. Del Mar-7.25n");
printf("n2. Encinitas-7.5n");
printf("n3. LaJolla-7.75n");
printf("nEnter store number:  ");
scanf("%d", &iStore);   //store the store number entered to use later
switch (iStore)
  {
   case 1:   //if store selected is number 1 then do all tasks below
      printf("nEnter amount from sale:");
      scanf("%f", &fPurchase);  //store sale amount
      fTax=fPurchase* fStore1;  //declare value for tax-purchase times 7.25% tax
      printf("nThe taxes are: $%.2fn",fTax);
      fTotal=fTax + fPurchase;  //calculation of total for Del Mar
      printf("nThe total is : $%.2fn", fTotal);  
      break;
    case 2: //if store selected is number 2 then do all tasks below
      printf("nEnter amount from sale:");
      scanf("%f", &fPurchase);
      fTax=fPurchase * fStore2;  //declare value for tax-purchase times 7.5% tax
      printf("nThe taxes are: $%.2fn",fTax);
      fTotal=fTax + fPurchase;   //calculation of total for Encinitas
      printf("nThe total is : $%.2fn", fTotal);  
       break;
    case 3: //if store selected is number 3 then do all tasks below
      printf("nEnter amount from sale:");
      scanf("%f", &fPurchase);
      fTax=fPurchase * fStore3;  //declare value for tax-purchase times 7.75% tax
      printf("nThe taxes are: $%.2fn",fTax);
      fTotal=fTax + fPurchase;   //calculation of total for LaJolla
      printf("nThe total is : $%.2fn", fTotal);  
      break;
  }    //end case statements
}     //end program

Attached file(s):
Attachments
Service Request 4.c  View File
Solution
What is this?
By OTA - Overall OTA Rating
Suraj Joshi, PhD (IP) - 4.7/5
Purchase Cost Now
$2.19 CAD (was ~$11.97)
Included in Download
  • Plain text response
  • Attached file(s):
    • 117852.doc
$2.19 Instant Download
Add to Cart
Why you can trust BrainMass.com
  • Your Information is Secure
  • Best Online Academic Help Service
  • Students find real academic Success
Related Solutions
  • Tax Calculation Program for multiple Stores - I need two separate codes for each request. Thanks. #include /*Using define macros for assigning tax to different stores */ #define DelMar 7.25 #define Encinitas 7.5 #define LaJ ...
  • C program to calculate and display sales of a store - ******************************************************************** Service Request: SR-kf-008 Change Request: 2 Requestor: Harvey Stephens Modify the C program so that the user inputs the ...
  • Miracle C program Calculator + Flow Chart - 1. What is the input of the problem? (Purchase Total of $125.00 for each store) • Del Mar - 7.25% • Encinitas - 7.5% • La Jolla - 7.75% _______________________________________________________ ...
  • C Programming Issue with Kudler Foods - I have a problem doing this and understanding this. The first file was the original problem, the 2nd attached file is the question in problem. This is C programming working in C compiler.
  • Programming - Should there be a single programming language for all programming domains? Explain why or why not.
Browse