The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
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
}