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
I need a flowchart for this
* RockNRollah.java
* Write an application to simulate the rolling of two dice.
* The application should use an object of class Random once
* to roll the first die and again to roll the second die.
* The sum of the two values should then be calculated.
* Each die can show an integer value from 1 to 6, so the sum of the values will vary from 2 to 12,
* with 7 being the most frequent sum, and 2 and 12 the least frequent.
* Your application should roll the dice 36,000,000 times.
* Use a one-dimensional array to tally the number of times each possible sum appears.
* Display the results in tabular format.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 3 steps with 1 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
- 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_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 java, create a program that will use a do while loop with a "yes/no" prompt. The program should include user input and output with getters and setters. Once the end of the loop is reached, ask the user if they'd like to do the program again. Answering "Yes" will start the program over again. Answering "No" will end the program. Answering with anything else will be an invalid input. Once the loop begins again, the program should also discard all previous inputs so that there won't be any overlapping. Use Scanner.nextLine();, it will help.arrow_forward
- In C# code: Write a program that will help an elementary schoolstudent learn multiplication. Use a Random object to produce two positive one-digitintegers. The program should then prompt the user with a question, such asHow much is 6 times 7 The student then inputs the answer. Next, the program checks the student’s answer. Ifit’s correct, display the message "Very good!" and ask another multiplication question.If the answer is wrong, display the message "No. Please try again." and let the studenttry the same question repeatedly until the student gets it right. A separate methodshould be used to generate each new question. This method should be called oncewhen the app begins execution and each time the user answers the question correctly.Program will stop any time students enter -1. One problem in CAI environments is student fatigue. This can be reduced by varyingthe computer’s responses to hold the student’s attention. The program should usevarious comments to be displayed for each…arrow_forwardWhile Loop (PLEASE COMPLETE IN JAVA)Instructions Write a program that finds out the perimeter of a multi-sided shape. Perimeter of a multi-sided shape can be found by adding all of the sides together.The user should enter each number at the command prompt. The user will indicate that he or she isfinished entering the number by entering the number -1.Example:This program will sum a series of numbers.Enter the next number (enter -1 when finished)> 2Enter the next number (enter -1 when finished)> 2Enter the next number (enter -1 when finished)> 1Enter the next number (enter -1 when finished)> 1Enter the next number (enter -1 when finished)> -1The sum of your numbers is 6arrow_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
- this is a java exercisearrow_forwardJAVA Write a program that plays a number-guessing game to guess a secret number randomly generated within the range 1 and 10. The user will get as many numbers of tries as he/she needs to guess the number. Tell the users if their guess is right or wrong and if their guess is wrong let them try to guess the number again. You have solved a similar problem in a previous lab using a while loop. You must generate the secret number using the Java Random class. When the user guesses a number he/she will have to take an input of his guessed number from the keyboard. The user will have to take as many inputs as needed to guess the correct secret-number. That means the code will keep looping as long as the guess is different from the secret number. You also need to count the number of tries and report the count at the end. Use a do-while loop to prompt the user to guess again if the guess is wrong. Make sure that it doesn't mess up the output if you guess the secret number on the first try.…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