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
Hunter-Best [27]
3 years ago
5

Write four overloaded methods called randomize. Each method will return a random number based on the parameters that it receives

:
a. randomize() - Returns a random int between min and max inclusive. Must have two int parameters.

b. randomize() - Returns a random int between 0 and max inclusive. Must have one int parameter.

c. randomize() - Returns a random double between min and max inclusive. Must have two double parameters.

d. randomize() - Returns a random double between 0 and max inclusive. Must have one double parameter.
Computers and Technology
2 answers:
Scilla [17]3 years ago
8 0

Answer:

The Java code given below

Explanation:

//import package

import java.util.Scanner;

//Java class

class Lesson_35_Activity {

  // returns random int b/t min and max inclusive; has 2 int parameters

  public static int randomize(int min, int max) {

      int x = (int) (Math.random() * ((max - min) + 1)) + min;

      return x;

 

Yuri [45]3 years ago
6 0

Answer:

The Java code given below

Explanation:

//import package

import java.util.Scanner;

//Java class

class Lesson_35_Activity {

  // returns random int b/t min and max inclusive; has 2 int parameters

  public static int randomize(int min, int max) {

      int x = (int) (Math.random() * ((max - min) + 1)) + min;

      return x;

  }

  // returns random int b/t 0 and max inclusive; has one int parameter

  public static int randomize(int max) {

      int x = (int) (Math.random() * (max + 1));

      return x;

  }

  // returns random double b/t min and max inclusive; two double parameters

  public static double randomize(double min, double max) {

      double x = (double) (Math.random() * ((max - min) + 1)) + min;

      return x;

  }

  // returns random double b/t 0 and max inclusive; has one double parameter.

  public static double randomize(double max) {

      double x = (double) (Math.random() * (max + 1));

      return x;

  }

  // main method, which is entry point of the program

  public static void main(String[] args) {

      // object of Scanner class

      Scanner scan = new Scanner(System.in);

      // asking min and max number

      System.out.print("Enter min number : ");

      int mi = scan.nextInt();// reading min number

      System.out.print("Enter max number : ");

      int ma = scan.nextInt();// reading max number

      // checking number

      if (mi < ma) {

          System.out.println(randomize(mi, ma));// method call

          System.out.println(randomize(0, ma));// method call

          double mii = mi;

          double maa = ma;

          System.out.printf("%.2f", randomize(mii, maa));

          System.out.printf("\n%.2f", randomize(0, maa));

      } else {

          // when minimum number is greater than maximum number then display

          System.out.println("Enter min number " + mi + " should be less than max " + ma);

      }

  }

}

You might be interested in
your organization has decided to use dhcp for ipv6. you want all windows 10 systems using ipv6 to get all of their tcp/ip inform
timurjin [86]

your organization has decided to use dhcp for ipv6. you want all windows 10 systems using ipv6 to get all of their tcp/ip information through dhcp. By setting up a Stateful network would you set up the network .

Why is DHCP utilized and what does it do?

Network devices are set up to communicate on an IP network using the Dynamic Host Configuration Protocol (DHCP).

                           A DHCP client utilizes the DHCP protocol to request configuration data from a DHCP server, including an IP address, a default route, and one or more DNS server addresses.

What are DHCP and DNS?

It is possible to translate domain names (like its.umich.edu) into IP addresses using the Domain Name System (DNS) on the Internet.

                          In order to automatically assign IP addresses and other parameters to devices when they connect to a network, there is a mechanism called Dynamic Host Configuration Protocol (DHCP).

Learn more about DHCP Server .

brainly.com/question/29432103

#SPJ4

5 0
1 year ago
Write a program that creates a plot of the power consumed by a 1000 resistor as the voltage across it is varied from 1 V to 200
lapo4ka [179]

Answer:

Program to Plot  the power in Watts

voltage=1:200;

resistance=1000;

current=voltage/resistance;

power=current.*voltage;

plot(voltage,power);

xlabel('Voltage in Volts');

ylabel('Power in Watts'); //plot of this program is attached

Program for power in dBW

voltage=1:200;

resistance=1000;

current=voltage/resistance;

power=current.*voltage;

powerdB=10*log10(power);

plot(voltage,powerdB);

xlabel('Voltage in Volts');

ylabel('Power in dBW'); // plot output is also attached

I hope it will help you!

3 0
3 years ago
What do you think is the most fascinating aspect of the internet
kari74 [83]
The 20th century seemed to be the year of a complete freedom once the Internet has been spread worldwidely. Unfortunately, it only seemed to be a trial to see various reactions. The 21st century will change this gradually.
6 0
3 years ago
You can play a simple slide show in Windows Photo Viewer by clicking the ____ button in the playback controls.
Ludmilka [50]

Answer:

Photos is the correc answer for the above question.

Explanation:

  • Photo is an app that is available in the windows operating system. It facilitates the user to see the photos. It gives the facilities to click the slide button to view the picture like slides.
  • When any users want to use this app, then he needs to first install this app on the windows and then he can use this to see the photos like slides presentation.
  • The above question asks about the features which are used to view the pictures like slides. This app is known as "Photos".
7 0
3 years ago
Car rental agencies or taxi services often employ a _______ to service their vehicles on site.
Volgvan
The. answer is B technicians repair things 
4 0
3 years ago
Other questions:
  • A computer has a memory ________, rather than just a single memory component. The lowest level is some form of ________ storage
    11·1 answer
  • what's the best mouse for fast clicking ? I play a lot of fps and a lot of pvp games I need a mouse that I can click fast with a
    14·1 answer
  • What are the different components of the cloud architecture?
    5·2 answers
  • You can use RWA to demonstrate how to do something special on the web, such as displaying articles found on websites that suppor
    15·1 answer
  • What command line utility can be used to repair the bcd on a windows installation?
    13·1 answer
  • _____ is a component of a data model that defines the boundaries of a database, such as maximum and minimum values allowed for a
    12·1 answer
  • How do you put a picture when you ask a question?
    6·2 answers
  • ______ are used to store all the data in a database.
    7·1 answer
  • Where to buy a ps5<br> I really want one please help meh
    14·2 answers
  • Which location on the ribbon contains the commands for adding a table to a document?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!