
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
Please find the remark "for question 15" 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 desried sample run and the 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](https://content.bartleby.com/qna-images/question/fc4eba69-32ba-41f1-b37c-e11be6514d08/7e64cd91-c1d8-4e94-8e12-da48e755cf09/benn8ut_thumbnail.png)
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.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps

Knowledge Booster
Similar questions
- The countSubstring function will take two strings as parameters and will return an integer that is the count of how many times the substring (the second parameter) appears in the first string without overlapping with itself. This method will be case insensitive. For example: countSubstring(“catwoman loves cats”, “cat”) would return 2 countSubstring(“aaa nice”, “aa”) would return 1 because “aa” only appears once without overlapping itself. public static int countSubstring(String s, String x) { if (s.length() == 0 || x.length() == 0) return 1; if (s.length() == 1 || x.length() == 1){ if (s.substring(0,1).equals(x.substring(0,1))){ s.replaceFirst((x), " "); return 1 + countSubstring(s.substring(1), x); } else { return 0 + countSubstring(s.substring(1), x); } } return countSubstring(s.substring(0,1), x) + countSubstring(s.substring(1), x); } public class Main { public static void main(String[] args) { System.out.println(Recursion.countSubstring("catwoman loves cats","cat"));…arrow_forwardWhich of the following is not true of a loop invariant? O If it is True just before entering the loop, it must also be True right after executing the last line of the loop, even if it temporarily stops being True somewhere within the body of the loop. O It is a proposition, and therefore evaluates to a True or False value. O It must be a tautology. O If the loop invariant is True before entering a loop, the loop entry condition may still be False, meaning that the loop would not be executed and the loop invariant would remain True by default.arrow_forwardWhich of the following is most likely to be removed at the conclusion of a line? What justifies the elimination of it?arrow_forward
- Hello,So for my assignment I had to create a program that would find the sum and then average of a list of numbers. I managed to do that part fine, but I was also meant to use double data type for my variables which I think I may have done right too? But for some reason in my output for my answer Im still getting a whole number, when I should be getting a decimal number. Does anyone see a mistake im making?arrow_forwardPlease help me with my assignment, I need to submit it by tonight. I don't get an output with my list, please help. def make_pizza(*toppings):"""Print the list of toppings that have been requested."""print("\nMaking a pizza with the following toppings:")make_pizza(*topping('pepperoni','mushroom','green peppers','extra cheese')print(make_pizza()[1])arrow_forwardYou are responsible for adding the appropriate testing code to your main. a. The getValedictorian method returns the valedictorian of the class, that is the student with the highest grade point average. Implement this new method. b. The getHonorsPercent method returns the percentage of students in the class who are in the honors program. Use 3.75 as the cutoff GPA. Implement this method. Also print the list of students, by using the isHonor method, in the Honors program. c. An alternate implementation for the School class is being considered, in which the students are stored in an ArrayList instead of an array. Show how the declaration of the data field students would look in this alternate design. MAIN CLASS: import java.util.ArrayList; public class Main { public static void main(String[] args) { System.out.println("Unit07Project2 by Your Name"); System.out.println(); int size = 10; School onw = new School(size); /* Add the code…arrow_forward
- In this assignment you will demonstrate your knowledge of debugging by fixing the errors you find in the program below. Fix the code, and paste it in this document, along with the list of the problems you fixed.This example allows the user to display the string for the day of the week. For example, if the user passed the integer 1, the method will return the string Sunday. If the user passed the integer 2, the method will return Monday. This code has both syntax errors and logic errors. Hint: There are two logic errors to find and fix (in addition to the syntax errors).Inport daysAndDates.DaysOfWeek;public class TestDaysOfWeek {public static void main(String[] args) {System.out.println("Days Of week: ");for (int i = 0;i < 8;i++) {System.out.println("Number: " + i + "\tDay Of Week: " + DaysOfWeek.DayOfWeekStr(i) )}}}package daysAndDatespublic class DaysOfWeek {public static String DayOfWeekStr(int NumberOfDay) {String dayStr = ""switch (NumberOfDay) {case 1:dayStr =…arrow_forwardPlease assist me with these questions.(for the 1st part just complete the bolded area. All other areas have been completed. Then complete the 2nd part 1. Devise an algorithm to receive a positive number, n, and output all prime numbers that are smaller than n and have the digit 5. For example, if n is 100, the program should output 5, 53 and 59. Your solution should have a main algorithm and two sub-algorithms, let's call them prime(num) and has5(num). Trace your algorithm and sub-sub-algorithm for the input 15. You should provide pre- and post-conditions for all your 3 (sub)algorithms. Now, let's trace this algorithm for the input n = 15: For i = 2 to 14, we check if i is prime and if i contains the digit 5. The prime numbers less than 15 are 2, 3, 5, 7, 11, 13. Among these, only 5 contains the digit 5. So, the output for n = 15 is [5]. 2. I also need help with creating JavaScript code for the flowchart provided below. Note: You will have to implement several functions that…arrow_forwardThe following requirments that weren't mentioned for solving the following Python Code below: The provided code for alphabet, test_dups, test_miss, and histogram. Your implementation of the has_duplicates function. A loop that outputs duplicate information for each string in test_dups. Your implementation of the missing_letters function. A loop that outputs missing letters for each string in test_miss. Write a function called missing_letters that takes a string parameter and returns a new string with all the letters of the alphabet that are not in the argument string. The letters in the returned string should be in alphabetical order. Your implementation should use a histogram from the histogram function. It should also use the global variable alphabet. It should use this global variable directly, not through an argument or a local copy. It should loop over the letters in alphabet to determine which are missing from the input parameter. The function missing_letters should…arrow_forward
- Please fix of couple things in the code below. A couple of things. The input value is the waist size; the pant size is what the program is going to determine. The name valid_input is too generic. The name of the function should reflect what it does; also, start the name of the function with an action verb. For example, read_waist_size We can simplify the reading with the form : Read waist size WHILE waist size is not in the right range DO Show error message Read waist size again Simpler. By the way, the error message should let the user know how not to make the same mistake again. Something like, “This is not a correct size. Enter a value between 26 and 42.” is more helpful. def valid_input():while True:SizeOfPants = int(input("What pants size you are looking for: "))if 26 <= SizeOfPants <= 42:breakelse:print("This is not a correct size. Try Again!!")return SizeOfPants def return_size(SizeOfPants):if 26 <= SizeOfPants < 28:return "XXS"elif 28 <= SizeOfPants…arrow_forwardLook at the image for the expected output. Use if class, scanner class, return class to do this program. Look image for the valid user input.arrow_forwardCan you give me two ways to do itarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

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