Question

In: Computer Science

Please read the following program requirements carefully:  You are working as an eBay Seller, where...

Please read the following program requirements carefully:

 You are working as an eBay Seller, where your customers are only in New York (n), New Jersey (j) and Pennsylvania (p).

 Your C++ program is supposed ask the name of the state where the purchase is made. (n or j or p)

 Next your program asks the amount of purchase.

 Then, you calculate the Total amount by adding the proper State sales tax calculation to the Purchase Amount by using,

 Sales tax in NY : 8.875%  Sales tax in NJ : 6.625%  Sales tax in PA : 6%

 Finally print the Total on the screen for each transaction.

EXITING THE PROGRAM: Program may be exited in either of the following 2 ways: (If you implement only 1 exit methodology , you will have 7 points deduction)

1. User can enter q (for quit) instead of state name

2. User can answer a question: “Do you have another purchase to calculate the Total (y/n) ? “ and if the answer is n (for no)

C++ programming

Solutions

Expert Solution

#include<iostream>
using namespace std;
int main(){
   char name,flag;
   float amount,total=0;
   while(true){
       cout<<"Enter name of the state where the purchase is made. (n or j or p)"<<endl;
       cin>>name;
       if(name=='q'){
           exit(1);
       }
       cout<<"Enter amount of purchase"<<endl;
       cin>>amount;
       if(name=='n'){
           total=amount+(amount*0.0875);
       }
       else if(name=='j'){
           total=amount+(amount*0.06625);
       }
       else if(name=='p'){
           total=amount+(amount*0.06);
       }
       cout<<"Total: $"<<total<<endl;
       cout<<"Do you have another purchase to calculate the Total (y/n) ?"<<endl;
       cin>>flag;
       if(flag=='n'){
           break;
       }
   }

}

Expected output:


Related Solutions

Please Note: Only do Problem 2 and please read Problem 2 carefully the requirements thanks /***********************************...
Please Note: Only do Problem 2 and please read Problem 2 carefully the requirements thanks /*********************************** * Filename: arraySorted.c * Author: Last name, first name * Email: Your preferred email address * Login ID: Your EECS login ID ************************************/ #include <stdio.h> /********* DO NOT CHANGE THESE CONSTANTS IN THE FINAL SUBMISSION *********/ #define MAX_SIZE 20 #define SUCCESS 0 /****************** YOUR CODE STARTS HERE ******************/ /************************************************************/ /* Input: array A with "size" elements and an integer d Output: d is added...
Java Program. Please read carefully. i need the exact same output as below. if you unable...
Java Program. Please read carefully. i need the exact same output as below. if you unable to write the code according to the question, please dont do it. thanks To the HighArray class in the highArray.java program (Listing 2.3), add the following methods: 1.      getMax() that returns the value of the highest key (value) in the array without removing it from the array, or –1 if the array is empty. 2.      removeMax() that removes the item with the highest key from the...
***PLEASE READ CAREFULLY. IF NOT ANSWERED IN FLOWGORITHM PLEASE DON'T ANSWER*** Can you please create a...
***PLEASE READ CAREFULLY. IF NOT ANSWERED IN FLOWGORITHM PLEASE DON'T ANSWER*** Can you please create a flowgorithm chart for the problem below. Also, provide pseudocode as well. Please do not answer if you cannot put into a flowgorithm chart. Pseudocode needed as well. Thank you! Design the logic for a program that outputs every number from 1 through 15 along with its value times 10 and times 100. Make the output look like below: Number is 1 Times 10 is...
Very carefully read the following data requirements for a prospective document translation database: i. Document translation...
Very carefully read the following data requirements for a prospective document translation database: i. Document translation initially relies on a source document. The source document is a text provided in the originally recorded, valid language (see below, and assume only one language for the original document), and has an associated author and publication date. Source document authors are not related to translators in any manner. ii. Translation of a document also relies on a translator, who is capable of translating...
The Common Requirements Of All Questions Are The Same. Read Each Question Carefully And Submit ......
The Common Requirements Of All Questions Are The Same. Read Each Question Carefully And Submit ... Question: The common requirements of all questions are the same. Read each question carefully and submit a ... The common requirements of all questions are the same. Read each question carefully and submit a query to fulfill for each question. Also, students need to submit the result of the corresponding query under the query. The query result should be copied and pasted as it...
Please read this scenario and job description carefully. You are involved in the prestigious but often...
Please read this scenario and job description carefully. You are involved in the prestigious but often challenging Google recruitment process. As part of this process you are required to respond to several questions and activities. All your answers must address the context of this scenario and the information given in the individual questions . Job description - Software development professional at Google There's no such thing as “a normal day" at Google. We work to create and maintain the safest...
Scenario Please read this scenario and job description carefully. You are involved in the prestigious but...
Scenario Please read this scenario and job description carefully. You are involved in the prestigious but often challenging Google recruitment process. As part of this process you are required to respond to several questions and activities. All your answers must address the context of this scenario and the information given in the individual questions . Job description - Software development professional at Google There's no such thing as “a normal day" at Google. We work to create and maintain the...
Scenario Please read this scenario and job description carefully. You are involved in the prestigious but...
Scenario Please read this scenario and job description carefully. You are involved in the prestigious but often challenging Google recruitment process. As part of this process you are required to respond to several questions and activities. All your answers must address the context of this scenario and the information given in the individual questions . Job description - Software development professional at Google There's no such thing as “a normal day" at Google. We work to create and maintain the...
Scenario Please read this scenario and job description carefully. You are involved in the prestigious but...
Scenario Please read this scenario and job description carefully. You are involved in the prestigious but often challenging Google recruitment process. As part of this process you are required to respond to several questions and activities. All your answers must address the context of this scenario and the information given in the individual questions . Job description - Software development professional at Google There's no such thing as “a normal day" at Google. We work to create and maintain the...
Please read this scenario and job description carefully. You are involved in the prestigious but often...
Please read this scenario and job description carefully. You are involved in the prestigious but often challenging Google recruitment process. As part of this process you are required to respond to several questions and activities. All your answers must address the context of this scenario and the information given in the individual questions. Job description - Software development professional at Google There's no such thing as “a normal day" at Google. We work to create and maintain the safest operating...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT