This preview shows page 1. Sign up to view the full content.
Unformatted text preview: Computer Question 3: Write a program that generates a random integer in the range of 1 to 100 and asks the user to guess the number. You program should keep asking the user for guesses until it is correct. For each incorrect guess, you program should hint if the guess is larger or smaller than the random number you generated. Computer Question 4: Write a function called myISPRIME . Your function should take one input argument and mirror the functionality of the built-in isprime functionreturn 1 if the input number is prime, and 0 otherwise. Hint: a prime number is divisible only by 1 and itself. Loop through all of the numbers in between 1 and itself and use the rem function to see if you find any numbers that divide the input evenly. You may not use primes, isprime , or similar functions as part of your solution....
View Full Document
This note was uploaded on 02/29/2012 for the course 440 127 taught by Professor Blase during the Fall '09 term at Rutgers.
- Fall '09