4-3 Assignment-Pseudocode Revisited PDF

Title 4-3 Assignment-Pseudocode Revisited
Course Introduction to Scripting
Institution Southern New Hampshire University
Pages 2
File Size 59.9 KB
File Type PDF
Total Downloads 7
Total Views 131

Summary

This is the assignment for 4-3-Pseudocode Revisited...


Description

4-3 Assignment: Pseudocode Revisited 1.These will be the steps needed for writing pseudocode for a higher/lower program that includes input and output, decision branching, and a loop. Using pseudocode, writes the different steps needed in a higher/lower program. The pseudocode should prompt the user to input the lower bound and upper bounds that would generate a random number between the lower and upper bounds. Prompt the user to input a guess between the lower and upper bounds. Print an output statement based on the guessed number. Create a loop so that the program continues to prompt the user for a new input until the user guess the random number generated by the program. The next answer would be the simplest way I could think of putting for a computer to understand. 2. Create pseudocode that logically outlines each step of the game program so that it meets the following functionality: Pseudocode for Higher/Lower Game START IMPORT random function, so that a random number can be generated by the program READ random.seed variable INPUT prompt user for an integer value for seedVal in order to ‘seed’ the random number generator INPUT integer for lower and upper bounds variables READ lower, upper IF lower bound is higher than the upper bound THEN: INPUT variable integers again ELSE assign correct_num variable READ correct_num variable as the random number generated between ranges of the upper and lower bound While TRUE guess loop INPUT prompt user to guess an integer OUTPUT ‘What is your guess?’ READ user_guess variable IF user_guess is lower than correct_num

THEN OUTPUT ‘Nope, too low.’ IF user_guess is higher than correct_num THEN OUTPUT ‘Nope, too high.’ IF user_guess is equal to correct_num THEN OUTPUT ‘You got it!’ END...


Similar Free PDFs