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
in java
At KU college, the tuition for a full-time student is $8,500.00 PER It has been announced that the tuition will increase by 3.5 percent each year for the next 5 years. Write a
Example of the desired output:
Year 1:
Year 2:
Year 3:
Year 4:
Year 5:
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 3 steps with 3 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- In Java Create a class DoWhileEvent3, write code that ask the user to enter a positive or negative number or 'x' 'X' to quit the program. When out of the loop the sum of all numbers entered is printed. READ THE USER'S input as String an not as integer. Use a do while loop.arrow_forwardin java Integer valueIn is read from input. Write a while loop that iterates until valueIn is negative. In each iteration: Update integer result as follows: If valueIn is divisible by 5, output "win" and increment result. Otherwise, output "lose" and do not update result. Then, read an integer from input into variable valueIn. End each output with a newline. Click here for exampleEx: If the input is 5 15 11 -5, then the output is: win win lose Result is 2 Note: x % 5 == 0 returns true if x is divisible by 5. import java.util.Scanner; public class ResultCalculator { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); int valueIn; int result; result = 0; valueIn = scnr.nextInt(); /your code here/ System.out.println("Result is " + result); }}arrow_forwardin java Strings itemToFind and inputItem are read from input. Integer wordCount is initialized with 1. Write a while loop that iterates until inputItem is equal to "Done". In each iteration of the loop: Increment wordCount if inputItem is equal to itemToFind. Read string inputItem from input. Click here for example Note: Assume that input has at least two strings. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 import java.util.Scanner; public class SimpleWhileLoop { publicstaticvoidmain(String[] args) { Scannerscnr=newScanner(System.in); StringitemToFind; StringinputItem; intwordCount; itemToFind=scnr.next(); inputItem=scnr.next(); wordCount=1; /* Your code goes here */ System.out.println(itemToFind+" occurs "+wordCount+" time(s)."); } }arrow_forward
- Computer Science please in java. must use while loop.arrow_forwardin java Jump to level 1 The first and second integers in the input are read into variables previousNum and currentNum, respectively. Write a loop that iterates until currentNum is not equal to 6 plus previousNum. In each iteration: Output currentNum, followed by " is 6 plus ", previousNum, and ". Sequence is increasing arithmetically." End with a newline. Assign previousNum with currentNum. Read the next integer from input and assign currentNum with the integer read. After the loop, output the last integer read followed by " breaks the sequence." and a newline. Click here for example Note: Assume that input has at least two integers. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 import java.util.Scanner; public class Sequencing { publicstaticvoidmain(String[] args) { Scannerscnr=newScanner(System.in); intcurrentNum; intpreviousNum; previousNum=scnr.nextInt(); currentNum=scnr.nextInt(); System.out.println("Sequence starts at "+previousNum+"."); /* Your code…arrow_forwardAccumulating Totals in a Loop Summary In this lab, you add a loop and the statements that make up the loop body to a Java program that is provided. When completed, the program should calculate two totals: the number of left-handed people and the number of right-handed people in your class. Your loop should execute until the user enters the character X instead of L for left-handed or R for right-handed. The inputs for this program are as follows: R, R, R, L, L, L, R, L, R, R, L, X Variables have been declared for you, and the input and output statements have been written. Instructions Ensure the file named LeftOrRight.java is open. Write a loop and a loop body that allows you to calculate a total of left-handed and right-handed people in your class. Execute the program by clicking Run and using the data listed above and verify that the output is correct.arrow_forward
- in java String inputWord is read from input. Write a while loop that iterates until inputWord is equal to "Finale". In each iteration of the loop: Read integer clothingNumber from input. If clothingNumber is less than 30, output the value of inputWord, followed by ": low on stock" and a newline. Otherwise, output the value of inputWord, followed by ": well stocked" and a newline. Read string inputWord from input. Click here for example 1 2 3 4 5 6 7 8 9 10 11 12 13 14 import java.util.Scanner; public class PairedDataProcessing { publicstaticvoidmain(String[] args) { Scannerscnr=newScanner(System.in); StringinputWord; intclothingNumber; inputWord=scnr.next(); /* Your code goes here */ } }arrow_forwardThe language is Java. The chapter it is in is on Looping.arrow_forwardin java Integer numInts is read from input representing the number of integers to be read next. Use a loop to read the remaining integers from input into variable value. For each integer from 0 to numInts minus 1, inclusive, output the integer followed by " grapes". End each output with a newline. Click here for exampleEx: If the input is: 2 14 12 then the output is: 14 grapes 12 grapes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 import java.util.Scanner; public class NumberOfGrapes { publicstaticvoidmain(String[] args) { Scannerscnr=newScanner(System.in); intnumInts; intvalue; inti; numInts=scnr.nextInt(); /* Your code goes here */ } }arrow_forward
- PrimeAA.java Write a program that will tell a user if their number is prime or not. Your code will need to run in a loop (possibly many loops) so that the user can continue to check numbers. A prime is a number that is only divisible by itself and the number 1. This means your code should loop through each value between 1 and the number entered to see if it’s a divisor. If you only check for a small handful of numbers (such as 2, 3, and 5), you will lose most of the credit for this project. Include a try/catch to catch input mismatches and include a custom exception to catch negative values. If the user enters 0, the program should end. Not only will you tell the user if their number is prime or not, you must also print the divisors to the screen (if they exist) on the same line as shown below AND give a count of how many divisors there are. See examples below. Your program should run the test case exactly as it appears below, and should work on any other case in general. Output…arrow_forwardStatistics are often calculated with varying amounts of input data. Write a program that takes any number of non-negative integers as input, and outputs the average and max. A negative integer ends the input and is not included in the statistics. Ex: When the input is: 15 20 0 5 -1 the output is: 10 20 You can assume that at least one non-negative integer is input. import java.util.Scanner; public class LabProgram {public static void main(String[] args) {Scanner scnr = new Scanner(System.in);int numValue;int average;int max;int numValues;int numTotal;numTotal = 0;numValues = 0;max = 0;numValue = scnr.nextInt();while (numValue > 0){numTotal = numTotal + numValue;numValues = numValues + 1;numValue = scnr.nextInt();}average = numTotal / numValues;System.out.print(average);while (numValues > max){max = numValues;System.out.print(" " + max);} }} Why is it giving me the wrong output??arrow_forwardUsing Java, This program should print out first N powers of 2 starting from 2^1, until 2^N. The program first asks the user to enter the max power of 2, reads it using nextInt() and then uses the while loop to print out first n powers of 2. e.g. Enter the number of powers of two: 10 2^1 = 2 2^2 = 4 2^3 = 8 2^4 = 16 2^5 = 32 2^6 = 64 2^7 = 128 2^8 = 256 2^9 = 512 2^10 = 1024arrow_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