Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C# please thanks, Design a class named Person with properties for holding a persons name, address, and telephone number. Design a class named Customer,

In C# please thanks,

Design a class named Person with properties for holding a persons name, address, and telephone number.

Design a class named Customer, which is derived from the Person class. The Customer class should have the variables and properties for the customer number, customer email, a spentAmount of the customers purchases, and a Boolean variable indicating whether the customer wishes to be on a mailing list. It also includes a function named calcAmount that calculates the spentAmount.

All retail store has a preferred customer plan where customers can earn discounts on all their purchases. The amount of a customers discount is determined by the amount of the customers cumulative purchases in the store as follows:

  • When a preferred customer spends $500, he or she gets a 5% discount on all future purchases.
  • When a preferred customer spends $1000, he or she gets a 6% discount on all future purchases.
  • When a preferred customer spends $1500, he or she gets an 8% discount on all future purchases.
  • When a preferred customer spends $2000, he or she gets a 10% discount on all future purchases.

Design a class named PreferredCustomer, which is derived from the Customer class. The PreferredCustomer class should have a variable, discountLevel, with a read-only property. It alsoincludes a setDiscountLevel function that determine the discount level based on the purchases amount using switch statement and an override function, calcAmount, calculates the spentAmount with the current discount level.

Create a CustomerDemo class. In the main function, the program calls the getData function to read the data from the CustomerInfo.txt file and create a dynamic array of PreferredCustomer object. Then, it prompts user to enter a customer number and displays a menu:

  1. Display Customer Information: display the specific customer information
  2. Update Spent Amount: update the total amount with the correct discount level

After update the spent Amount, the program writes the updated information back to file.

Example for customer info.txt below (there are 5 persons)

5

Kyle Jones

879 hobbs st, Boston, MA 84758

456-789-0001

J0000001

kylej@yahoo.com

3000

true

.

.

.

.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke

4th Edition

0136086535, 9780136086536

More Books

Students also viewed these Databases questions