CustomerType enum and CustomerTypeApp class using NetBean 7.2
Not what you're looking for?
USING NETBEAN 7.2
Criterion
1. CustomerType enumeration contains constants representing 3 customer types: retail, trade and college
2. CustomerType contains getDiscount method that returns the appropriate discount for each customer type: 10% for retail, 30% for trade and 20% for college
3. CustomerType enumeration contains a toString method returning an appropriate string for each customer type: Retail customer, Trade customer and College customer
4. Contains CustomerTypeApp class that compiles correctly
5. CustomerTypeApp main method declares a CustomerType variable
6. CustomerTypeApp main method assigns valid customer type to its CustomerType variable
7. CustomerTypeApp main method displays the discount for its CustomerType variable
8. CustomerTypeApp main method displays the string for its CustomerType variable
public class CustomerTypeApp
{
public static void main(String[] args)
{
// display a welcome message
System.out.println("Welcome to the Customer Type Test applicationn");
// 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
}
Purchase this Solution
Solution Summary
The expert examines CustomerType enum and CustomerTypeApp class using NetBean 7.2.
Solution Preview
There are two files in the zip file. one for CustomerType enum and the other for CustomerTypeApp class.
public enum CustomerType {
RETAIL("Retail customer", 0.1), //10% for retail
TRADE("Trade customer", 0.3), //30% for trade
COLLEGE("College customer", 0.2);//20% for college
private String custType;
private double discount;
private CustomerType(String s, double d) {
custType = s;
...
Purchase this Solution
Free BrainMass Quizzes
Java loops
This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.
Basic Computer Terms
We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.
C# variables and classes
This quiz contains questions about C# classes and variables.
Word 2010: Table of Contents
Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.
Basic UNIX commands
Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.