Question

1). Design an abstract class called Customer and an abstract method CalculateDiscount(). Design a calculator program...

1). Design an abstract class called Customer and an abstract method CalculateDiscount(). Design a calculator program that determines the amount of discount a customer can claim on the system. Regular Customer gets 2% off their total purchase and Member Customer gets 8% off their total purchase. The system should allow the customer to select either they are; a Regular Customer or Member Customer.

2) Design an Activity Diagram for the following business process.

When the passenger decides to board the train, they will have to produce their ticket at the check in counter. The Passenger Ticket Service System will then verify the passenger's ticket. Should there be problem/s with the passenger's luggage, the system will then flash a message instructing the passenger to visit the closest station's customer service counter and the system ends.

If there is no complication with the ticket, the passenger will then be able to check in their luggage (one piece only with max weight of 30lbs). Once the The Passenger Ticket Service System weights the customer luggage, and assuming it is under 30 Lbs, then the system will accepts the luggage and a boarding pass will be printed out by the system. Should the passenger's luggage weights more than the maximum allowable weight (30 lbs) the passenger will then have to pay the overweight charges before a boarding pass will be issued by the system. The system ends after a boarding pass has been issued.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include<iostream>

using namespace std;

class Customer{
public:
   virtual double calculateDiscount(double purchese) = 0;

};

class RegularCustomer: public Customer{
public:
   double calculateDiscount(double purchase){
       return 0.02 * purchase;
   }

};

class MemberCustomer: public Customer{
public:
   double calculateDiscount(double purchase){
       return 0.08 * purchase;
   }

};

int main(){

   RegularCustomer r;
   MemberCustomer m;
   int n;
   double amt;

   cout <<"Please choose 1-Regular Customer, 2-MemberCustomer :";
   cin >> n;
   if (n == 1){
       cout << "Enter total purchase amount: $";
       cin >> amt;
       cout << "The discount is $" << r.calculateDiscount(amt) << endl;
   }
   if (n == 2){
       cout << "Enter total purchase amount: $";
       cin >> amt;
       cout << "The discount is $" << m.calculateDiscount(amt) << endl;
   }

   return 0;
}

Untitled-Notepad File Edit Format View Help Activity Diagram is as follows: >Receive the customer-->Accept the ticket at the

Add a comment
Know the answer?
Add Answer to:
1). Design an abstract class called Customer and an abstract method CalculateDiscount(). Design a calculator program...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • What happened on United flight 3411?What service expectations do customers have of airlines such ...

    What happened on United flight 3411?What service expectations do customers have of airlines such as United and How did these expectations develop over time? Thank You! In early April 2017, United Airlines (United), one of the largest airlines in the world, found itself yet again in the middle of a service disaster this time for forcibly dragging a passenger off an overbooked flight. The incident was to become a wake-up call for United, forcing it to ask itself what to...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT