ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 04 May 2017 My Price 8.00

Create an enumeration named CustomerType

Needed for JAVA

1. Create an enumeration named CustomerType. This enumeration should contain constants that represent three types of customers: retail, trade, and college.

2. Using the attached CustomerTypeApp class add a method to this class that returns a discount percent (.10 for retail, .30 for trade, and .20 for college) depending on the CustomerType variable that's passed to it.

3. Add code to the main method that declares a CustomerType variable, assigns one of the customer types to it, gets the discount percent for that customer type, and displays the discount percent. 

4. Add a statement to the main method that displays the string returned by the toString method of the customer type. 

5. Add a toString method to the CustomerType enumeration which should return a string that contains "Retail customer," "Trade customer," or "College customer" depending om th customer type. 

 

 

public class CustomerTypeApp
{
public static void main(String args)
{
// display a welcome message
System.out.println("Welcome to the Customer Type Test application\n");
// get and display the discount percent for a customer type
// display the value of the toString method of a customer type
}
// a method that accepts a CustomerType enumeration
}

Answers

(11)
Status NEW Posted 04 May 2017 01:05 AM My Price 8.00

-----------

Not Rated(0)