1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Margarita [4]
3 years ago
10

JAVA CHALLENGE ZYBOOKs

Computers and Technology
1 answer:
exis [7]3 years ago
5 0

Answer:

Replace  /* Your solution goes here */ with:

<em>System.out.println(randGen.nextInt(49) + 100);</em>

<em>System.out.println(randGen.nextInt(49) + 100);</em>

<em />

Explanation:

Required

Statements to print two random numbers between 100 and 149 (both inclusive)

First, the random numbers must be generated. From the template given, the random object, randGen, has been created.

The syntax to then follow to generate between the interval is:

<em>randGen.nextInt(high-low) + low;</em>

Where:

high = 149 and low = 100

So, the statement becomes:

<em>randGen.nextInt(149 - 100) + 100;</em>

<em>randGen.nextInt(49) + 100;</em>

<em />

Lastly, print the statements:

<em>System.out.println(randGen.nextInt(49) + 100);</em>

<em>System.out.println(randGen.nextInt(49) + 100);</em>

<em />

You might be interested in
Write a function called committee to compute the number of ways of forming a single committee with r members from a collection o
andrezito [222]

Answer:

This program is written in C++.  The explanation of the code is given below in the explanation section.

Explanation:

#include <iostream>

using namespace std;

//factorial calculation

int fact(int n) {

  if (n == 0 || n == 1)

     return 1;

  else

     return n * fact(n - 1);

}

int main() {

  int n, r, comb; /* n represent number of people (population), r represent the number of selection from population and combination represent number of ways or combination */

  cout<<"Enter n : ";// prompt user to enter population i.e. total number of people

  cin>>n;//store into n

  cout<<"\nEnter r : ";//prompt user to enter number of selection from population

  cin>>r;

  comb = fact(n) / (fact(r) * fact(n-r));// calcuate combination- number of differnt ways to form a committe

  cout << "\nCombination : " << comb; //show the result

  return 0;

}

5 0
3 years ago
The __________ process is designed to find and document vulnerabilities that may be present because there are misconfigured syst
Roman55 [17]

answer.

I don't know what it is

8 0
2 years ago
Kaleb is interested in working at the home improvement store, and they asked him to provide references. A good reference for Kal
andrey2020 [161]

basketball coach

grandfather

4 0
3 years ago
GIF is example of raster image<br><br><br> RIGHT OR WRONG?
never [62]

Answer:

right

hope you got the answer!

thank you!

5 0
2 years ago
JavaAssignmentFirst, launch NetBeans and close any previous projects that may be open (at the top menu go to File ==&gt; Close A
mr_godi [17]

Answer:

Your program would run without error if you declared the first and second string variables before using them:

Modify the following:

first=input.nextLine();  

second=input.nextLine();

to:

String first=input.nextLine();  

String second=input.nextLine();  

Explanation:

Required

Program to print two strings in forward and reversed order

<em>The program you added is correct. The only thing that needs to be done is variable declarations (because variables that are not declared cannot be used).</em>

<em></em>

So, you need to declared first and second as strings. This can be done as follows:

<u>(1) Only declaration</u>

String first, second;

<u>(2) Declaration and inputs</u>

String first=input.nextLine();  

String second=input.nextLine();  

4 0
3 years ago
Other questions:
  • Frank works for an organization that wishes to install a software program on a single server with multiple users connected. Whic
    8·1 answer
  • A new protocol for new information distribution proposed by CERN became the world wide wed in 1991.
    10·1 answer
  • What does the e in email stand for
    8·2 answers
  • Assume a disk cache hit rate (dchr) of 95% and 2 millisecond on average to access a page in cache. If the average access time to
    8·1 answer
  • Which of the following organizations offers a family of business management system standards that details the steps recommended
    12·1 answer
  • A set of parentheses that contain zero or more arguments
    12·1 answer
  • SimpleScalar is an architectural simulator which enables a study of how different pro-cessor and memory system parameters affect
    6·1 answer
  • 1. Describe the general characteristics of a program that would exhibit very high amounts of temporal locality but very little s
    14·1 answer
  • ((Sorry for the self promo btw) Can you guys help me try and get affiliate on twitch? I am currently at 20 followers and it woul
    10·2 answers
  • 1
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!