Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

An online retailer wants a program that displays the total amount a customer owe

ID: 3689412 • Letter: A

Question

An online retailer wants a program that displays the total amount a customer owes, including shipping. The user will enter the total amount due before shipping. The amount to charge for shipping is based on the customer's membership status, Which can be either Standard or Premium. The appropriate shipping charges are shown in Figure 9-42. The program should use two program-defined functions: one to determine the shipping charge for a Standard member and the other to determine the shipping charge for a Premium member. If necessary, create a new project named Advanced23 Project, and save it in the Cpp8Chap09 folder. Enter your C++ instructions into a source file named Create a program that displays five random addition problems, one at a time, on the computer screen. Each problem should be displayed as a question, like this: What is the sum ofx + y?. The x and y in the question represent random numbers from 1 to 10, inclusive. After displaying the question, the program should allow the user to enter the answer. It should then compare the user's answer with the correct answer. If the user's answer matches the correct answer, the program should display the "Correct!" message.

Explanation / Answer

main.cpp

//System Libraries
#include <iostream>
using namespace std;

//User Libraries

//Global Constants

//Function Prototypes

//Execution Begins Here!
int main(int argc, char** argv) {
//Declare Variables
    int begBal, check;
    float total, bankFee;
  
    //Prompt user for input
    cout<<"What is the beginning balance of this month?"<<endl;
    cin>>begBal;
    cout<<"How many checks did you writhe this month?"<<endl;
    cin>>check;

        if (check<0)
        {
            cout<<"Cannot accept a negative amount"<<endl;
        }
        if (check<20 && begBal>400)
        {
            total=check*0.10;
            bankFee=(10+total);
            cout<<"Total bank service fees for the month is $"<<bankFee<<endl;         
        }
        if (check<20 && begBal<400)
        {
            total=check*0.10;
            bankFee=(10+total+15);
            cout<<"Total bank service fees for the month is $"<<bankFee<<endl;
        }
        if (check<20 && check<=39)
        {
            if(begBal<400)
            {                
            total=check*0.08;
            bankFee=(10+total+15);
            cout<<"Total bank service fees for the month is $"<<bankFee<<endl;
            }
        }
        if (check<20 && check<=39)
        {
        if(begBal>400)
            {                
            total=check*0.08;
            bankFee=(10+total);
            cout<<"Total bank service fees for the month is $"<<bankFee<<endl;
            }
        }
        if (check<40 && check<=59)
        {
            if(begBal<400)
            {                
            total=check*0.06;
            bankFee=(10+total+15);
            cout<<"Total bank service fees for the month is $"<<bankFee<<endl;
            }
        }
        if (check<40 && check<=59)
        {
        if(begBal>400)
            {                
            total=check*0.05;
            bankFee=(10+total);
            cout<<"Total bank service fees for the month is $"<<bankFee<<endl;
            }
        }
        if (check>=60 && begBal<400)
        {             
            total=check*0.04;
            bankFee=(10+total+15);
            cout<<"Total bank service fees for the month is $"<<bankFee<<endl;
          
        }
        if (check<60 && begBal>400)
        {                
            total=check*0.08;
            bankFee=(10+total);
            cout<<"Total bank service fees for the month is $"<<bankFee<<endl;
          
        }
    


//Exit Stage Right!     
    return 0;
}

sample output


What is the beginning balance of this month?                                                                                                                
10000                                                                                                                                                       
How many checks did you writhe this month?                                                                                                                  
4                                                                                                                                                           
Total bank service fees for the month is $10.4                                                                                                              
Total bank service fees for the month is $10.32                                                                                                             
Total bank service fees for the month is $10.2                                                                                                              
Total bank service fees for the month is $10.32