Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

TEXT VERSION----- Implement a class to model engineers with elements: fields, methods and constructors. The class has three fields: name, age, and company name. These

image text in transcribed

TEXT VERSION-----

Implement a class to model engineers with elements: fields, methods and constructors. The class

has three fields: name, age, and company name. These three fields have their declared types as string,

integer and string. One constructor is a default constructor that requires no arguments, and the other can

take age as input. The class has two methods. One method prints out the engineers salary depending on

the given age. The computation formula is as below.

40000 * sqrt( exp(0.04295* age+ 0.141) )

For sqrt and exp, please take advantage of the Math class. For example, Math.sqrt(9) returns 3. The

salary should have 2-decimal precision. There should be 6 digits space for the integer portion. For example, if the salary is 51234.4543, the output format should be including the "and $ as below. Note that represents a space.

"$Salary:$"=$51234.45

The other method displays the three fields separated by a tab in another format. Here shows an instance with name John,

age 45 and company name compToday. The age occupies a 3-digit space, and represents a space.

\$Name:$\=John, \$Age:$\=45, \$Company, Name:$\=compToday

Develop a class with a main method to start the execution and utilize the Scanner class to accept user

inputs for name, age and company name. Instantiate two engineer objects and assign field values for

individual objects. Both objects will call each method once. Please add at least one single-line and

one multiple-line comment. Please also add javadoc comments to fields, methods and constructors.

The multiple-line comment is placed in the beginning of the class and list your name as the author and the

URLs of the Math and Scanner classes. Finally, use the javadoc tool to create the API for these two classes.

Implement a class to model engineers with elements: fields, methods and constructors. The class has three fields: name, age, and company name. These three fields have their declared types as string, integer and string. One constructor is a default constructor that requires no arguments, and the other can take age as input. The class has two methods. One method prints out the engineer's salary depending on the given age. The computation formula is as below 40000 * sqrt( exp(0.04295 * age + 0.141)) For sqrt and exp, please take advantage of the Math class. For example, Math.sqrt(9) returns 3. The salary should have 2-decimal precision. There should be 6 digits space for the integer portion. For example, if the salary is 51234.4543, the output format should be including the " and S as below. Note that represents a space "SSalary: S"-ASAS 1 234.45 The other method displays the three fields separated by a tab in another format. Here shows an instance with name John, age 45 and company name comp Today. The age occupies a 3-digit space, and represents a space Develop a class with a main method to start the execution and utilize the Scanner class to accept user inputs for name, age and company name. Instantiate two engineer objects and assign field values for individual objects. Both objects will call each method once Please add at least one single-line and one multiple-line comment. Please also add javadoc comments to fields, methods and constructors. The multiple-line comment is placed in the beginning of the class and list your name as the author and the URLs of the Math and Scanner classes. Finally, use the javadoc tool to create the API for these two classes. Compress the working directory that contains all of your files

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

MongoDB Applied Design Patterns Practical Use Cases With The Leading NoSQL Database

Authors: Rick Copeland

1st Edition

1449340040, 978-1449340049

More Books

Students also viewed these Databases questions

Question

estimate the regression parameters 0, 1, and .

Answered: 1 week ago

Question

How do members envision the ideal team?

Answered: 1 week ago

Question

Has the team been empowered to prioritize the issues?

Answered: 1 week ago

Question

b. Does senior management trust the team?

Answered: 1 week ago