Question: Below is an algorithm to compute interest. Translate the following algorithm into Java code. Make sure to define the right data type. Step 1: Declare
Below is an algorithm to compute interest. Translate the following algorithm into Java code. Make sure to define the right data type. Step 1: Declare a variable named balance with initial value 300 . Step 2: Declare a constant named INTEREST RATE with value 0.03. Step 3: Declare a variable named interest, multiply balance and INTEREST_RATE, and assign the result to interest. Step 4: Display interest to the console. Sample Run Your interest is $9.0 1) Handwriting code (10 points) Vrite a Java program called SelfDrivingCar considering the following directions and sample runs. The program will prompt (ask) the aser to input an angle value (integer value) and print the following message: "Tuming Left" if the inputted integer value is negative, Going Straight" if the inputted integer value is 0 , "Turning Right" if the inputted integer value is positive. Sample Run 1 Enter the angle: 78 Tuming Left Sample Run 2 Enter angle: 0 Going Straight Sample Run 3 Enter the angle: 67 Turning Right 2) Handwriting code (10 points) Write a Java program called SkinTest considering the following directions and sample runs. The program will prompt (ask) the user o input a skin test result (integer value) and print the following messages: "Your skin is Oily" if the inputted integer value is positiv Your skin is Normal" if the inputted integer value is 0 , "Your skin is Dry" if the inputted integer value is negative. Sample Run 1 Enter skin test value: 65 four skin is Oily Sample Run 2 Enter skin test value: 0 Your skin is Normal sample Run 3 enter skin test value: 23 rour skin is Dry
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
