Question: Q1) (4 Marks) Create a Java program that finds and prints the square of each number from 4 to 9 except 7 Q2) (6 Marks)
Q1) (4 Marks) Create a Java program that finds and prints the square of each number from 4 to 9 except 7 Q2) (6 Marks) Create a Java program that generates a random number between 1 to 10 Then ask the user to guess the random number, if the user can guess it then print "you win" if not print "try again". Let the user try again 5 times. If after 5 times still not guessing the random number then print "sorry you lose Q3) (5 Marks) Create a Java program to ask the user to enter a number and then if it's not dividable on 3, print "No" and ask the user to enter another number and check again, and keep repeating until the user enters a number that is dividable on 3 then print "yes" and stop repeating Q4) (5 Marks) Create a Java program to let the user enter 10 numbers and put them in an array then find the total of all even numbers and print it, and find the average of all odd numbers and print it Q5) (5 Marks) Create a Java program that asks the user to enter a number and then if the number is less than 6 find its factorial, but if it's 6+ then find the total of numbers from 1 to that number Q6(5 Marks) Create a Java program to ask the user to enter a number and find and print its code upon the codes here: No 0 1 2 2 4 5 6 7 8 9 3 B Code A R T G H F K M For example, if the number is 249 then the code is TCM If the number is 8015 then the code is KARG
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
