Workshop Selector The following table shows a training company’s workshops, the
ID: 3825121 • Letter: W
Question
Workshop Selector
The following table shows a training company’s workshops, the number of days of each, and their registration fees.
The training company conducts its workshops in the three locations shown in the following table. The table also shows the lodging fees per day at each location. Location Lodging Fees per Day
When a customer registers for a workshop, he or she must pay the registration fee plus the lodging fees for the selected location. For example, here are the charge to attend the Supervision Skills workshop in Orlando:
Create an app in JAVA that lets the user to select a workshop from one list box and a location from another list box. When the user clicks a button, the app should calculate and display the registration cost, the lodging cost, and the total cost.
Workshop Number of Days Registration Fee Time Management 2 $800 Supervision Skills 3 $1,500 Negotiation 5 $1,300Explanation / Answer
class WrapperClassesComparision
{
public static void main(String[] args)
{
int i1 = 10;
int i2 = 10;
System.out.println(i1 == i2);
//System.out.println(i1.equals(i2));//int cannot be dereferenced
Integer io1 = new Integer(10);
Integer io2 = new Integer(10);
System.out.println(io1 == io2);
System.out.println(io1.equals(io2));
//Wrapper classes type conversion
/*
Wrapper classes are not compatible to each other, because they are siblings
If we use "==" operator to compare their objects it leads to CE: incomparible types
But we can compare them using equals() method, it returns false => No CE or No RE.
*/
Double do1 = new Double(10.0);
//System.out.println(io1 == do1); CE: incomparable types: java.lang.Integer and java.lang.Double
System.out.println(io1.equals(do1)); //false
double d1 = 10.0;
System.out.println(i1 == d1); //true
//=> System.out.println(10 == 10.0);
//=> System.out.println(10.0 == 10.0);
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.