How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask Raj Your Own Question

Raj
Raj, Engineer
Category: Homework
Satisfied Customers: 1259
Experience:  4 + Experiance in IT Industry
16752232
Type Your Homework Question Here...
Raj is online now
A new question is answered every 9 seconds

Part A. Page 400 Programming Exercise #1 – “Employee”

Resolved Question:

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 Class
Write 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 works
position. 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
Position
Susan Meyers
47899
Accounting
Vice President
XXXXX XXXXX
39119
IT
Programmer
Joy 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 509
Please 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 double
PI: 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 as
area = PI * radius * radius
getDiameter. Returns the diameter of the circle, which is calculated as
diameter = radius * 2
getCircumference. Returns the circumference of the circle, which is calculated as
circumference = 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)
Submitted: 11 months ago.
Category: Homework
Expert:  Raj replied 11 months ago.
Hi There,

I will be helping you with the requirement.
Can you please post the complete Question Again?

Thank you
Customer: replied 11 months ago.

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 Class
Write 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 works
position. 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 Position
Susan Meyers 47899 Accounting Vice President
XXXXX XXXXX 39119 IT Programmer
Joy 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 509
Please 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 double
PI: 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 as
area = PI * radius * radius
getDiameter. Returns the diameter of the circle, which is calculated as
diameter = radius * 2
getCircumference. Returns the circumference of the circle, which is calculated as
circumference = 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)

Expert:  Raj replied 11 months ago.
By when do you need the solution files?
Customer: replied 11 months ago.

by 20-21 September

Expert:  Raj replied 11 months ago.
Looking at the Effort for all the three parts I have sent an Underprice report.
Please check your e-mail to get the new Price for the Question and let me know if thats fine with you for all three Questions together.
Customer: replied 11 months ago.

wow ... can we make it for 75.00 ... i didnt expect to pay that much =(

Expert:  Raj replied 11 months ago.
No Problem I am working on the Question and you can add the difference amount as BONUS after I provide you the Solution on 20 - 21 september
Do we have a Deal?
Customer: replied 11 months ago.

great deal ... thank you very much!!! just let me know asap by that time ok??? Thank you again!

Expert:  Raj replied 11 months ago.
Yes, I will keep you updated on the Progress and will try my best to Finish All three parts as soon as possible.
Expert:  Raj replied 11 months ago.
Required Codes are in Java or C++?
Customer: replied 11 months ago.

Java

Expert:  Raj replied 11 months ago.
Thank you for the Information, I have started working on the solution now.
Expert:  Raj replied 11 months ago.
Solution codes are ready.

In Each Part keep both the files together and compile and Run the file with name Test in its name(For Part A use EmployeeTest.java, For Part B use EmployeeTestB.java, and For Part C use CircleTest.java).

Please download the Solution Codes for Individual Parts from the links below:

PART A SOLUTIONS:
Employee.java :
http://www.mediafire.com/?z20xvskpzxtppzw
EmployeeTest.java :
http://www.mediafire.com/?2iczxpbk1bi5bet

PART B SOLUTIONS:
EmployeeB.java :
http://www.mediafire.com/?1yo0592p535q4fs
EmployeeTestB.java :
http://www.mediafire.com/?4268pdy6scnfqo9

PART C SOLUTIONS:
Circle.java :
http://www.mediafire.com/?a21zn17uan7byyi
CircleTest.java :
http://www.mediafire.com/?dif71fc3e60kfsa


If you face any difficulty than feel free to ask for help.

If the solution file is satisfactory than Please don't forget to RATE the Answer.
It will hardly take few seconds to RATE my Answer
NOTE :
After Rating please don't forget to Add the BONUS Amount that we aggreed on.

Thank You and Have a Good Day.
Customer: replied 11 months ago.

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????

Expert:  Raj replied 11 months ago.
Ok I think I will have to do changes in EmployeeTest and EmployeeTestB classes.

Will provide you modified files in few hrs.
Customer: replied 11 months ago.
Thank u very much!!!
Expert:  Raj replied 11 months ago.
THIS ANSWER IS LOCKED!

You need to spend $3 to view this post. Add Funds to your account and buy credits.
Raj, Engineer
Category: Homework
Satisfied Customers: 1259
Experience: 4 + Experiance in IT Industry
Raj and 10 other Homework Specialists are ready to help you
Expert:  Raj replied 11 months ago.
Thank you for your Feedback and BONUS

In Future to request any new Question to me just begin your Question with TO RAJ followed by the Question in the following format:

TO RAJ: Followed by the Question.

Have a Good Day.
Customer: replied 11 months ago.

Thank you very much .... ill send u another question tomorrow!!!! Thank you again and have a great night!

Expert:  Raj replied 11 months ago.
You are welcome.
For new question dont forget to begin it with TO RAJ to request me for the question at the beginning.

Good Night.

JustAnswer in the News:

 
 
 
Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.
 
 
 

What Customers are Saying:

 
 
 
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
< Last | Next >
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
  • This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!! Alex Los Angeles, CA
  • Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult. GP Hesperia, CA
  • I couldn't be more satisfied! This is the site I will always come to when I need a second opinion. Justin Kernersville, NC
  • Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around. Esther Woodstock, NY
  • Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know. Robin Elkton, Maryland
  • He answered my question promptly and gave me accurate, detailed information. If all of your experts are half as good, you have a great thing going here. Diane Dallas, TX
 
 
 

Meet The Experts:

 
 
 
  • Manal Elkhoshkhany

    Tutor

    Satisfied Customers:

    4520
    More than 5000 online tutoring sessions.
< Last | Next >
  • http://ww2.justanswer.com/uploads/BU/BusinessTutor/2012-2-2_115741_Kouki2.64x64.jpg Manal Elkhoshkhany's Avatar

    Manal Elkhoshkhany

    Tutor

    Satisfied Customers:

    4520
    More than 5000 online tutoring sessions.
  • http://ww2.justanswer.com/uploads/LI/lindaus/2012-6-10_04811_IMG20120609164157.64x64.jpg Linda_us's Avatar

    Linda_us

    Finance, Accounts & Homework Tutor

    Satisfied Customers:

    3121
    Post Graduate Diploma in Management (MBA)
  • http://ww2.justanswer.com/uploads/ComputersGuru/2010-02-13_051118_Photo41.JPG LogicPro's Avatar

    LogicPro

    Engineer

    Satisfied Customers:

    3035
    Expert in Java C++ C C# VB Javascript Design SQL HTML
  • http://ww2.justanswer.com/uploads/lanis/2009-4-1_233717_phput9xef_c1pm.jpg Lani S.'s Avatar

    Lani S.

    Tutor

    Satisfied Customers:

    2457
    Registered Nurse, Internet Researcher, Private Tutor
  • http://ww2.justanswer.com/uploads/chooser77/2009-08-18_162025_Chris.jpg Chris M.'s Avatar

    Chris M.

    M.S.W. Social Work

    Satisfied Customers:

    2341
    Master's Degree, strong math and writing skills, experience in one-on-one tutoring (college English)
  • http://ww2.justanswer.com/uploads/JawaadAhmed/2009-6-27_12137_SIs_SHadi.jpg F. Naz's Avatar

    F. Naz

    Chartered Accountant

    Satisfied Customers:

    1975
    Experience with chartered accountancy
  • http://ww2.justanswer.com/uploads/JK/jkcpa/2011-1-16_182614_jkcpa.64x64.jpg Bizhelp's Avatar

    Bizhelp

    CPA

    Satisfied Customers:

    1873
    Bachelors Degree and CPA with Accounting work experience