// Incomplete Program (The Scanner class is used for data entry) import java.lang.*; import java.util.*; public class MoneyInBank { public static void main(String[] args) { Scanner keyboard = new Scanner (System.in); float annualRate = 0; float quarterlyRate = 0; 0; double principal 8; 8; double interest double finalAmount (byte) 0; byte quarter int year - 0; // for question 1 System.out.print ("Enter the year: "); // for question 2 annualRate = year System.out.print ("Enter the initial principal: "); principal - ; System.out.printin(); System.out.printf("%s%.2f%n", "Principal = ", _ System.out.printf("%s%.2f%c%n", "Annual Interest Rate = ", annualRate * 180, '%'); System.out.printf ("%-65%-85%-165%-305%n", "Year", "Quarter", "Interest Earned", // for question 3 _); // for question 4 "Amount at the end of quarter"); // for question 5 quarterlyRate quarter = 1; interest = // for question 6 finalAmount = printcipal + interest; System.out.printf("%-6d%-8d%–16.2f%-30.2f%n", year, quarter, interest, finalAmount principal = final Amount; quarter = // for question 7 // for question 8 + interest; finalAmount = principal System.out.printf("%-6d%-8d%-16.2f%-30.2f%n", year, quarter, interest, finalAmount principal = finalAmount; // for question 9
// Incomplete Program (The Scanner class is used for data entry) import java.lang.*; import java.util.*; public class MoneyInBank { public static void main(String[] args) { Scanner keyboard = new Scanner (System.in); float annualRate = 0; float quarterlyRate = 0; 0; double principal 8; 8; double interest double finalAmount (byte) 0; byte quarter int year - 0; // for question 1 System.out.print ("Enter the year: "); // for question 2 annualRate = year System.out.print ("Enter the initial principal: "); principal - ; System.out.printin(); System.out.printf("%s%.2f%n", "Principal = ", _ System.out.printf("%s%.2f%c%n", "Annual Interest Rate = ", annualRate * 180, '%'); System.out.printf ("%-65%-85%-165%-305%n", "Year", "Quarter", "Interest Earned", // for question 3 _); // for question 4 "Amount at the end of quarter"); // for question 5 quarterlyRate quarter = 1; interest = // for question 6 finalAmount = printcipal + interest; System.out.printf("%-6d%-8d%–16.2f%-30.2f%n", year, quarter, interest, finalAmount principal = final Amount; quarter = // for question 7 // for question 8 + interest; finalAmount = principal System.out.printf("%-6d%-8d%-16.2f%-30.2f%n", year, quarter, interest, finalAmount principal = finalAmount; // for question 9
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Please find the remark "for question 8" in the given incomplete program. What expression should replace the blank line? When typing your answer, do NOT put spaces where optional spaces may be placed and do NOT include the ; because it is already given.
Attached is the desired sample run and partially done program
![// Incomplete Program (The Scanner class is used for data entry)
import java.lang.*;
import java.util.*;
public class MoneyInBank {
public static void main(String[] args) {
Scanner keyboard = new Scanner (System.in);
float annualRate = 0;
float quarterlyRate = 0;
0;
double principal
8;
8;
double interest
double finalAmount
(byte) 0;
byte quarter
int year - 0;
// for question 1
System.out.print ("Enter the year: ");
// for question 2
annualRate =
year
System.out.print ("Enter the initial principal: ");
principal - ;
System.out.printin();
System.out.printf("%s%.2f%n", "Principal = ", _
System.out.printf ("%5%.2f%c%n", "Annual Interest Rate = ", annualRate * 100, '%');
System.out.printf ("%-65%-85%-165%-30s%n", "Year", "Quarter", "Interest Earned",
// for question 3
_); // for question 4
"Amount at the end of quarter");
// for question 5
quarterlyRate
quarter = 1;
interest =
// for question 6
finalAmount = printcipal + interest;
System.out.printf("%-6d%-8d%-16.2f%-30.2f%n", year, quarter, interest, finalAmount);
principal = final Amount;
quarter =
// for question 7
// for question 8
+ interest;
finalAmount = principal
System.out.printf("%-6d%-8d%-16.2f%-30.2f%n", year, quarter, interest, finalAmount);
principal = finalAmount;
// for question 9
// for question 10
// for question 11
finalAmount =
System.out.printf("%-6d%-8d%-16.2f%-30.2f%n", year, quarter, interest, finalAmount);
// for question 12
// for question 13
// for question 14
// for question 15
System.out.printf("%-6d%-8d%-16.2f%-30.2f%n", year, quarter, interest, finalAmount);
System.exit (8);
// end of the main method
// end of the class](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Ffc4eba69-32ba-41f1-b37c-e11be6514d08%2F600b6b89-2e7f-4d32-abae-4e552d30cf60%2F3mxbi0j_processed.png&w=3840&q=75)
Transcribed Image Text:// Incomplete Program (The Scanner class is used for data entry)
import java.lang.*;
import java.util.*;
public class MoneyInBank {
public static void main(String[] args) {
Scanner keyboard = new Scanner (System.in);
float annualRate = 0;
float quarterlyRate = 0;
0;
double principal
8;
8;
double interest
double finalAmount
(byte) 0;
byte quarter
int year - 0;
// for question 1
System.out.print ("Enter the year: ");
// for question 2
annualRate =
year
System.out.print ("Enter the initial principal: ");
principal - ;
System.out.printin();
System.out.printf("%s%.2f%n", "Principal = ", _
System.out.printf ("%5%.2f%c%n", "Annual Interest Rate = ", annualRate * 100, '%');
System.out.printf ("%-65%-85%-165%-30s%n", "Year", "Quarter", "Interest Earned",
// for question 3
_); // for question 4
"Amount at the end of quarter");
// for question 5
quarterlyRate
quarter = 1;
interest =
// for question 6
finalAmount = printcipal + interest;
System.out.printf("%-6d%-8d%-16.2f%-30.2f%n", year, quarter, interest, finalAmount);
principal = final Amount;
quarter =
// for question 7
// for question 8
+ interest;
finalAmount = principal
System.out.printf("%-6d%-8d%-16.2f%-30.2f%n", year, quarter, interest, finalAmount);
principal = finalAmount;
// for question 9
// for question 10
// for question 11
finalAmount =
System.out.printf("%-6d%-8d%-16.2f%-30.2f%n", year, quarter, interest, finalAmount);
// for question 12
// for question 13
// for question 14
// for question 15
System.out.printf("%-6d%-8d%-16.2f%-30.2f%n", year, quarter, interest, finalAmount);
System.exit (8);
// end of the main method
// end of the class

Transcribed Image Text:Enter the year: 2019
Enter the initial principal: 10000
Principal = 10000.00
Annual Interest Rate = 5.00%
Year
Quarter Interest Earned Amount at the end of quarter
2019
1
125.00
10125.00
2019
126.56
10251.56
2019
3
128.14
10379.71
2019 4
129.75
10509.45
Legend:
Red-colored text are inputs from the user via the keyboard.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps

Recommended textbooks for you

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education