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
Collaboratively, or solo, write a ROCK, PAPER, SCISSORS game. The program should use a LOOP to ensure that the user enters acceptable data. A DECISION should be made in the program. A rubric is attached. Submit the .RAP file
Some hints about RPS game:
A user could enter 1,2,3 or R,P,or S (ensure data integrity with a loop)
The computer could pick a random number between 1 and 3 to simulate picking R, P, or S
Decision structure would be used to determine the winner based on:
- Rock smashes Scissors (Rock wins)
- Scissors cut Paper (Scissors win)
- Paper covers Rock (Paper wins)
- matches tie
Run and test the program. There should be nine different possible combinations (3 ties, 3 computers wins, 3 user wins)
Use raptor please, thank you.
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 4 steps with 2 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
- Pythonarrow_forwardPlease match each of these to its best answer. Answers may be used more than once. Question Selected Match Which can use a sentinel? D. for loop Which will always execute at least once? A. while loop Which would you use if you know you're going to ask the user for 100 values? F. do-while loop Which is/are considered pretest? B. while loop and for loop Which is count-controlled? C. for loop and do-while loop Which might not execute even once? E. while loop and do-while loop Which is/are considered posttest? F. do-while looparrow_forwardWhen creating a nested loop, you would want to push the outer loop counter before entering the inner loop. True Falsearrow_forward
- The Apgar Medical group keeps a patient file for each doctor in the office. Each record contains the patient's first and last name, home address, and birth year. The records are sorted in ascending birth year order. Write a program so that display a count of the number of patients born each year John Hanson, 23 Elm, 1927Mary Locust, 476 Maple, 1950Susan Monroe, 512 Peachtree, 1957Carol Fortune, 2819 Locust, 1960James Fortune, 2819 Locust, 1963Lawrence Fish, 12 Elm, 1968Janice Weiss, 234 Birch, 1971Henry Garza, 199 Second, 1973Kimberly Swanson, 310 Appletree, 1980Louis Claude, 2716 Third, 1981Jill Fox, 12 Oak, 1985Opal Reynolds, 78 County Line, 1987Francis Dumas, 67 Fourth, 1992Madison Conroy, 23 Fifth, 1996Daniel Moy, 100 Sunset, 1987arrow_forwardQUESTION 26 Write code that uses a while loop to display the powers of 2 exactly as shown below: 1248163264128arrow_forwardLoop: Ask the user how many students to process. Then, for each student, use the code you have already written to ask for two names and two grades and print out a neatly formatted record. Hint: what kind of a loop will you use? Why? Letter grade: If a student's average grade is equal to or above 18, they should get an A. Print that out. If it's >= 16 and < 18 they should get a B. If it's >= 14 and < 16 they should get a C If it's >= 12 and < 14 they should get a D if it's < 12 they should get an F Hint: can you use a switch statement to do this? Why or why not? Average score over all students: Keep a running tally of the total score, and a count of how many students. At the very end, print out a single line that says Average score for XX students is YY (where XX and YY are values you calculate). Hint: what type should the average score be?arrow_forward
- Using a Counter-Controlled whileLoop Summary In this lab, you use a counter-controlled while loop in a Java program provided for you. When completed, the program should print the numbers 0 through 10, along with their values multiplied by 2 and by 10. The data file contains the necessary variable declarations and some output statements. Instructions Ensure the file named Multiply.java is open. Write a counter-controlled while loop that uses the loop control variable to take on the values 0 through 10. Remember to initialize the loop control variable before the program enters the loop. In the body of the loop, multiply the value of the loop control variable by 2 and by 10. Remember to change the value of the loop control variable in the body of the loop. Execute the program by clicking Run. Record the output of this program.arrow_forwardEven though the EXIT clause can be used in any type of loop, it is considered good form to use the EXIT clause only in basic loops. Answers: Yes Noarrow_forwardWhat does the following python code do? f = open("sample.txt", "a") Choose all that apply. Select 3 correct answer(s) Question 15 options: opens a file called sample.txt for reading reads the file called sample.txt starting from the top writes "a" to the file called sample.txt opens a file called sample.txt for appending If the file called sample.txt exists, it writes at the bottom of the file closes a file called sample.txt if the file sample.txt exists, deletes everything in it if the file sample.txt does not exist, it creates the file and opens it for writingarrow_forward
- Chapter 4 Loops and Files 17. Random Number Guessing Game Write a program that generates a random number and asks the user to guess what the num- ber is. If the user's guess is higher than the random number, the program should display "Too high, try again." If the user's guess is lower than the random number, the program should display "Too low, try again." The program should use a loop that repeats until the user cor rectly guesses the random number.arrow_forwardWhat are the constituent elements of the Pretest loop?arrow_forwardPython programming help I need help of question 1 to read a file from persons.txt Write a program that takes a person’s details (name, age and a city), and writes to a file (persons.txt) using a loop repeatedly. You should write three person’s to the file. The program terminates on entering any key by the user, except on (Y or y) key. Sample output of the first run of the program is shown below: Enter name: JohnEnter age: 20Enter city: SydneyData saved: John 20 SydneyPress (Y or y) to add another person, or any key to exit Question 1) Write a program that read a file (persons.txt) from previous question given on the top of this question, and shows all the records/lines from the file as a nicely formatted report with a header as shown: Name Age City +---------------------+--------------------+--------------arrow_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