hello ... here's the question ... its divided in Part A, B and C
Part A. Page 400 Programming Exercise #1 – “Employee” Class Use the Test Data given in the book. These values should be read in from a user within code that is in “main”. For example, I should NOT see “Susan Meyers” anywhere in your code. Exercise 1. Employee ClassWrite a class named Employee tha has the following fields: name. The name field references a String object that holds the employee’s name.idNumber. The idNumber is XXXXX int variable that holds the employee’s name.department. The department field references a String object that holds the name of the department where the employee worksposition. The position field references a String object that holds the employee’s job title. The class should have the following constructors:A constructor that accepts the following values as arguments and assigns them to the appropriate fields: employee’s name, employee’s ID number, department, and position.A constructor that accepts the following values as arguments and assigns them to the appropriate fields should be assigned an empty string (“ “).A no-arg constructor that assigns empty strings (“ ”) to the name, department, and position fields, and 0 to the idNumber field. Write appropriate mutator methods that store values in these fields and accessor methods that return the values in these fields. Once you have written the class, write a separate program that creates three Employee objects to hold the following data: Name ID Number Department PositionSusan Meyers 47899 Accounting Vice PresidentXXXXX XXXXX 39119 IT ProgrammerJoy Rogers 81774 Manufacturing Engineer The program should store this data in the three objects and then display the data for each employee on the screen. Part B. Extend what you wrote for Part A - Change the Class Name to “EmployeeB” Add another Data Member: “salary” - a double representing money - 2 decimal places. Update the methods in the class to accommodate this new data member. Add another method: “toString()” that returns a String with all of the data in it. Update “main” to accommodate the “salary”. During the run, you make up data values.This is NOT in Chapter 6.“toString” starts on Page 509Please take notes in class! Update the printing in “main” to use “toString()” ( I.e. main’s “System.out.println” should just use the name of a “EmployeeB” object! ) Part C. Page 402 Programming Exercise #7 – “Circle” Class Create 4 circles in “main” with these Radius Values: 10, 15.2, 0, 25.5 Create the first two circles by using the constructor that accepts a radius value as a parameter. Create the last two circles by using the “no-arg” constructor and a mutator method. In main, after creating all 4 circles, print these things for each of the 4 circles: The circle’s radius, area, diameter and circumference. Exercise 7. Circle Class Write a Circle class that has the following fields:Radius: a doublePI: a final doubleinitialized withthe value 3.14159 The class should have the following methods:Contructor. Accepts the radius of the circle as an argument.Constructor. A no-arg constructor that sets the radius field to 0.0.setRadius. A mutator method for the radius field.getRadius. An accessor method for the radius field.getArea. Returns the area of the circle, which is calculated asarea = PI * radius * radiusgetDiameter. Returns the diameter of the circle, which is calculated asdiameter = radius * 2getCircumference. Returns the circumference of the circle, which is calculated ascircumference = 2 * PI * radius Write a program that demonstrate the Circle class by asking the user for the circle’s radius, creating a Circle object, and then reporting the circle’s area, diameter, and circumference. Special Instructions For Lab#2 Please, do NOT use an array of objects for any of these exercises. Please notice where it says what should be done in “main”: it could be done in another static method that “main” calls - but, it is NOT done within any of your non-static methods inside the class that is instantiated. IMPORTANT: Do NOT name any of your formal parameters in “Employee” class, “EmployeeB” class or “Circle” class with the same name as any of your instance fields!! Special Instructions For Parts A & B ( Class “Employee” and “EmployeeB” ) Employee class has: * private instance fields * a “no-arg” constructor ( as defined in the problem ) * 2 other constructors defined in the problem that take parameters * accessor methods for each instance field (e.g. getName)
by 20-21 September
wow ... can we make it for 75.00 ... i didnt expect to pay that much =(
great deal ... thank you very much!!! just let me know asap by that time ok??? Thank you again!
hello ... i just checked the solutions ... i think its awesome ... but i got a question?
(3) About “main”:
Parts A and B should be using 3 separate Object Variables ( NOT an array. )
Each object creation should use a different constructor ( 3 objects, 3 constructors. )
IMPORTANT: You should be REUSING the input variables. For Example, read in a String into a variable “inputName”,( get whatever else you need), use “inputName” when creating or populating the first Employee Object. Then read into the String variable “inputName” again, use it for creating or populating the second Employee Object. etc. E.g. I should NOT be seeing 3 name variables in main.
wht u think????
Thank you very much .... ill send u another question tomorrow!!!! Thank you again and have a great night!