Question
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
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 filesStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started