Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

TITLE Datatype class, Driver class Adult, Adult Weight Management Employee, Two Weeks Salary HOW TO DO EACH PART *From now and on yourLastName will be

 

TITLE Datatype class, Driver class Adult, Adult Weight Management Employee, Two Weeks Salary HOW TO DO EACH PART *From now and on yourLastName will be changed to your last name. *Your program should change Martinez to your last name. *Your program should change LUIS MARTINEZ to your name. *Change Mary Lane to the name of user who is using the Investment Application entered from the keyboard. *Write the file name as the first comment line at the top of the program. *After running your program, get the picture of the output window from your program with your on to paste at the bottom of the pseudo-code to turn in.

*Step1: Read the requirement of each part; write the pseudo-code in a word document by listing the step by step what you suppose to do in main() and then save it with the name as Lab3_pseudoCode_yourLastName. *Step2: -start editor (for example eClipse) create the project with the following project name: Part 1: SP2022_LAB3PART1_yourLastName Part 2: SP2022_LAB3PART2_yourLastName -add data type class: Part1: SP2022_Adult_yourLastName Part2: SP2022_Employee_yourLastName -add a driver class that contains main() Part 1: Class: SP2022_AdultWeightManagemeent_yourLastName Part 2: Class: SP2022_BiWeeklySalaryOfEmployee_yourLastName *Step3: follow step by step in the pseudo-code (or the flowchart) to write the java code in main() or driver class. *Step:4 compile and run the program. *Step5: debug if there are any errors to complete the program.

FROM THIS LAB3, WE USE OBJECT ORIENTED PROGRAMMING TECHNIQUE TO WRITE THE CODE. WE SHOULD HAVE TWO TYPES OF CLASSES IN ONE PROJECT: DATA TYPE CLASS AND DRIVER CLASS.

TO KNOW HOW TO WRITE THE CODE OF A DATA TYPE CLASS AND HOW TO CREATE AN OBJECT AND USE THE OBJECT TO ACCESS THE METHODS OF DATA TYPE CLASS IN THE DRIVER CLASS; YOU CAN GET HELP BY READING THE TOPICS RELATING TO THESE IN HOW TO DO LAB AND FOLLOW THE INSTRUCTION IN THIS LAB.

FOR ANY QUESTIONS, CONTACT VIA EMAIL LiemLe@dcccd.edu OR JOINT TO OFFICE HOUR TO GET HELP.

LAB3 PART1 READ THE REQUIREMENT, CREATE THE PSEUDO-CODE BEFORE WRITING THE CODE

REQUIREMENT Using Object Oriented Programming to provide the application SP2022_AdultWeightManagement_yourLastName that helps users to find the expected weight if the users provide their height and their expected BMI rate.

You must provide two classes: data type class: SP2022_Adult_yourLastName driver class: SP2022_AdultWeightMangement_yourLastName.

DATA TYPE CLASS Before writing the code of a data type class, you must create the UML of the data type class SP2022_Adult_yourLastName (read the topic UML in HOW TO DO LAB) If you do not have any tool to create UML, you can create in Word one table with 1 column x 3 rows as below. -the first row for class name in middle -the second row for the list of data members with the following syntax with the minus sign (-) at the beginning of each one. Minus(-) means private access. -variableName:dataType -the third row lists all constructors and methods with the plus sign (+) at the beginning of each one. Plus sign (+) means public access Constructors: +className() +className(parameterName:type, ) Methods: +methodName():returnType +methodName(parameterName:type, ): returnType

The following is UML of a data type class with: -the class name as SP2022_Adult_Martinez -3 data members with private access (-): name of type String, height of type int, expectedBMI of type float -2 constructors with public access (+) -2 methods with public access (+): method calculateWeight() return decimal number of type double and method toString return a String

