subject

JAVA CHALLENGE ZYBOOKs ACTIVITY
2.18.3: Fixed range of random numbers.
Type two statements that use nextInt() to print 2 random integers between (and including) 100 and 149. End with a newline. Ex:
112 102
My Previous Incorrect Attempt :
import java. util. Scanner;
import java. util. Random;
public class RandomGenerateNumbers {
public static void main (String [] args) {
Random randGen = new Random();
int seedVal;
seedVal = 4;
randGen. setSeed(seedVal);
/* Your solution goes here */
int first = randGen. nextInt(10);
int second = randGen. nextInt(10);
System. out. println(first*seedVal*14);
System. out. println(second*seedVal*(51/4)+6); }
}
MUST BE USED CODE TEMPLATE:
import java. util. Scanner;
import java. util. Random;
public class RandomGenerateNumbers {
public static void main (String [] args) {
Random randGen = new Random();
int seedVal;
seedVal = 4;
randGen. setSeed(seedVal);
/* Your solution goes here */
}
}

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 18:00, Geo777
Suppose an astronomer discovers a large, spherical-shaped body orbiting the sun. the body is composed mostly of rock, and there are no other bodies sharing its orbit. what is the best way to categorize this body? a. planet b. moon c. comet d. asteroid
Answers: 1
image
Computers and Technology, 22.06.2019 20:00, bartlettcs9817
Which location-sharing service offers items for users as a gaming component and also allows them to collectively link their check-ins to publish a trip? a. whrrl b. buzzd c. foursquare (this option is wrong i already tried) d. gowalla for plato
Answers: 2
image
Computers and Technology, 22.06.2019 23:30, kenken2583
Jaina and tomas are being considered as new tenants in an apartment. the landlord looks at their creditworthiness because he wants to be sure his new tenant pays the rent on time and in full. the table below summarizes the information that was on their applications. application information questions jaina tomas how many years have you had your job? 5 2 what is your monthly salary? $1,850 $2,500 how many credit cards do you have? 4 1 how much debt do you have? $13,000 $7,000 how many times were you late with payments on credit cards in the past year? 5 1 who will the landlord decide to be more creditworthy and why? tomas because the ratio of his debt to income is less. jaina because she has had her job longer, which makes her look more stable. jaina because she has more credit cards available to her. tomas because he makes more money per month.
Answers: 2
image
Computers and Technology, 23.06.2019 06:00, hilarydodard7099
Which statistical function in a spreadsheet you to see how far each number varies, on average, from the average value of the list?
Answers: 2
You know the right answer?
JAVA CHALLENGE ZYBOOKs ACTIVITY
2.18.3: Fixed range of random numbers.
Type two stateme...

Questions in other subjects:

Konu
Mathematics, 27.02.2021 09:50
Konu
Mathematics, 27.02.2021 09:50