Reference no: EM13159583
1. Create classes: Triangle, Rectangle, ShapeDemo
a. Triangle class
- instance variables: width, height
- instance methods: setWidth(double w), setHeight(double h), double getWidth(), double getHeight() and double getArea()
* A triangle's area is calculated by width*height*0.5
* all variables are private and methods public.
b. Rectangle class
- instance variables: width, height
- instance methods: setWidth(double w), setHeight(double h), double getWidth(), double getHeight() and double getArea()
* A rectangle's area is calculated by width*height
* all variables are private and methods public.
c. ShapeDemo
Create the main method in which you:
- create objects of Triangle and Rectangle that were defined in a and b.
- assign values for these objects using set methods.
- display areas of the objects you created.
2. Create classes: HourlyEmployee and HourlyEmployeeDemo
a. HourlyEmployee
- instance variables: employeeNumber, employeeName, hoursWorked, hourlyRate.
* employeeNumber and employeeName must be declared as String. hoursWorked is int, and hourlyRate is double.
- instance methods: set and get methods for each instance variable
- addtional instance method: calcMonthlyPay() that calculates a monthly payment.
* calcMonthlyPay() method must return an double value. A monthly payment can be calculated as: hoursWorked* hourlyRate
* all variables are private and methods public.
b. HourlyEmployeeDemo.
- Create the main method. You should include the following code block:
HourlyEmployee he1 = new HourlyEmployee(); //create a new HourlyEmployee object
he1.setEmployeeNumber("000-00-0000"); // enter your student id here.
he1.setEmployeeName("John Doe"); // enter your name
he1.setHourlyRate(10.25); he1.setHoursWorked(80);
System.out.println(he1.getEmployeeName() + "'s payment for this month is: $" + he1.calcMonthlyPay() );
Construct confidence intervals for the given population mean
: In order to do so, they review 42 service calls and construct a 95% confidence interval for population mean: (2.468, 2.743). What can we conclude about the significance test of Ho: mu = 2.6 vs Ha: mu does not equal 2.6?
|
Compute the break even point in dollars
: Quiltworks company reported actual sales of $2,000,000, and fixed costs of $450,000. The contribution margin ratio is 30%. (a) compute the break even point in dollars
|
What instructions would you give people in a group session
: What instructions would you give people in a group session about how to get their computers to look standardized?2. What policy would you suggest for what to put on the screen so it does not offend anyone?
|
How many moles of khp were originally present
: dissolved .31 grams of KHP in 25 ml of water and it required 15.5ml of NaOH to reach end of titration, how many moles of KHP were originally present before the addition of the NaOH?
|
Instance methods
: instance methods: setWidth(double w), setHeight(double h), double getWidth(), double getHeight() and double getArea() * A triangle's area is calculated by width*height*0.5 * all variables are private and methods public.
|
Prepare the paid-in capital portion
: Prepare the paid-in capital portion of the stockholders' equity section at December 31, 2007.
|
Calculate the total amount of heat energy
: calculate the total amount of heat energy that must be removed to convert 34.0g of steam to water at 25 Celsius
|
Review of new sources of air pollution
: Compare and contrast how treatment and regulation of existing air pollution sources differ from that of a review of new sources of air pollution.
|
Design a class named employeerecord
: Design a class named EmployeeRecord that holds an employee's ID number, name, and payrate. Include mutator methods to set the values for each data field and output the values for each data field. Create the class diagram and write the code that
|