Hello, I am using the Intro to Java programmming and data structures by Y. Daniel Liang. Our professor wants us to generate a random number in java between 1 and 100. Then prompt the user for a number between 1 and 4. Next, the program will determine if the number entered by the user is a factor of the random number. I feel like I have some parts of the code down pack but not all of it. Thus far I have: import java.util.Scanner;public class Module_Project3 { public static void main(String[] args) {Scanner input = new Scanner(System.in);int num1 = (int)(Math.random()*100+1);int num2 = (int)(Math.random()*100+1);int num3 = (int)(Math.random()*100+1);int num4 = (int)(Math.random()*100+1);
Hello, I am using the Intro to Java programmming and data structures by Y. Daniel Liang.
Our professor wants us to generate a random number in java between 1 and 100. Then prompt the user for a number between 1 and 4. Next, the
I feel like I have some parts of the code down pack but not all of it. Thus far I have:
import java.util.Scanner;
public class Module_Project3
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
int num1 = (int)(Math.random()*100+1);
int num2 = (int)(Math.random()*100+1);
int num3 = (int)(Math.random()*100+1);
int num4 = (int)(Math.random()*100+1);

Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 5 images