SP2022_Adult_Martinez -name: String -height: int -expectedBMI: float +SP2022_Adult_Martinez() +SP2022_Adult_Martinez(name:String, height:int, respectedBMI:int) +calculateWeight(): double +toString(): String

To write the code for Datatype class, you should base on the UML above: those are listed-data members list: declare variables to hold the information of an adult about name (String), height (int inches), expected BMI rate (float) -provide 2 constructors: the no-argument constructor and parameterized constructor -provide the method to calculate the weight by using the following formula: weight = (BMI * height * height)/703 -provide the method toString() to create the output in the requested format. For example: Your name is Luis Martinez, the name of user is Mary Lane, the height is 80 inches, the expected BMI rate is 20.6 then the result weight is 187.5 pounds. The output as below: ------------------------------------------------- File: SP2022_AdultWeightManagement_Martinez.java Adult Weight Management LUIS MARTINEZ Standard BMI: 18.5 24.9 ------------------------------------------------- Name: Mary Lane Height (inches): 80 BMI: 20.6 ------------------------------------------------- Weight (pounds): 187.5

DRIVER CLASS Before writing the code, you must create the pseudo-code for the main().

The driver class named SP2022_AdultWeightManagement_yourLastName includes the function main(). In the function main(), after reading all the information of one adult that are needed for name, weight and expected BMI rate, you must create the object of the data type class above SP2022_Adult_yourLastname by calling one constructor of the data type class, then use this object to access the method toString() to display the result of the weight.

LAB3 PART2 REQUIREMENT Using Object Oriented Programming to provide the application SP2022_BiWeekSalaryOfEmployee_yourLastName that helps employees to print out their two weeks salary. You must provide two classes: data type class: SP2022_Employee_yourLastName driver class: SP2022_BiWeekSalaryOfEmployee_yourLastName.

DATATYPE CLASS Class SP2022_Employee_yourLastName Provide the UML of this class before writing the code This class holds the following: -the information of the employee about employee id, employee name, hourly salary and number of work hours. -provide the methods to calculate the federal income tax amount, social security tax amount, the medicare tax amount, net pay amount and the method toString()

The tax rates should be declared as constants: Federal Income tax rate = 8.74% Social Security tax rate = 6.20% Medicare tax rate = 1.45%

Formulas: Gross pay = salary rate * number of work hours Federal Income tax = Gross pay * Federal Income tax rate Social security tax = Gross pay * Social Security tax rate Medicare tax = Gross pay * Medicare tax rate Net pay = Gross pay (Federal Income tax+ Social Security tax+ Medicare tax) Method toString() creates the output string that needs in the following format: in the following format that requires the information in correct alignment and the numbers in two decimal digits.

---------------------------------------------- File: SP2022_BiweeklyPay_Martinez.java BIWEEKLY PAYMENT OF EMPLOYEE LUIS MARTINEZ ---------------------------------------------- Employee ID: 12344567 Employee Name: Mary Lane Hourly Salary: 24.5 Number of work hours: 80 ---------------------------------------------- Gross Pay: 1960.0 Federal Income Tax (8.74%) 171.3 Social Security Tax (6.20%) 121.5 Medicare Tax (1.45%) 28.4 ---------------------------------------------- Net pay 1638.8 DRIVER CLASS Create driver class SP2022_BiWeeklySalaryOfEmployee_yourLastName This application will helps employees to calculate the Net pay in two weeks. After the users provide from the keyboard the employee Id, employee name, hourly salary and number of work hours in 2 weeks. then create the object of class Employee and use this object to access the method toString() of datatype class to display the output of on the screen




Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Entrepreneurship

Authors: Andrew Zacharakis, William D Bygrave

5th Edition

1119563097, 9781119563099

More Books

Students also viewed these Programming questions

Question

8. Who is the optimum audience for a blog?

Answered: 1 week ago

Question

2. What are the pros and cons of readability indexes?

Answered: 1 week ago

Question

9. How does one write for a blog?

Answered: 1 week ago