Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is my code but i got 4 errors can you help import java.util.Scanner; class Main { public String toString() { return Main []; }

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

This is my code but i got 4 errors can you help

import java.util.Scanner;

class Main { public String toString() { return "Main []"; }

public static void main(final String[] args) { //Vaule of home final Scanner input = new Scanner(System.in); final double InitializeVaule = 200000; final double ElapsedYears = 25; final double IntrestRate = 6; final double FinalVaule = $85374.1439486976;

// Java Scanner int vaule of the home

System.out.print("Initial vaule of the home.: ");

// Input to the number of elapsed years System.out.print("The number Of elapsed years.: "); // Calculate the intrest rate A=P(1+r)^t = System.out.print("Intrest rate as a precentage, converted to a decimal amount:");

{ public static void main (String args[]) { float p, r, t, si; // principal amount, rate, time and simple interest respectively p = 13000; r = 12; t = 2; si = (p*r*t)/100; System.out.println("Simple Interest is: " +si); }} // Display the final vaule to the user System.out.println(" Number of Years" + InitialVaule); System.out.println("Intrest Rate"); } }

: sh - - javac -classpath .:target/dependency/* -d . s(find . -type f -nane '; .java' ) .Main.java:15: error: ';' expected final double FinalVaule = \$85374.1439486976; Main.java:29: error: illegal start of expression public static void main (String args[]) .Main. java:37: error: class, interface, enum, or record expected System.out.println(" Number of Years" + InitialVaule); .Main. java:38: error: class, interface, enum, or record expected Systen.out.println("Intrest Rate"); Main.java:39: error: class, interface, enum, or record expected 3 exit status 1 : :] Debugger x shell x 3. console x+ The following is the program flow for this program if the user enters 200000 for the initial value of a home, 25 for the number of elapsed years, and 6 for the interest rate (which will be converted to 0.06 for the calculation). Please enter the initial value of the home: 200000 Please enter the number of elapsed years: 25 Please enter the interest rate: 6 The final value of the home is $858374.1439486976 ir Lab3_FirstName_LastName. You must include comments describing key parts of this rogram. 1. Make sure the initial code of your application is prepared to write statements in the main method. 2. Declare a Scanner that accepts input from the keyboard. 3. Declare the following four variables: - A variable of type double that will hold the initial value of the home - A variable of type int that will hold the number of elapsed years - A variable of type double that will hold the interest rate - A variable of type double that will hold the final value of the home 4. Include a prompt to the user to input the initial value of the home. Use the appropriate method of the Scanner class to assign the user's input to the appropriate variable. 5. Include a prompt to the user to input the number of elapsed years. Use the appropriate method of the Scanner class to assign the user's input to the appropriate variable. As a hint for the method, if the double data type uses nextDouble, what would the int data type use? 6. Include a prompt to the user to input the interest rate. Use the appropriate method of the Scanner class to assign the user's input to the appropriate variable. Since the user will likely input the interest rate as a percentage, you will need to convert this to a decimal amount. 7. Calculate the final value of the home using the following formula for compound interest: A=P(1+r)1 Where P represents the initial value, t represents the number of elapsed years, r represents the interest rate, and A represents the final value. Be careful about the order of operations. Addition should be performed first, then the power, and then multiplication. 8. Display a message that includes the final value to the user

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Explain the guideline for job description.

Answered: 1 week ago

Question

What is job description ? State the uses of job description.

Answered: 1 week ago

Question

What are the objectives of job evaluation ?

Answered: 1 week ago

Question

Write a note on job design.

Answered: 1 week ago