Visual Basic Random Numbers

greelm
timer Asked: Mar 3rd, 2018

Question Description

Visual Basic: Your application will first generate a random integer between 1 and 100 but it will not be displayed. The user will input a number between 1 and 100 using an input box and it will be compared to the random number. If it is too high, display the message “Too high, try again.” If it’s too low, display “Too low, try again.” The program should use a loop to repeat until the user guesses the random number. Your code should also validate the value input (is it a number and is it in the correct range – if it isn’t repeat without counting that attempt in the total guesses).

I don't understand VB enough to do this assignment.


Unformatted Attachment Preview

MIS 3362 – Programming With Visual Basic Homework 3 This is an individual assignment and must be completed by each student. Group work is not permitted. In this assignment you will create a random number guessing game. Your application will first generate a random integer between 1 and 100 but it will not be displayed. The user will input a number between 1 and 100 using an input box and it will be compared to the random number. If it is too high, display the message “Too high, try again.” If it’s too low, display “Too low, try again.” The program should use a loop to repeat until the user guesses the random number. Your code should also validate the value input (is it a number and is it in the correct range – if it isn’t repeat without counting that attempt in the total guesses). Your program should also keep track of the number of times the user guesses and display that as well. It should be in a message like “You guessed the number in 8 tries.” When the user clicks “OK” after guessing the correct number, they should be able to play again if they want to. Or they can exit. But they should be able to play as many times as they want. As always, you should solve the problem before you start writing code. Make sure to follow all the conventions of good programming we have talked about. TIP: use a seed value when you create the random integer so you will know what the generated number is and you can test your code. Example:
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

This question has not been answered.

Create a free account to get help with this and any other question!

Similar Content

Related Tags

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors