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
N76 [4]
3 years ago
6

Write a loop that fills an array int values[10] with ten random numbers between 1 and 100. Write code for two nested loops that

fill values with ten different random numbers between 1 and 100.
Computers and Technology
1 answer:
zalisa [80]3 years ago
7 0

Answer:

#include <iostream>

#include <cstdlib>

using namespace std;

int main() {

   int[] array = new int[10];

   int index = 0;

   while(index < array.size()){

           int number = (rand() % 100) + 1;

           for (int i = 0; i < 1; i++) {

               array[index] = number;

               cout<< "Position "<< index << "of the array = "<< number << endl;

               ++index;

           }

     }

}

Explanation:

The while loop in the source code loops over a set of code ten times, The for loop only loops once to add the generated random number between 1 and 100 to the array of size 10. At the end of the for loop, the index location and the item of the array is printed out on the screen. The random number is generated from the 'rand()' function of the C++ standard library.

You might be interested in
By definition, what is the process of reducing security exposure and tightening security controls?
saw5 [17]

Hardening is the technique of reducing security exposure and tightening security controls of software and network devices.

Security is a major concern, when connecting over a network. Through hardening, security of a network is protected from vulnerable activities. Hardening reduces exposures associated with security and provides tight controls for it.

Hardening is typically a collection of tools and techniques that are used to decrease vulnerability in computer software, applications, network devices and infrastructure. The main goal of hardening is to protect security by identifying and eliminating superfluous programs, applications, permissions and access, which in turn, reduces the chances that attackers and malware will gain access over the network ecosystem.

You can learn more about hardening at

brainly.com/question/27912668

#SPJ4

7 0
2 years ago
What is the cffa act
garri49 [273]

CFAA is an acronym that stands for Computer Fraud and Abuse Act. It is an anti-hacking bill that was passed to amend an existing computer fraud law. It aims to strengthen cyber security by forbidding access to computers without authorization.

3 0
2 years ago
Read 2 more answers
Which two extensions in scratch are correctly matched to their accessibility goals
enyata [817]

The two extensions in scratch are correctly matched to their accessibility goals Translate extension and  Text to speech extension.

<h3>What are Scratch Extensions?</h3>

Scratch extensions are known to be used in an interface with external hardware and information outside of the Scratch website via new blocks.

Note that The two extensions in scratch are correctly matched to their accessibility goals Translate extension and  Text to speech extension.

Learn more about scratch  from

brainly.com/question/25720264

#SPJ1

4 0
2 years ago
Given the statement: int list[25]; The index can go from 0 to 25 inclusive withoutgoing beyond the end of the array.true or fals
k0ka [10]

Answer:

False.

Explanation:

When we create an array of size n, then it's index will starts from 0 to n-1. Array index starts with 0 because the first element of the array holds the memory location that refers to 0 element away.Similarly 2nd element of array is 1 distance away from that location. That is why index starts with 0 and goes to n-1 if the size  is n.

In the question question, int list[25] is given. So the index will be from 0

to 25-1 only.If index will goes to 25 then it will go beyond the array.

3 0
3 years ago
Taken together, the physical and data link layers are called the ____________________. Internet layer Hardware layer Internetwor
IrinaK [193]

Answer:

Hardware layer

Explanation:

The hardware layer's job is to maintain and put to action central processor units and memory. Hardware layer first check the availability of the for mentioned duo and then decides the need to put one or another into action. Physical and data link layers act the same in the hardware layer. They bot are waiting to be called in action

6 0
3 years ago
Other questions:
  • Suppose as a computer programmer, you have been assigned a task to develop a program to store the sorted data in ascending order
    9·1 answer
  • Which group on the Home Tab allows you to add shapes to a PowerPoint slide?
    9·2 answers
  • Why is an ISA unlikely to change between successive generations of microarchitectures
    11·1 answer
  • What is a major way that a consumer can protect himself/herself when getting a credit card? A) Making sure that they get a very
    8·1 answer
  • Loops are frequently used to ____; that is, to make sure it is meaningful and useful.
    12·1 answer
  • In a registration database, Ross has tables for student, professor, classroom, class, class-hour. Since his campus has about 12,
    9·1 answer
  • Do debit cards offer the highest level of fraud pretection?
    10·1 answer
  • How to find out what windows version i have?
    10·1 answer
  • Multiple Choice: We have been assigned the task of developing a software testing tool (tester) that can assess reachability of s
    11·1 answer
  • What are common considerations businesses need to make before purchasing new computers? Check all of the boxes that apply.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!