On java, and easy simple

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

On java, and easy simple

Post by answerhappygod »

On java, and easy simple
On Java And Easy Simple 1
On Java And Easy Simple 1 (37.56 KiB) Viewed 34 times
Design of Rock-Paper-Scissors Play game start start Print instructions Read and validate user choice Generate computer's choice Play game Determine winner Ask user If(s)he wants to play again Print winner Y N Play again? Print stats: wins, losses and ties end Update stats end

Read and validate user choice Generate computer choice start start Prompt user to enter choice Read user choice from keyboard Generate a random number between and 2. where 0 corresponds to ROCK, 1 corresponds to PAPER, and 2 corresponds to SCISSORS. N Y User choice is rock, paper or scissors? end end

Determine winner Update stats start start User choice is same as computer choice? User choice is ROCK and computer choice is SCISSORS OR User choice is ŞCISSORS and computer choice is PAPER N OR User choice is PAPER and computer choice is ROCK Result is tie? Result is win for user? N Y N Result is tie Result is: win for user Result is: loss for user ties++ wins++ losses++ end end

Methods (subtasks) Methods (continued) Needs Returns . printinstructions None None Print instructions Play game - readAndValidateUserChoice -generateComputerChoice - determine Winner - updateStats readAndValidateUserChoice None Validated user choice generate Comp Choice None Computer choice determine Winner Result of game User choice and computer choice Result of game updateStats None (updates wins/losses/ties)

Methods (updated) Needs Retums getinstructions None String readAndValidateUserChoice None Validated user choice generate CompChoice None Computer choice determine Winner User choice Result of game and computer choice Current stats, Updated stats result of game (wins/losses/ties) updateStats
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply