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
Which statement is true regarding bitmap images?
horrorfan [7]
<span>Which statement is true regarding bitmap images?</span>
I believe it is D

8 0
3 years ago
Read 2 more answers
NAME SEARCH In the Chap07 folder of the Student Sample Programs, you will find the following files: GirlNames.txt—This file cont
Tems11 [23]

Answer:

Explanation:

I do not have the files listed in the question so I have made two test files with the same names. This code is written in Python, we are assuming that the names on each file are separated by newlines.

f1 = open("GirlNames.txt", 'r')

f1_names = f1.read()

f1_names_list = f1_names.split('\n')

f2 = open("BoyNames.txt", 'r')

f2_names = f2.read()

f2_names_list = f2_names.split('\n')

print(f1_names_list)

print(f2_names_list)

boy_or_girl = input("Would you like to enter a boy or girl name or both: ").lower()

if boy_or_girl == 'boy':

   name = input("Enter name: ")

   if name in f2_names_list:

       print("Yes " + name + " is in the list of most popular boy names.")

   else:

       print("No, it is not in the list")

elif boy_or_girl == 'girl':

   name = input("Enter name: ")

   if name in f1_names_list:

       print("Yes " + name + " is in the list of most popular girl names.")

   else:

       print("No, it is not in the list")

elif boy_or_girl == 'both':

   girlname = input("Enter Girl name: ")

   if girlname in f1_names_list:

       print("Yes " + girlname + " is in the list of most popular girl names.")

   else:

       print("No, it is not in the list")

   boyname = input("Enter name: ")

   if boyname in f2_names_list:

       print("Yes " + boyname + " is in the list of most popular girl names.")

   else:

       print("No, it is not in the list")

else:

   print("Wrong input.")

4 0
3 years ago
please help, touch pad and trackpad are the same thing and the other answers don’t really make sense to me..
WINSTONCH [101]

Answer:

The answer to the problem is B

8 0
2 years ago
A display that is thin flexible, light, and easy to read in all types of light is an
Nuetrik [128]

Answer; Electric Paper Display

Explanation:

<em>"PDs are extremely thin and only require power when a new image is requested. Instead of a traditional display that uses backlighting to illuminate pixels, an EPD is based on the scientific phenomena known as "electrophoresis," the movement of electrically charged molecules in an electric field."</em>

Above is the definition, as you can see it resembles your question greatly so this is most likely the answer you're looking for.

Good luck :D

8 0
3 years ago
Read 2 more answers
Firewall implementation and design for an enterprise can be a daunting task. Choices made early in the design process can have b
PilotLPTM [1.2K]

Complete Question:

Firewall implementation and design for an enterprise can be a daunting task. Choices made early in the design process can have far-reaching security implications for years to come. Which of the following firewall architecture is designed to host servers that offer public services?

a) Bastion Host

b) Screened subnet

c) Screened host

d)  Screened

Answer:

b) Screened subnet

Explanation:

In Computer science, Firewall implementation and design for an enterprise can be a daunting task. Choices made early in the design process can have far-reaching security implications for years to come.

Screened subnet firewall architecture is designed to host servers that offer public services.

In network security and management, one of the network architecture used by network engineers for the prevention of unauthorized access of data on a computer is a screened subnet. A screened subnet can be defined as a network architecture that uses a single firewall with three screening routers as a firewall.

<em>A screened subnet is also known as a triple-homed firewall, this is because it has three (3) network interfaces;</em>

1. Interface 1: it is known as the external or access router, which is a public interface and connects to the global internet.

2. Interface 2: it is known as the demilitarized zone or perimeter network, which acts as a buffer and hosted public servers (bastions host) are attached herein.

3. Interface 3: it is known as the internal router, which is a subnet that connects to an intranet.

<em>The screened subnet when properly configured helps to prevent access to the internal network or intranet. </em>

8 0
3 years ago
Other questions:
  • Rikki has had several problems at work recently. Her printer isn't printing correctly, copies from the copy machine come out wit
    8·2 answers
  • The ________ phase in a project involves documenting lessons learned from the project, so that the experience is useful to other
    13·1 answer
  • A device capable of copying a graphic, document, or other object is called a
    7·2 answers
  • A real-world problem that might be explained or predicted through the creation of a computer simulation
    7·1 answer
  • What is a perfect hashing function?
    13·1 answer
  • ECG mashine is an example of
    12·1 answer
  • JAVA Question!
    13·1 answer
  • How many pounds must a sand bag weigh to test if a safety net can absorb the proper amount of force? A. 150 lbs. B. 200 lbs. C.
    6·1 answer
  • Which tab automatically becomes available after inserting a text box? Drawing Tools Insert Text Box Tools Shape Tools
    15·2 answers
  • Using C++
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!