Rock, Paper, Scissors Game ROCK PAPER SCISSOR Write a program that lets the user play the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Rock, Paper, Scissors Game ROCK PAPER SCISSOR Write a program that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows. a. When the program begins, a random number in the range of 1 through 3 is generated. If the number is 1, then the computer has chosen rock. If the number is 2, then the computer has chosen paper. If the number is 3, then the computer has chosen scissors. (Don't display the computer's choice yet.) b. The user enters his or her choice of "rock", "paper", or "scissors" at the keyboard. (You can use a menu if you prefer.) c. The computer's choice is displayed. d. A winner is selected according to the following rules: • If one player chooses rock and the other player chooses scissors, then rock wins. (The rock smashes the scissors.) • If one player chooses scissors and the other player chooses paper, then scissors wins. (Scissors cuts paper.) If one player chooses paper and the other player chooses rock, then paper wins. (Paper wraps rock.) • If both players make the same choice, the game must be played again to determine the winner. • Be sure to divide the program into methods that perform each major task. At least, Be sure to divide the program into methods that perform each major task. At least, you should have a method except main method. Sample Results: (You can have your own style) a. Enter your choice ROCK-1, PAPER-2, SCISSORS-3 3 The computer choice is Rock. Your choice is Scissors. The computer win! Rock smashes the scissors. b. The computer win! Rock smashes the scissors. The grading consists of three parts: 1) (10%) Design the algorithm, which must include the following: a. Write the pseudo code algorithm to solve the problem in Word document. 2) (60%) Java code a. YOU MUST GIVE YOUR CLASS a meaningful name. b. YOU MUST COMMENT YOUR CODE. (Date, Title, Your Name, and important code explanations such as declare variables, user input, calculation, display results, etc.) c. You should give meaningful variable names. d. Output should display with correct results 3)(30%) Testing a. Create your three testing plans. b. And screen capture of your three test results and attach them into Word document. 2. Present Value (30 points) Suppose you want to deposit a certain amount of money into a savings account, and then leave it alone to draw interest for the next 10 years. At the end of 10 years, you would like to have $10,000 in the account. How much do you need to deposit today to make that happen? You can use the following formula, which is known as the present value formula, to find out: P= F (1+r)" P is the present value, or the amount that you need to deposit today. F is the future value that you want in the account. (In this case, F is $10,000.) r is the annual interest rate. n is the number of years that you plan to let the money sit in the account. Write a method named presentValue that performs this calculation. The method should accept the future value, annual interest rate, and number of years as arguments. It should return the present value, which is the amount that you need to deposit today. Demonstrate the method in a program that lets the user experiment with different values for the formula's terms. The grading consists of three parts: 1) (10%) Design the algorithm, which must include the following: b. Write the pseudo code algorithm to solve the problem in Word document. 2) (60%) Java code e. YOU MUST GIVE YOUR CLASS a meaningful name. f. YOU MUST COMMENT YOUR CODE. (Date, Title, Your Name, and important code explanations such as declare variables, user input, calculation, display results, etc.) g. You should give meaningful variable names. h. Output should display with correct calculation. 3) (30%) Testing c. Create your three testing plans. d. And screen capture of your three test results and attach them into Word document. Rock, Paper, Scissors Game ROCK PAPER SCISSOR Write a program that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows. a. When the program begins, a random number in the range of 1 through 3 is generated. If the number is 1, then the computer has chosen rock. If the number is 2, then the computer has chosen paper. If the number is 3, then the computer has chosen scissors. (Don't display the computer's choice yet.) b. The user enters his or her choice of "rock", "paper", or "scissors" at the keyboard. (You can use a menu if you prefer.) c. The computer's choice is displayed. d. A winner is selected according to the following rules: • If one player chooses rock and the other player chooses scissors, then rock wins. (The rock smashes the scissors.) • If one player chooses scissors and the other player chooses paper, then scissors wins. (Scissors cuts paper.) If one player chooses paper and the other player chooses rock, then paper wins. (Paper wraps rock.) • If both players make the same choice, the game must be played again to determine the winner. • Be sure to divide the program into methods that perform each major task. At least, Be sure to divide the program into methods that perform each major task. At least, you should have a method except main method. Sample Results: (You can have your own style) a. Enter your choice ROCK-1, PAPER-2, SCISSORS-3 3 The computer choice is Rock. Your choice is Scissors. The computer win! Rock smashes the scissors. b. The computer win! Rock smashes the scissors. The grading consists of three parts: 1) (10%) Design the algorithm, which must include the following: a. Write the pseudo code algorithm to solve the problem in Word document. 2) (60%) Java code a. YOU MUST GIVE YOUR CLASS a meaningful name. b. YOU MUST COMMENT YOUR CODE. (Date, Title, Your Name, and important code explanations such as declare variables, user input, calculation, display results, etc.) c. You should give meaningful variable names. d. Output should display with correct results 3)(30%) Testing a. Create your three testing plans. b. And screen capture of your three test results and attach them into Word document. 2. Present Value (30 points) Suppose you want to deposit a certain amount of money into a savings account, and then leave it alone to draw interest for the next 10 years. At the end of 10 years, you would like to have $10,000 in the account. How much do you need to deposit today to make that happen? You can use the following formula, which is known as the present value formula, to find out: P= F (1+r)" P is the present value, or the amount that you need to deposit today. F is the future value that you want in the account. (In this case, F is $10,000.) r is the annual interest rate. n is the number of years that you plan to let the money sit in the account. Write a method named presentValue that performs this calculation. The method should accept the future value, annual interest rate, and number of years as arguments. It should return the present value, which is the amount that you need to deposit today. Demonstrate the method in a program that lets the user experiment with different values for the formula's terms. The grading consists of three parts: 1) (10%) Design the algorithm, which must include the following: b. Write the pseudo code algorithm to solve the problem in Word document. 2) (60%) Java code e. YOU MUST GIVE YOUR CLASS a meaningful name. f. YOU MUST COMMENT YOUR CODE. (Date, Title, Your Name, and important code explanations such as declare variables, user input, calculation, display results, etc.) g. You should give meaningful variable names. h. Output should display with correct calculation. 3) (30%) Testing c. Create your three testing plans. d. And screen capture of your three test results and attach them into Word document.
Expert Answer:
Related Book For
Quantitative Methods for Business
ISBN: 978-0840062345
12th edition
Authors: David Anderson, Dennis Sweeney, Thomas Williams, Jeffrey Cam
Posted Date:
Students also viewed these programming questions
-
Cash Receipt Schemes and Other Asset Misappropriations, identify and describe two big data and data analytic techniques each for detecting skimming, cash larceny, and noncash misappropriations.
-
2. Consider a 3-year American call option on a stock which pays dividends in 1 year and 2 years. The first dividend is $5 and the second dividend is $6. The current stock price is $100, the exercise...
-
What are the advantages for the HRM department if its head is on the main board? How might cultural influences noted in previous chapters affect that?
-
Determine the magnitude and direction of the force F = (400 N) i (1200 N) j + (300 N) k.
-
19. In which pathology is the synthesis of complement proteins reduceddue to low supply of amino acids? A) Autoimmune disorders B) Liver failure C) Malnutrition D) Alzheimer's disease 20. What causes...
-
Discuss why employment disclaimers are important to the employer.
-
Compute key ratios and other financial measures for Crazy Eddie during the period 19841987. Identify and briefly explain the red flags in Crazy Eddies financial statements that suggested the firm...
-
Domino Company uses the aging of accounts receivable method to estimate uncollectible accounts expense. Domino began Year 2 with balances in Accounts Receivable and Allowance for Doubtful Accounts of...
-
Situation Russell International, a publicly traded company, reacquired 500,000 shares of its common stock during July 2008 at a cost of $25 per share. The current market price of the stock was $20...
-
Review and explain the "COE Sample Educational Administration Field Experience/Internship Activities" to identify activities. What was the outcome observed and participate in with a principal mentor?...
-
What is the nature of the 21 st century crisis in labor law?
-
How is credit restored following bankruptcy?
-
If the IMF forecast turns out to be correct, what would most likely happen to the output gap and unemployment in 2021? The IMF projected a global growth rate of 6% in 2021, the highest rate since the...
-
Explain how the FOMC determines whether to raise or lower its federal funds rate target. Why doesnt the FOMC respond symmetrically to inflation and unemployment risks?
-
Topco Associates, Inc., is a cooperative association of small and medium-sized regional supermarket chains. Each of its member chains operates independently. All members are required to operate under...
-
For each of the following scenarios, depict graphically the impact it has on the equilibrium quantity and price in the market for rational murder and, in a separate graph, in the market for...
-
Rosalie owns 50% of the outstanding stock of Salmon Corporation. In a qualifying stock redemption, Salmon distributes $80,000 to Rosalie in exchange for one-half of her shares, which have a basis of...
-
The distribution system for the Herman Company consists of three plants, two warehouses, and four customers. Plant capacities and shipping costs per unit (in $) from each plant to each warehouse are...
-
Consider the following time series data: a. Construct a time series plot. What type of pattern exists in the data? b. Develop a three-week moving average for this time series. Compute MSE and a...
-
Alexander Industries is considering purchasing an insurance policy for its new office building in St. Louis, Missouri. The policy has an annual cost of $10,000. If Alexander Industries doesn't...
-
Test for misspecification using RESET.
-
a. Show that the mean-squared forecast error \(E\left[\left(\hat{y}_{T+1}-y_{T+1} ight)^{2} \mid I_{T} ight]\) for a forecast \(\hat{y}_{T+1}\), that depends only on past information \(I_{T}\), can...
-
Consider the AR(1) model \(y_{t}=\delta+\theta y_{t-1}+e_{t}\) where \(|\theta|)=0\) and \(\operatorname{var}\left(e_{t} \mid I_{t-1} ight)=\sigma^{2}\). Let \(\bar{y}_{-1}=\sum_{t=2}^{T} y_{t}...
Study smarter with the SolutionInn App