1) Create a class which will prompt usersfor input. The class should include a constructor with a Stringparameter specifying the text of the prompt, a method for changing theprompt, and a method for displaying the prompt and collecting theresponse from the user, which returns the value entered by the user. Youmay use the following code for this class or implement it any other wayyou wish:
2)
Create a subclass of the previous classwhich will prompt the user to input an integer value and test theresponse to see if it’s a valid integer. The method to get a responseshould print out an error message if the user enters a non-integer valueand continues asking the user to input a valid value (using theprompt). Once a valid integer value is entered, it should return aninteger value. Create another subclass of the first class, which willprompt the user to input a real/decimal number.Then, write a simple Java program whichwill declare and initialize at least three (3) variables appropriatelysized, typed, named, and commented. The first variable will be used tohold the user’s current body temperature. The user’s body temperaturecannot exceed 116.0 and cannot be measured with any more precision thanthe nearest tenth (10th) of a degree. The second variable will be usedto hold the user’s age in whole years and cannot be any value greaterthan 120. You will then multiply the user’s age times his/her bodytemperature to calculate his/her Akendian body temperature index, whichwill be stored in a third variable.Given the scenario provided for you,write a Java program. Make sure that your Java program is appropriatelycommented, including the name of the author of the code, when it wascreated, and the date it was last modified. You must also usestylistically 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)
Х
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>