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
labwork [276]
3 years ago
9

Create the arrays and assign randomized values for each element in the array. The randomized values should range from 1 to twice

the size of the array. For example, for an array of 200, assign random values between 1 and 400. Use a constant for the size of the array. Edit the value of the constant in different runs of the program to account for the various array sizes.
Computers and Technology
1 answer:
lutik1710 [3]3 years ago
4 0

Answer:

In Java:

import java.util.Random;

public class Main {

  public static void main(String[] args) {

      final int arrsize = 10;

     Random rd = new Random();

     int[] arr = new int[arrsize];

     for (int kount = 0; kount < arrsize; kount++) {

        arr[kount] = rd.nextInt(arrsize*2-1) + 1;

        System.out.print(arr[kount]+" ");      }   }}

Explanation:

This declares the array size as a constant integer

      final int arrsize = 10;

This creates a Random object

     Random rd = new Random();

This declares an array of arrsize size

     int[] arr = new int[arrsize];

This iterates through the array

     for (int kount = 0; kount < arrsize; kount++) {

This generates the random values between 1 and arrsize * 2

        arr[kount] = rd.nextInt(arrsize*2-1) + 1;

This prints the elements of the array

        System.out.print(arr[kount]+" ");      }

You might be interested in
A company uses the account code 669 for maintenance expense. However, one of the company's clerks often codes maintenance expens
kotegsom [21]

Answer:

The correct answer to the following question will be "Valid-code test".

Explanation:

Even though no significance labels (including a standardized test score parameter) exist, valid data input codes or protocols could still be defined by having to type the correct codes as well as ranges.

  • To diagnose the given mistake, a valid code review will be the strongest internal control audit to incorporate into the organization's computer program.
  • To insert valid code the syntax is: <Code or Range>. Throughout this scenario, each code is decided to enter on another step.
3 0
3 years ago
What is the maximum amount of memory that vmachine1 can use in its current configuration with startup ram set to 1024 megabytes?
lidiya [134]

The answer is 1024MB.

I am really not in a position to answer this question fully since the lab is not provided but according to the research conducted online, the answer is 1024MB. According to the book, based on the physical memory installed on the PC, the current system shows 1.06GB which is equivalent to 1060MB. Thus, it is able to use all 1024MB.






7 0
3 years ago
Suppose I create a new kind of Java object, called "Kangaroo". Further suppose that at any given time, all instances of this new
OLEGan [10]

Answer:

Attributes.

Explanation:

When the java object is created called "Kangaroo" and it has some properties or facts associated  with it that includes the stomach capacity,current attitude towards the pea soup and the kangaroo's location.The another name of these facts is Attributes.

Attributes are the qualities,features or properties that an entity possesses.

4 0
3 years ago
a. Daily Life Magazine wants an analysis of the demographic characteristics of its readers. The marketing department has collect
kherson [118]

Answer:

uh

Explanation:

7 0
3 years ago
Explain the differences between copyright, fair use, and trademark?
ValentinkaMS [17]

A trademark is an easily recognizable symbol, phrase, or word that denotes a specific product. It legally differentiates a product or service from all others of its kind and recognizes the source company's ownership of the brand.

"Copyright" literally means the right to copy but has come to mean that body of exclusive rights granted by law to copyright owners for protection of their work. Copyright protection does not extend to any idea, procedure, process, system, title, principle, or discovery.

Fair use is a doctrine in United States law that permits limited use of copyrighted material without having to first acquire permission from the copyright holder.

7 0
3 years ago
Other questions:
  • Who are the founders of video-sharing site Dailymotion?
    7·1 answer
  • A car holds 16 gallons of gasoline and can travel 312 miles before refueling. Write aC++ program that calculates the number of m
    9·1 answer
  • A person painting his house dumps the unused paint on the ground. Which of the following resources will this most likely pollute
    14·1 answer
  • What tool do you use to secure remote access by users who utilize the internet??
    7·1 answer
  • Sonora wants to extend the cells to be added in her formula. what is the quickest way to add more sells?
    10·2 answers
  • 2.27 LAB: Driving costs Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both doubles) as
    14·2 answers
  • Plot element is typically the turning point in the most intense moment of a story
    8·1 answer
  • Digital certificates can be used for each of these EXCEPT _____. A. to encrypt channels to provide secure communication between
    13·1 answer
  • The default paper size is _____. <br> a. letter <br> b. legal <br> c. executive <br> d. statement
    7·1 answer
  • What will be the range of the random numbers generated by the following code snippet? rand() % 50 + 5;
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!