1) Create a class which will prompt users for input. The class should include a constructor with a String parameter specifying the text of the prompt, a method for changing the prompt, and a method for displaying the prompt and collecting the response from the user, which returns the value entered by the user. You may use the following code for this class or implement it any other way you wish:

2) Code for assignment 5

Create a subclass of the previous class which will prompt the user to input an integer value and test the response to see if it’s a valid integer. The method to get a response should print out an error message if the user enters a non-integer value and continues asking the user to input a valid value (using the prompt). Once a valid integer value is entered, it should return an integer value. Create another subclass of the first class, which will prompt the user to input a real/decimal number.

Then, write a simple Java program which will declare and initialize at least three (3) variables appropriately sized, typed, named, and commented. The first variable will be used to hold the user’s current body temperature. The user’s body temperature cannot exceed 116.0 and cannot be measured with any more precision than the nearest tenth (10th) of a degree. The second variable will be used to hold the user’s age in whole years and cannot be any value greater than 120. You will then multiply the user’s age times his/her body temperature to calculate his/her Akendian body temperature index, which will be stored in a third variable.

Given the scenario provided for you, write a Java program. Make sure that your Java program is appropriately commented, including the name of the author of the code, when it was created, and the date it was last modified. You must also use stylistically correct names for your Java file, Java classes, variables, and methods (if appropriate).

(code has to be able to run on command prompt. show pictures of results as well)
1 attachmentsSlide 1 of 1

  • attachment_1attachment_1

UNFORMATTED ATTACHMENT PREVIEW

Х c. Administrator: Command Prompt Microsoft Windows [Version 10.0.19842.1110] (c) Microsoft Corporation. All rights reserved. C:\WINDOWS\system32>cd C:\Program Files\Java\jdk-16.0.1\bin C:\Program Files\Javaljdk-16.0.1\bin>java Test.java Test.java:19: error: cannot find symbol Decimalvalue decimal = new DecimalValue(“Enter your current body temperature: “); symbol: class DecimalValue location: class Test Test.java:19: error: cannot find symbol DecimalValue decimal = new DecimalValue(“Enter your current body temperature: “); symbol: class DecimalValue location: class Test Test.java:20: error: cannot find symbol Integervalue integer = new IntegerValue(“Enter your age: “); symbol: class IntegerValue location: class Test Test.java:20: error: cannot find symbol IntegerValue integer = new IntegerValue(“Enter your age: “); symbol: class IntegerValue location: class Test 4 errors error: compilation failed C:\Program Files\Java\jdk-16.0.1\bin>

Do you have a similar assignment and would want someone to complete it for you? Click on the ORDER NOW option to get instant services at essayloop.com. We assure you of a well written and plagiarism free papers delivered within your specified deadline.