[Solved] Exam Solution

$25

File Name: Exam_Solution.zip
File Size: 122.46 KB

SKU: [Solved] Exam Solution Category: Tag:
5/5 - (1 vote)

You have been contracted to create an application that can be used to determine the discount awarded for preferred customers. Because of the time limitation, you should focus your attention on the preferred customer class. Include data members of customer ID, customer name, and customer purchase. Define appropriate constructors and properties for the class.Include a method that returns the discount percentage based on the following: When a preferred customer spends a minimum of $500, he or she gets a 5 percent discount When a preferred customer spends a minimum of $1,000, his discount is 6 percent When a preferred customer spends a minimum of $1,500, his discount is 7 percent discount When a preferred customer spends at least $2,000, he or she gets a 10 percent discountInclude an additional instance method that returns the actual reduced discounted price. Override the ToString( ) method to return the customer name, his purchase amount (formatted as currency), discount percentage (if any),and the reduced purchase price (formatted as currency).Define the 2nd class to test your preferred customer class. You may instantiate your objects with literal data sent as arguments to the constructors. You do not have to input the data. USE YOUR OWN NAME AS THE CUSTOMER NAME FOR ONE OF THE OBJECTS THAT YOU INSTANTIATE. Before instantiating an object of the class, check to make sure the purchase amount entered is a positive integer. If the value entered for the purchase amount is negative, display an error message indicating the input is in-valid. Modularize your solution.Sample output might look like:Test1:Customer: Barbara DoylePurchase Amt. $1,423.78Discount Percent: 6%Discounted Amt.: $1,338.36Test2:Customer: Sarah WangPurchase Amt. $401.28Discount Percent: 0%Discounted Amt.: $401.28

Wrote a multi-class solution
Included appropriate constructors
Included private data members for name, ID, and purchase only
Had methods returning percentage & discount values as opposed to defined data members
Defined properties for each data member (set & gets) with public access
Returned customer Name, purchase amount, discount and reduced price in the ToString( ) Method
Purchase amount and reduced price formatted with currency
Included method to return discount percent
If statement tested correct endpoints
No extraneous testing performed
Included method to return discounted amount
Included test class
Used own name as customer in test class
Produced correct output
Used proper naming conventions
Posted copy of source code files
Posted Word document containing screenshot
Readable code with consistency demonstrated
Extra credit award. Allowed user to input data (+3). Solution Modularized (+3)

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] Exam Solution
$25