Refactor Navigate Search Project Window Help Eclipse File Edit Source Fri Oct 4 10:53:23 PM Run 35% eclipse-workspace - Project1-FirstDay/TryAgain.java - Eclipse IDE Quick Acces 010 Ра X Lab.java Tianna.java Chapter3ProjectTake1.java *TryAgain.java 4 import java.util.Random; 5 import java.util.Scanner; 6 public class TryAgain Chapter_3 Chapter2 JRE System I private static final int remainder 8 0; = 9 EI resources public static void main(String[] args) { 10e 11 19 rt.jar - /Lil jsse.jar - 12 jce.jar /L I9charsets.j 13 = new Scanner(System.in); = new Random(); Scanner input Random rnd 14 15 16 jfr.jar - /Li sunec.jar O10 rnd.nextInt 101) int x = { System.out.print("Please enter a number between 1 and 4: "); } int y 17 nashorn.ja 18 010 cldrdata.ja 19 jfxrt.jar 20 Eו input.nextInt ( ) ;. 21 dnsns.jar O10 22 010 localedata int remainder 23 у % х; sunjce_pr 24 sunpkcs1 if (remainder { System.out.print("The number 0) O10 o25 26 jaccess.ja O10 y " is a factor of х); 27 + zipfs.jar O10 28 MRJToolk else 29 Chpt3_Quiz_Tiai { System.out.print("The number } 30 JRE System l х)%; y " is not a factor of 31 (default pack 32 33 J Lab.java 34 idk Project1-First D ConsoleX JRE System terminated> TryAgain [Java Application] /Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/bin/java (Oct 4, 2019, 10:42:21 PM) (default pack Please enter a number between 1 and 4: 2 Tianna.jav The number 2 is not a factor of 90 TryAgain.j Writable Smart Insert 21 41 WP 5 27 2 3.141593 ОСТ W P 9 CD LO

Question

I am trying to write a java code to see if the number entered by the user is a factor of the random number generated from the import java.util.Random. When I run it it keeps saying the number entered by the user is not a factor of the random number. 

 

Another thing is the output is suppose to look like this... The value <number entered by user> is a / not a factor of <random number>

how would I fix what i have to look like that?

Refactor Navigate
Search Project
Window Help
Eclipse
File
Edit Source
Fri Oct 4 10:53:23 PM
Run
35%
eclipse-workspace - Project1-FirstDay/TryAgain.java - Eclipse IDE
Quick Acces
010
Ра X
Lab.java
Tianna.java
Chapter3ProjectTake1.java
*TryAgain.java
4 import java.util.Random;
5 import java.util.Scanner;
6 public class TryAgain
Chapter_3
Chapter2
JRE System I
private static final int remainder
8
0;
=
9
EI resources
public static void main(String[] args)
{
10e
11
19 rt.jar - /Lil
jsse.jar -
12
jce.jar /L
I9charsets.j
13
= new Scanner(System.in);
= new Random();
Scanner input
Random rnd
14
15
16
jfr.jar - /Li
sunec.jar
O10
rnd.nextInt 101)
int x =
{
System.out.print("Please enter a number between 1 and 4: ");
}
int y
17
nashorn.ja
18
010 cldrdata.ja
19
jfxrt.jar
20
Eו
input.nextInt ( ) ;.
21
dnsns.jar
O10
22
010 localedata
int remainder
23
у % х;
sunjce_pr
24
sunpkcs1
if (remainder
{
System.out.print("The number
0)
O10
o25
26
jaccess.ja
O10
y " is a factor of
х);
27
+
zipfs.jar
O10
28
MRJToolk
else
29
Chpt3_Quiz_Tiai
{
System.out.print("The number
}
30
JRE System l
х)%;
y " is not a factor of
31
(default pack
32
33
J Lab.java
34
idk
Project1-First D
ConsoleX
JRE System terminated> TryAgain [Java Application] /Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/bin/java (Oct 4, 2019, 10:42:21 PM)
(default pack Please enter a number between 1 and 4: 2
Tianna.jav The number 2 is not a factor of 90
TryAgain.j
Writable
Smart Insert
21 41
WP
5
27
2
3.141593
ОСТ
W
P
9
CD
LO

Image Transcription

Refactor Navigate Search Project Window Help Eclipse File Edit Source Fri Oct 4 10:53:23 PM Run 35% eclipse-workspace - Project1-FirstDay/TryAgain.java - Eclipse IDE Quick Acces 010 Ра X Lab.java Tianna.java Chapter3ProjectTake1.java *TryAgain.java 4 import java.util.Random; 5 import java.util.Scanner; 6 public class TryAgain Chapter_3 Chapter2 JRE System I private static final int remainder 8 0; = 9 EI resources public static void main(String[] args) { 10e 11 19 rt.jar - /Lil jsse.jar - 12 jce.jar /L I9charsets.j 13 = new Scanner(System.in); = new Random(); Scanner input Random rnd 14 15 16 jfr.jar - /Li sunec.jar O10 rnd.nextInt 101) int x = { System.out.print("Please enter a number between 1 and 4: "); } int y 17 nashorn.ja 18 010 cldrdata.ja 19 jfxrt.jar 20 Eו input.nextInt ( ) ;. 21 dnsns.jar O10 22 010 localedata int remainder 23 у % х; sunjce_pr 24 sunpkcs1 if (remainder { System.out.print("The number 0) O10 o25 26 jaccess.ja O10 y " is a factor of х); 27 + zipfs.jar O10 28 MRJToolk else 29 Chpt3_Quiz_Tiai { System.out.print("The number } 30 JRE System l х)%; y " is not a factor of 31 (default pack 32 33 J Lab.java 34 idk Project1-First D ConsoleX JRE System terminated> TryAgain [Java Application] /Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/bin/java (Oct 4, 2019, 10:42:21 PM) (default pack Please enter a number between 1 and 4: 2 Tianna.jav The number 2 is not a factor of 90 TryAgain.j Writable Smart Insert 21 41 WP 5 27 2 3.141593 ОСТ W P 9 CD LO

Expert Answer

1 Rating

Want to see the step-by-step answer?

See Answer

Check out a sample Q&A here.

Want to see this answer and more?

Experts are waiting 24/7 to provide step-by-step solutions in as fast as 30 minutes!*

See Answer
*Response times vary by subject and question complexity. Median response time is 34 minutes and may be longer for new subjects.

Related Computer Science Q&A

Find answers to questions asked by student like you
Show more Q&A

Q: What are the implications of crypto currency to the international banking system?

A: A cryptocurrency is a kind of digital asset which is designed  to work as medium of exchange that us...

Q: I need help answering the following quetions I am not good with code. 1. Describe how you use TCP Du...

A: Use the keyword tcpdump with the TCP Dump flag –D.The flag –D will list all the interfaces that are ...

Q: I have to combine output variables in C++. My line of code: #include &lt;iostream&gt;using namespace...

A: Program://include the header file#include &lt;iostream&gt;using namespace std;//definition of main m...

Q: Hello good afternoon, This is my first time using Bartleby, I am super slow in computer science and ...

A: Program instructions:Declare necessary variables.Open the file with the score and total points and r...

Q: Who is Alan Turnig ?

A: Alan Turing was born in the year 1912 and died in the year 1954. He was a mathematician, computer sc...

Q: What are the Windows 2016 "flavors"?

A: Windows Server 2016 comes in 3 flavors, which are, Server Core (no GUI), Server with Desktop Experie...

Q: Show that xz = (x + y)(x + ~y)(~x + z) Using Truth Tables Using Boolean identities

A: 1.Answer: xz = (x + y) (x + ~y) (~x + z)LHS = xzRHS = (x + y) (x + ~y) (~x + z)1. Truth Table: 

Q: Develop the ‘Shape’ application such that: Implement an array of objects of various types (all SIX ...

A: Program plan:Define a class called “ShapeTest”.Define a “main()” method.Create an array of six shape...

Q: In C++ Create a function called Factorial. It should use a for loop to find the factorial of any inp...

A: Program code in C++ to create a function called factorial,  it uses a for loop to find the factorial...