Answer to Question #246037 in Java | JSP | JSF for Chadwin Fritz

Question #246037

StudentLoans class

6 Code a method displayLoanAmounts(). This method display all the loan amounts and the interest on those amounts. Output format example:

Loan amounts and Interest

--------------------------

10000.0 500.0

-------------------------

50000.0 2500.0

-------------------------

20000.0 2000.0

-------------------------


1
Expert's answer
2021-10-06T03:53:41-0400
import java.util.Scanner;
public class StudentLoans {
  static void displayLoanAmounts() {
        Scanner input=new Scanner(System.in);
	    System.out.println("Enter the loan amount: ");
	    double x=input.nextDouble();
	    double discount=x*0.2;
	    System.out.println("----------------");
	    System.out.print(x);
	    System.out.print(" ");
	    System.out.print(discount);}
	public static void main(String[] args) {
	    displayLoanAmounts();
	}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS