Answered step by step
Verified Expert Solution
Question
1 Approved Answer
s 14 marks] Consider the program below 1 import java.util public class PandI public static void main (Stringt) arga) // ?ntro Syatem.out.printin(Inin INTEREST CALCULATOR) //
s 14 marks] Consider the program below 1 import java.util public class PandI public static void main (Stringt) arga) // ?ntro Syatem.out.printin("Inin INTEREST CALCULATOR") // initialize input Scanner Scanner stdin new Scanner (System.in) 9 10 Dyst an out.printinnruprai 1oan i intatass // Get principal: System.out.printlnINPUT System.out.print(" Amount b Loan (in ) double principal- stdin.nextDouble () System.out.print(" Annual Interest (in ) double interest stdin.nextDouble) 12 13 15 16 17 // Convert from annual interest to daily interest interest /je 100.0 / 3652 18 19 20 21 // add interest to principal for each day of a year double yearEnd principal; 23 24 25 26 27 28 29 30 31 32 for (int i 0i 365; i++) yearEnd yearEnd yearEnd interest: System . out . printf ( "Original-82.2f ", principal) System.out.printf ("Amount Owing 2.2fIn", yearEnd) : System . out . printf ("Interest Cost %2.2f" (yearEnd principal)): The program was compiled using "javac Pandl.java" and produced the following errors: PandI.java:12: error: illegal character PandI.java:12: error' expected PandI.java: 12: error: illegal start of expression PandI. java: 12: error: unclosed string literal system.out.printin (InINPUT: " System.out.printin (InINPUT: ") System.out.printin (InINPUT: ") System. out.print1n ( INPUT:" continued on next page Page 4 of 6
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started