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
Darya [45]
3 years ago
10

write a program that will create an array of 100 random integers in the range from [0,99] pass the array to a function, printarr

ay(), that will print the values of the array on the monitor. pass the array to a function, sortarray(), that will sort the array. Pass the array to printarray() again and print it in increasing order
Computers and Technology
1 answer:
slava [35]3 years ago
5 0

Answer:

In C++:

#include <cstdlib>  

#include <ctime>  

#include <iostream>

#include <bits/stdc++.h>

using namespace std;

void printarray(int array []){

for(int i=0; i<100; i++){         cout << array[i] << " ";    }

}

void sortarray(int array []){

sort(array, array + 100);

   printarray(array);

}

int main() {  

   int array[100];

   srand((unsigned)time(0));  

   for(int i=0; i<100; i++){  array[i] = (rand()%99);     }

   printarray(array);

   cout<<endl;

   sortarray(array);

   return 0;

}

Explanation:

<em>See attachment for program source file where comments are used for explanation purpose</em>

Download cpp
You might be interested in
If you delete a conversation many times with someone like this, will you stop receiving messages from them?
GREYUIT [131]

Answer: No

Explanation:

4 0
3 years ago
Which of the following is a definition of conventions?
Gekata [30.6K]

Answer:  B

Explanation:

Conventions include spelling, punctuation, capitalization, grammar, and sentence structure.

5 0
3 years ago
_________ is the amount of data a storage device can move per second from the storage medium to ram.
mote1985 [20]
<span>data transfer rate..</span>
5 0
4 years ago
( Game Design) The companies who get video games out to consumers are called:
Bad White [126]

Answer:

They are called video game publishers

Explanation:

A video game publisher is responsible for financing a video game’s development, marketing, and release of the game to the consumers. Basically, they are the ones who manage the business end of the gaming field. If the video game company is well established, the publishers of that company will be the ones to distribute while some smaller companies will hire distribution companies to distribute the games for them

3 0
3 years ago
Create a method called fixArray(int[][] array, int row, int col, int value) that sets the [row][column] to the correct value. Th
PolarNik [594]

Answer:

  1. public class Main {
  2.    public static void main (String [] args) {
  3.        int[][] myArray = {{1,5,6}, {7, 9, 2}};
  4.        fixArray(myArray, 1, 2, 12);
  5.        System.out.println(myArray[1][2]);
  6.    }
  7.    private static void fixArray(int[][] array, int row, int col, int value){
  8.        array[row][col] = value;
  9.    }
  10. }

Explanation:

The solution code is written in Java.

Firstly, create the method fixArray with that takes four inputs, array, row, col and value (Line 11). Within the method body, use row and col as index to address a particular element from array and set the input value to it (Line 12).

Next, we test the method in the main program using a sample array (Line 4) and we try to change the row-1 and col-2 element from 2 to 12 (Line 5).

The print statement in Line 7 will display 12 in console.

7 0
4 years ago
Other questions:
  • Apakah maksud input dan output ?<br>​
    12·1 answer
  • Some people are unable to arrange six matches to form four equilateral triangles because they fail to consider a three - dimensi
    6·1 answer
  • Type of media that uses laser technology to store data and programs is
    6·1 answer
  • Which of the following is an Example of a technical (“hard”) skill
    6·2 answers
  • Who is the CEO of Tesla.​
    11·2 answers
  • Janis is preparing a financial document. She needs to use the dollar symbol placed above the number key 4. Which key will Janis
    14·1 answer
  • Which kind of testing runs the system in a simulated environment using simulated data?a) validation testing. b) verification tes
    5·1 answer
  • Which statement best describes an academic goal?
    14·2 answers
  • I’m wondering how to get images to show on my computer because at the moment images won’t show and I’ve cleared my cache and eve
    14·1 answer
  • Computer father known as​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!