// 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
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