Five individual exercises covering all topics of the module. Exercise A.1 [5%] In this Exercise you...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Five individual exercises covering all topics of the module. Exercise A.1 [5%] In this Exercise you will create multiple methods in one class called ExerciseA1 for A.1A and A.1B and call them in A.1C. Exercise A.1A [2%] Add a method to ExerciseAl called convertFahrenheitToCelsius that receives a value as a double and converts this value from Fahrenheit to Celsius. The converted value should be returned by the method as a double. The formula for the conversion is celsius = (fahrenheit - 32) * 5/9 Exercise A.1B [2%] Add a method to ExerciseA. 1 called printKg Pounds without parameters that returns void that prints the corresponding weight in pounds for 1 to 199 kilograms skipping every second value and starting with one (1 kilogram is 2.2 pounds). For example: 1 2.2 3 6.6 197 433.4 199 437.8 Exercise A.1C [1%] Add a main method and call convertFahrenheitToCelsius and printKg Pounds. Exercise A.2 [4%] In this Exercise you create several classes and use inheritance and encapsulation. Implement a class called Person. Implement two subclasses of Person called Student and Employee, Implement two subclasses of Employee called Academic and Staff. A person should have variables for a name, address, phone number and e-mail. Students should have a status (undergraduate, postgraduate or research). The status should be a constant. All employees should have variables for an office, salary and hiring date. Define a separate class for the date containing variables for year, month and day and use it for the hiring date. Academics have variables for office hours and a rank. Staff members have a variable for a role. For all classes (except the date) override the toString method to print the name of the class and the name of the person. Use appropriate access modifiers for all variables. Add a main method in a class called ExerciseA2, create one object of each class and print them to the command line. Exercise A 3 159/1 Five individual exercises covering all topics of the module. Exercise A.1 [5%] In this Exercise you will create multiple methods in one class called ExerciseA1 for A.1A and A.1B and call them in A.1C. Exercise A.1A [2%] Add a method to ExerciseAl called convertFahrenheitToCelsius that receives a value as a double and converts this value from Fahrenheit to Celsius. The converted value should be returned by the method as a double. The formula for the conversion is celsius = (fahrenheit - 32) * 5/9 Exercise A.1B [2%] Add a method to ExerciseA. 1 called printKg Pounds without parameters that returns void that prints the corresponding weight in pounds for 1 to 199 kilograms skipping every second value and starting with one (1 kilogram is 2.2 pounds). For example: 1 2.2 3 6.6 197 433.4 199 437.8 Exercise A.1C [1%] Add a main method and call convertFahrenheitToCelsius and printKg Pounds. Exercise A.2 [4%] In this Exercise you create several classes and use inheritance and encapsulation. Implement a class called Person. Implement two subclasses of Person called Student and Employee, Implement two subclasses of Employee called Academic and Staff. A person should have variables for a name, address, phone number and e-mail. Students should have a status (undergraduate, postgraduate or research). The status should be a constant. All employees should have variables for an office, salary and hiring date. Define a separate class for the date containing variables for year, month and day and use it for the hiring date. Academics have variables for office hours and a rank. Staff members have a variable for a role. For all classes (except the date) override the toString method to print the name of the class and the name of the person. Use appropriate access modifiers for all variables. Add a main method in a class called ExerciseA2, create one object of each class and print them to the command line. Exercise A 3 159/1
Expert Answer:
Related Book For
Integrated Accounting
ISBN: 978-1285462721
8th edition
Authors: Dale A. Klooster, Warren Allen, Glenn Owen
Posted Date:
Students also viewed these programming questions
-
Write an alternative definition that is tail-recursive (iterative) and makes use of accumulator variables. [10 marks] Explain why your alternative definition executes more efficiently. [3 marks] 1...
-
Image transcription text Module 5 Discussion A' Instructions: This discussion will be completed in two parts, and will give you an opportunity to reect upon this week's content and to interact with...
-
M DO NOT TURN THIS PAGE UNTIL YOU ARE TOLD TO DO SO SECTION B. ANSWER ANY THREE (3) QUESTIONS Question 1 (25 marks) You have analyzed Solar Power Ltd. and have reported the results of your analysis...
-
In Exercise 10.6 we presented data on the estimated average price for a 6-ounce can or a 7.06-ounce pouch of tuna, based on prices paid nationally in supermarkets. A portion of the data is reproduced...
-
Decentralized decision making is very controversial in a corporate environment. Central office managers feel like they are losing control of managers in specific plants or regional offices. What are...
-
Find the finite difference solution of the problem \[\begin{aligned}& \frac{\partial^{2} u}{\partial x^{2}}=\frac{\partial u}{\partial t} \quad 0 by the explicit method. Plot the solution using...
-
Based on the information given, indicate whether the following industry is best characterized by the model of perfect competition, monopoly, monopolistic competition, or oligopoly. a. Industry A has...
-
IVANHOE COMPANY Trial Balance August 31, 2022 Before Adjustment After Adjustment Cr. Dr. Cash $10,246 Cr. Dr. $10.246 Accounts Receivable 8,272 8.836 Supplies 2,350 470 Prepaid Insurance 3,760 2,350...
-
Every supervisor brings a unique personality, varied experiences, and a variety of training to the decision-making process. Some supervisors are risk takers; some value certainty. Some supervisors...
-
Is money the same as wealth? If not, distinguish between the two with examples of both, and explain the main difference between money, wealth, and income.
-
What are monetary aggregates? Distinguish between M1 and M2 as measures of monetary aggregates.
-
Is the United States likely to become a cashless society? Briefly explain.
-
If there were a decrease in the efficiency of the payments system, what would be the cost to the economy?
-
What is the cause of hyperinflation?
-
You need to write a paper about Donald Trumps Emotional Intelligence:
-
What are technical skills At what level are they most important and why?
-
True or False: If investment capital is borrowed, the income tax rate equals \(40 \%\), the after-tax MARR is \(12 \%\), and the loan rate is \(15 \%\), then it is best to repay the loan using Plan 1.
-
Consider the following data for 2007 from an aftertax cash flow analysis. What is the after-tax cash flow for 2007 ? Before - Tax Cash Flow \(=\$ 23,000\) Loan Principal Payment \(=\$ 3,203\) Loan...
-
Determine the smallest taxable income on which a. the very last dollar is taxed at 35 percent or more. b. the effective tax rate is 34 percent or more. c. the effective tax rate is 35 percent or more.
Study smarter with the SolutionInn App