PreferredCustomer Class A retail store has a preferred customer plan where custo
ID: 653970 • Letter: P
Question
PreferredCustomer Class
A 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 percent discount on
all future purchases.
When a preferred customer spends $1,000, he or she gets a 6 percent discount
on all future purchases.
When a preferred customer spends $1,500, he or she gets a 7 percent discount
on all future purchases.
When a preferred customer spends $2,000 or more, he or she gets a 10 percent
discount on all future purchases.
Design a class named PreferredCustomer , which is derived from the Customer
class you created in Programming Problem 4. The PreferredCustomer class should
have properties for the amount of the customers purchases and the customers discount level. Demonstrate the class in a simple application. also must have base and derived classes Here is question #4 for reference (Person and Customer Classes)
Design a class named Person with properties for holding a persons name, address, and telephone number. Next, design a class named Customer , which is derivedfrom the Person class. The Customer class should have a property for a customernumber and a Boolean property indicating whether the customer wishes to be on amailing list. Demonstrate an object of the Customer class in a simple application. Must have windows form graphical user interface AND BE IN C#
Explanation / Answer
public class person
{
public String name[];
public string address[];
public int phonenum;
}
class Customer : person
{
public int custnum;
public boolean mailist;
public custdetails()
{
custnum=Console.Read();
maillist=Console.Read();
}
class PreferredCustomer: Customer
{
double final,discout,amount;
discount()
{
amount=Console.Read();
if(amount=500)
{
final=(amount*(95/100));
}
if(amount=1000)
final=(amount*(94/100));
}
if(amount=1500)
final=(amount*(93/100));
}
if(amount=2000)
final=(amount*(90/100));
}
}
pc.discount();
pc.custdetails();
}
}