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
Concept explainers
Question
thumb_up100%
In a file called SkipMultiples.java, write a
- It asks the user to enter an integer called "low". It is OK if your program crashes when the user does not enter a valid integer here.
- It asks the user to enter an integer called "high". It is OK if your program crashes when the user does not enter a valid integer here.
- If low ≤ high, the program prints, in ascending order, all integers between low and high (including low and high), except for multiples of 4.
- If low > high, the program just prints "no numbers found" and exits.
For example, if the user enters 7 for low and 13 for high, your program output should look EXACTLY like this:
Enter low: 7 Enter high: 13 7 9 10 11 13 As another example, if the user enters 5 for low and 4 for high, your program output should look EXACTLY like this:Enter low: 5 Enter high: 4 no numbers found
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
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
- Using python, please explain 1: A positive integer greater than 1 is said to be prime if it has no divisors other than 1 and itself. A positive integer greater than 1 is composite if it is not prime. Write a program that asks the user to enter an integer greater than 1, then displays all of the prime numbers that are less than or equal to the number entered The program should work as follows: Once the user has entered a number, the program should populate a list with all of the integers from 2 up through the value entered. The program should then use a loop to step through the list. The loop should pass each element to a function that displays the element whether it is a prime number.arrow_forwardJAVA PPROGRAM Please Modify this program with further modifications as listed below: ALSO, take out and change the following in the program: System.out.println("Program terminated."); because the test case does not need it And change this in the program: Please enter the file name or type QUIT to exit:\n so it reperats once for every test case because it repeats twice in every case as shown in the screenshot. I only need it once. I have provided the failed the test cases and the inputs as a screenshot. The program must pass the test case when uploaded to Hypergrade. import java.io.*;import java.util.ArrayList;import java.util.Scanner;public class SymmetricalNameMatcher { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String fileName; do { // Prompt the user to enter a file name or 'QUIT' to exit. System.out.print("Please enter the file name or type QUIT to exit:\n"); fileName =…arrow_forwardIN C++. show CODE PLEASE.arrow_forward
- Can someone please help me with this project for my Java Programming class? If you could correct my mistakes for me that would be great.arrow_forwardWrite a program to score the paper-rock-scissor game. Each of two users types ineither P, R, or S. The program then announces the winner as well as the basis fordetermining the winner: Paper covers rock, Rock breaks scissors, Scissors cut paper,or Nobody wins. Be sure to allow the users to use lowercase as well as uppercaseletters. Your program should include a loop that lets the user play again until theuser says she or he is done. The program should perform input validation for theplayer’s input (only ‘R’, ‘P’ or ‘S’ are acceptable).Sample Run:Player 1: Please enter either R)ock, P)aper, or S)cissors.RPlayer 2: Please enter either R)ock, P)aper, or S)cissors.SPlayer 1 wins.Totals to this move:Player 1: 1Player 2: 0Play Again? Y/y continues, other quits. YPlayer 1: Please enter either R)ock, P)aper, or S)cissors.SPlayer 2: Please enter either R)ock, P)aper, or S)cissors.PPlayer 1 wins.Totals to this move:Player 1: 2Player 2: 0Play Again? Y/y continues, other quits. yThanksPlayer 1:…arrow_forwardIn Java Write a program to score the paper-rock-scissor game. Each of two users types ineither P, R, or S. The program then announces the winner as well as the basis fordetermining the winner: Paper covers rock, Rock breaks scissors, Scissors cut paper,or Nobody wins. Be sure to allow the users to use lowercase as well as uppercaseletters. Your program should include a loop that lets the user play again until theuser says she or he is done. The program should perform input validation for theplayer’s input (only ‘R’, ‘P’ or ‘S’ are acceptable).Sample Run:Player 1: Please enter either R)ock, P)aper, or S)cissors.RPlayer 2: Please enter either R)ock, P)aper, or S)cissors.SPlayer 1 wins.Totals to this move:Player 1: 1Player 2: 0Play Again? Y/y continues, other quits. YPlayer 1: Please enter either R)ock, P)aper, or S)cissors.SPlayer 2: Please enter either R)ock, P)aper, or S)cissors.PPlayer 1 wins.Totals to this move:Player 1: 2Player 2: 0Play Again? Y/y continues, other quits.…arrow_forward
- Write a program (use value returning method) that gives simple math quizzes. The program should display two random integers from 1 to 100 that are to be added,The program allows the user to enter the answer. If the answer is correct, display “congratulations”. If the answer is incorrect, the program should show the correct answer. using java programmingarrow_forwardIn Pythonarrow_forwardHow do I write a game program that throws a die (singular for dice) until a certain number appears a given number of times in a row? A random die number can be generated with the following code: int diceFaceNumber = (int)((Math.random() * 6) + 1). There are two versions of the output. The first traces the program as it throws the dice and the other version just prints the number of throws it took. The game should first prompt the client for a die face number he would like to appear in a row. Then the program prompts the client for the number of times he would like that die face number to appear that many times in a row. The game then throws the die until that die face number appears that many times in a row. The game reports the number of throws it took to get that die face number to appear the requested number of times in a row. Allow the client to repeat the game as many times as she wishes. There are several methods that I can use: one public method that is invoked from the main, a…arrow_forward
- In Java: Forms often allow a user to enter an integer. Write a program that takes in a string representing an integer as input, and outputs yes if every character is a digit 0-9. Ex: If the input is: 1995 the output is: yes Ex: If the input is: 42,000 or 1995! the output is: no Hint: Use a loop and the Character.isDigit() function.arrow_forwardJAVA Program ASAP Please modify this program with further modifications which are below so it passes the test cases in Hypergrade. I have provided the failed test cases. 1) For test cases 2 and 3 for the outputted numbers there needs to be commas and there needs to be nothing after that 2)for test case 1 outputted numbers there needs to be nothing after that, 3) for test 4 when file is not found there needs to be nothing after that 4) and for test case 5 and 7 afer a file is not found it needs to display Please re-enter the file name or type QUIT to exit: so you input the text file and displays the numbers. import java.io.BufferedReader;import java.io.FileReader;import java.io.IOException;import java.util.ArrayList;import java.util.Arrays;import java.util.InputMismatchException;import java.util.Scanner;public class FileSorting { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); while (true) { System.out.println("Please…arrow_forward
arrow_back_ios
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