Write a code in C++ that can save 100 random numbers in an array that are between 500 and 1000. You have to find the average of the 100 random numbers. To find the average of the numbers, you have to use a functions. You are not allowed to use return, cin or cout statements in the functions.

Hint : you have to use function call by reference.

Answers

Answer 1

Answer:

#include <iostream>

#include <random>

//here we are passing our array and a int by ref

//to our function called calculateAverage

//void is infront because we are not returning anything back

void calculateAverage(int (&ar)[100], int &average){

 int sum = 0;

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

   //adding sum

   sum += ar[i];

 }

 //std:: cout << "\naverage \t\t" << average;

//calculating average here

 average += sum/100;

}

int main() {

 int value = 0;

 int average = 0;//need this to calculate the average

 int ar[100];

 //assign random numbers from 500 to 1000

 //to our array thats called ar

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

   value = rand() % 500 + 500;

   ar[i] = value;

   

 }

 calculateAverage(ar,average);

 // std:: cout << "\naverage should be \t" << average;

 

}

Explanation:

not sure how else this would work without having to pass another variable into the function but I hope this helps!

I commented out the couts because you cant use them according to ur prof but I encourage you to cout to make sure it does indeed calculate the average!


Related Questions

Encryption is an important topic in math and computer science. It keeps your personal information safe online.

a. True
b. False

Answers

Thus is true
Encryption helps to keep data virtually safe

What do mobile platforms utilize to stream voice, IP telephony, mobile internet access, video calling, gaming services, cloud computing, high-definition mobile TV, and mobile 3-D TV

Answers

Answer:

4G/5G.

Explanation:

The broadband cellular network technology that mobile platforms utilize to stream voice, IP telephony, mobile internet access, video calling, gaming services, cloud computing, high-definition mobile TV, and mobile 3-D TV is 4G/5G.

4G technology refers to the fourth generation broadband cellular network technology that is typically used for cellular communications on mobile phones and it is considered to have an internet speed that is ten times faster than what is obtainable on the third generation (3G) broadband technology.

Similarly, 5G is the fifth generation broadband cellular network technology that succeeded 4G and it offers higher quality in terms of performance, reliability, availability and efficiency.

As a result of the speed and high quality specifications of the 4G/5G broadband cellular network technology, they are widely used for various communications systems.

Which command is used to copy entire folder structures between volumes or across a network while maintaining all NTFS file permissions and attributes

Answers

Answer:

Robocopy

Explanation:

The newer and most used command to accomplish this is Robocopy. This code does exactly what is described in the question, it copies the entire structure of the volume in question but still maintains all of its permissions and attributes. It also allows you to copy large datasets at an extremely fast speed, roughly 150 MB/sec. Robocopy can even resume interrupted file transfers without loss of data.

In case of a suspected data breach, what course of action should a chief information security officer (CISO) take

Answers

Answer

1. Assemble his team

2. Find reason for breach

3. Evaluate what was lost

4. Ensure password change

Explanation:

In case of a suspected breach, the Chief information security officer should first of all assemble his incidence response team. This team should have representatives from all areas of the organization.

Then the reason for the breach and how access was gained has to be found out. An evaluation of what has been lost in the breach would be carried out and it's likely impact on the company.

In case credentials were stolen the CISO has to ensure that the employees change passwords. Also he has to notify all the necessary parties about the breach.

The CISO has to ensure that all employees are trained properly on security and they comply to security policies.

In PowerPoint _____ management is extremely important and you must keep track of what links, files, and programs are placed in which folders.

Answers

Answer: File

Explanation:

In PowerPoint _file_ management is extremely important and you must keep track of what links, files, and programs are placed in which folders.

File Management is extremely important because it is necessary for effective system administration.

A good file management system in powerpoint makes compactness, data retrieval and editing achieveable.

ANSWER QUICKLY PLEASE

Fill in the blank to complete the sentence.
Binary Digit 1 0 0 0 0 0 1 1
Decimal Equivalent of Place Value 128 64 32 16 8 ? 2 1

A high level language like Python is converted to bytecode, and then binary when the program is executed. The missing place value is this binary number is _____

Answers

Explanation:

I don't know what is the question.

? should have the value of 4

binary digit 10000011 is equal to 128 plus 2 plus 1 = 131 in decimal

Binary Digit 1 0 0 0 0 0 1 1 Decimal Equivalent of Place Value 128 64 32 16 8 4 2 1. A high level language like Python is converted to byte code, and then binary when the program is executed. The missing place value is this binary number is 131 in decimal.

What is Binary digit?

The term “binary” refers to the smallest and minimum two-digit number stored on a computer device. The smallest binary codes are zero (0) and one (1). The use of storing numbers easily. The computer only understands the binary language. The binary is converted into the number system as a human language.

The Binary digit is 1 0 0 0 0 0 1 1

1 × [tex]2^{0}[/tex]  = 1 × 0 = 1

1 × [tex]2^{1}[/tex]  = 1 × 2 = 2

0 × [tex]2^{2}[/tex] = 0 × 4 = 0

0 × [tex]2^{3}[/tex] = 0 × 8=  0

0 × [tex]2^{4}[/tex] = 0 × 16 = 0

0 × [tex]2^{5}[/tex] = 0 × 32 = 0

0 × [tex]2^{6}[/tex] = 0 × 64 = 0

1 × [tex]2^{7}[/tex] = 1 × 128 = 128

1 + 2 + 128 = 131 in decimal

(1 0 0 0 0 0 1 1) = (131)

Hence, the significance of the Binary digit is aforementioned.

Learn more about on Binary digit, here:

https://brainly.com/question/11110720

#SPJ5

Which programming language uses objects? C++ ALGOL Pascal BASIC

Answers

Answer:

C++

Explanation:

I am a c++ dev

Answer:

its A

C++

Explanation:

Youre amazing

What is true about the process of converting analog data into digital data?

a

To make the digital version be a more accurate representation of the analog data, the process should use fewer bits to represent each sample.

b

The digital version is a representation of the analog data but cannot include all of the details.

c

A longer interval between measured samples means more details will be captured in the conversion from analog to digital

d

The digital version contains all of the details of the analog data, as long as enough storage capacity is available.

Answers

Answer:

b. The digital version is a representation of the analog data but cannot include all of the details.

Explanation:

Analog data are continuous infinite stream of data but since the computer has finite memory, these data could only be represented on the computer by converting them to finite data. This process is called analog to digital conversion.

The following are some of the things that should be noted when doing this conversion:

1. Since the digital version is a finite representation of the analog which is infinite, it (the digital version) cannot include all of the details in the analog.

2. For the digital version to be a more accurate version of the analog data it represents, as much bit as possible should be used to represent each sample.

3. Short intervals between measured samples means more details will be captured in the conversion from analog to digital.

Analog to digital conversion of data simply involves the converting an infinite stream of data into a Finite version of the same data.

Digital data are Finite representation of the infinite data typical of analog representation. Hence, a Finite sequence, will not habor all the data or information contained in an analog record.

Therefore, the digital data representation will only be a Finite representation of the analog data and will not contain all of the details.

Learn more :https://brainly.com/question/17557558

In a systems development life cycle (SDLC) model, the purpose of the _____ is to create a physical model that will satisfy all documented requirements for the system.

Answers

Answer:

systems design phase.

Explanation:

In a systems development life cycle (SDLC) model, the purpose of the systems design phase is to create a physical model that will satisfy all documented requirements for the system.

This ultimately implies that, that system design involves determining the overall system architecture, which is typically comprised of hardware, end users, physical processing components, software, and the communication channel that will effectively and efficiently satisfy the essential requirements of the system.

The system inputs and outputs will be designed along with a plan of the way the system's features will be navigated.

Basically, system design is divided into two groups;

I. Logical design.

II. Physical design.

The design of service systems is the process involved in planning, creating infrastructure, building communication, organizing staffs and standardization of a system so as to improve its quality and business relationships between the service provider and its clients. A characteristic that can be used to guide the design of service systems is to ensure services cannot be inventoried.

Access will place ________ around a text string within a query criteria that will limit the results to their exact specifications.

Answers

Answer: quotation marks (")

Explanation:

Quotation marks are put around a text string within a query criteria so that the results of the specifications are limited. We should note that the criteria is defined as the conditions which the users can set inside the query in order for them to get the records that they want to return.

The purpose of the ________ in a database system is to receive requests from applications and to translate those requests into reads and writes on the database files.

Answers

Answer:

database management system (DBMS)

Explanation:

The process that is being described is known as a database management system (DBMS). There are many types of these systems because they are extremely useful as they allow for complete manipulation of data within databases, allowing data to flow in and out as needed from a database. Popular examples of such systems include MySQL, PostgreSQL, Microsoft Access, SQL Server, etc. Every single application or company that has large sets of data need to use DBMS'

anybody got a quisten

Answers

Answer:

no why?

Explanation:

In Python, when converting a string value into a numeric value that is a positive or negative whole number, the int() function is used.


True

False

Answers

Answer:

True

Explanation:

The Int  Variable can handle Positive and Negative Numbers, it just can't handle decimal numbers.

The statement "In Python, when converting a string value into a numeric value that is a positive or negative whole number, the int() function is used" is true.

What is python?

Python is a popular computer programming language used to create software and websites, automate processes, and analyze data. Python is a general-purpose language, which means it may be used to make many various types of applications and isn't tailored for any particular issues.

Python is a great programming language for experienced developers as well. It's one of the most widely used programming languages in the world, maybe as a result of how simple it is for novices to learn. Python is one of the most approachable programming languages due of its simple syntax and lack of complexity.

Therefore, the statement is true.

To learn more about python, refer to the link:

https://brainly.com/question/18502436

#SPJ5

What occurs during the mail merge process? Place the steps in the correct order.

Specify which records to

Insert merge fields.

Preview, print, or email the Connect to a data source.

Create the main

include

document

document


ANSWER:

1. creat the main document

2. connect to a data source

3. specify which records to include

4. insert merge fields

5. preview, print, or email the document

Answers

Answer:

1. Create the main document

2. Connect to a data source

3. Specify which records to include

4. Insert merge fields.

5. Preview, print, or email the document.

Explanation:

Microsoft Word refers to a word processing software application or program developed by Microsoft Inc. to enable its users type, format and save text-based documents.

A Mail Merge is a Microsoft Word feature that avails end users the ability to import data from other Microsoft applications such as Microsoft Access and Excel. Thus, an end user can use Mail Merge to create multiple documents (personalized letters and e-mails) at once and send to all individuals in a database query or table.

The sequential steps of what occurs during the mail merge process are;

1. Create the main document

2. Connect to a data source

3. Specify which records to include

4. Insert merge fields.

5. Preview, print, or email the document.

Answer:

1.Create the main document

2.Connect to a data source

3.Specify which records to include.

4.Insert merge cells

5.Preview, print, or email the document.

Explanation:

Just did it on e2020

Describe the facility that allows multiple types of operating systems to run in a virtualized environment with varying types of hardware.  Include why this is so difficult and what challenges are overcome.

Answers

Answer:

Server virtualization

Explanation:

The facility or technology which enables multiple types of operating systems to be run together in a virtualized environment with varying types of hardware is called server virtualization.

Just as the name suggests, it involves a server (ie a computer that serves or allows the exchange of data between computers) allowing several different Operating systems (OS) to have their own different configurations.

The fact that the various operating systems will need their individual system configuration presents difficulties and challenges. Also, as the partitioning of the hardware resources has to be done, the server computer memory may become overused.

A large population of Aloha users manages to generate 50 requests/sec, including both originals and retransmissions. Time is slotted in units of 40 msec.a. What is the chance of success on the first attempt at a given station?b. What is the probability of exactly k collisions (for k = 1, 2,...,10) followed by a success?c. What is the expected number of transmission attempts needed?

Answers

Answer:

a) 0.1353

b) attached below

c) 7.4

Explanation:

Frame transmission rate = 40 msec

Total load  requests = 50 requests /sec

hence

Total arrival rate G in Frames ( G ) / x secs

= 50 request/sec * X sec

= 50 * ( 40*10^-3 )

= 2 requests/ x sec

a) Determine chance of success on first attempt

0.1353

b) Determine the probability of exactly K collisions followed by a success

 attached below

c) what is the expected number of transmission attempts needed

7.4

talon is a new game designer working on an exciting and innovative game idea, but its time to examine the idea for technical feasibility. what ? could Talon ask to determine the technical feasibility


a. Are there people who would buy your game? Are stores willing to sell it?


b. can this idea be technically achieved? Wil it work the limitations of hardware and programming resources?


c. Does the game do something new that will pique people interests?


d. Am i having tons of fun while playing this game?

Answers

A Because if no one will sell it, it will be pointless so if people sell it and buy it, it will be best so A

Are there people who would buy your game? Are stores willing to sell it? Talon asks to determine the technical feasibility Thus, option A is correct.

What is Technical feasibility?

Technical feasibility assesses the expert program's complexities and frequently entails figuring out whether it is able to use cutting-edge methods and instruments.

The analysis examines the viability of a project's four components: Scientific: A list of the necessary hardware, software, and manpower to render their function. Finance: A projection of the development's total cost and predicted return.

The time has come to assess the project's technological viability. Talon is a new coder who is working on an interesting and original gaming idea. Because it will be useless if no one buys it and no one sells it.

Therefore, option A is the correct option.

Learn more about Technical feasibility, here:

https://brainly.com/question/14208774

#SPJ2

1. When the Cisco 2950 switch is first turned on, it behaves like a hub. Why is this so, and what must happen before the switch can send unicast traffic to a specific port

Answers

Answer:

The switch sends broadcast traffic to all ports like a hub to get the number of ports used and build its MAC address table.

Explanation:

A network switch is a device used in a LAN to connect all available workstations. Unlike a network hub, it is able to send frames from a host or workstation to another using its MAC address table.

An example of a switch is the Cisco 2950 switch. When it is first turned on, it acts as a hub, broadcasting traffic to all its ports. This process is used to create a MAC address table to get the IP address of workstations and the ports they relate to, enabling it to send unicast traffic to a specific port.

Maria wants to create a simple logo for her new flower shop. She would like to use the computer to create this logo. Maria should use a machine diagramming software CAD ​

Answers

Answer:

graphics software

Explanation:

Maria should use a graphics software

Modify your previous exercise to determine if the user can ride a rollercoaster. To ride the rollercoaster, you must be at least 42 inches tall. You must also be at least 9 years old. Ask the user how tall and how old they are. Use ONE if-else to determine if the user can ride the rollercoaster. Note how much cleaner this is and how much less repetition this method has.

Answers

Answer:

In Python:

age = int(input("How old are you? "))

height = float(input("How tall are you (inches)? "))

if age>=9 and height >= 42:

    print("You can ride the roller coaster")

else:

    print("You ca'nt ride the roller coaster")

Explanation:

The code segment of the "previous exercise" is not given; so, I rewrite the program from scratch using python.

And using the solution I provided, you'll have an idea of how to write the expected code If the "previous exercise" is not written in python,

This line prompts user for age

age = int(input("How old are you? "))

This line prompts user for height

height = float(input("How tall are you (inches)? "))

This checks if user is at least 9 years old and at least 42 inches tall

if age>=9 and height >= 42:

If true, the user gets to ride the roller coaster

    print("You can ride the roller coaster")

else:

If otherwise, the user will not ride the roller coaster

    print("You ca'nt ride the roller coaster")

g Let m be a positive integer with n -bit binary representation: What are the smallest and largest values that m could have?

Answers

Answer:

The smallest value that m could have is 0, while the largest is [tex]2^n - 1[/tex]

Explanation:

For numbers with n bits, we have that:

The minimum possible value is 0.

The maximum possible value is [tex]2^n - 1[/tex]

So, in this question, since the number m has n bits:

The smallest value that m could have is 0, while the largest is [tex]2^n - 1[/tex]

Write an application that displays the strings in the provided array alphabetically in ascending order.

Answers

Answer:

Explanation:

The following code is written in Python and it is a very simple function/program that takes in an array of strings as a parameter called names. This array is then passed the built-in sort function which automatically sorts it in ascending alphabetical order. Finally, the print method is called on the names array to print all of its elements out.

def sort_strings(names):

   names.sort()

   print(names)

A loop should output 1 to n. If n is 5, the output is 12345. What should XXX and YYY be? Choices are in the form XXX / YYY. cin >> n; for (XXX; i++) { cout << YYY; }

Answers

Answer:

[tex]i = 0; i < n / i + 1[/tex]

Explanation:

Given that:

a loop output 1 → n

if n = 5

output = 12345

n = scnr.nextInt();

for [tex](XXX; i++)[/tex]

{

System.out.printIn(YYY);

}

XXX / YYY is [tex]i = 0; i < n / i + 1[/tex]

Intangible resources are typically embedded in ________ routines and practices that have evolved and accumulated over time. common obvious standard unique

Answers

Answer:

Unique

Explanation:

The correct word to fill in the gap is "unique". This is because the routines are not common or of any major standard but are special in their own ways

Open & Place is used to insert the image in the same file. is it true or false?

Answers

it is true because it’s just the way i insert an image on a file i don’t know what other way to explain it

Write a python program that: - Defines a tuple of 5 integer numbers - prints the tuple - Appends a new value to the end of the tuple - prints the tuple again Please note that appending a new value to a tuple will change the tuple. However, as you learned in Unit 5, tuples are immutable i.e. do not change. Therefore, to solve this problem, you need to find a way to change a tuple.

Answers

Answer:

The program is as follows:

my_tuple = (1,2,3,4,5)

print(my_tuple)

mylist = list(my_tuple)

mylist.append(6)

my_tuple = tuple(mylist)

print(my_tuple)

Explanation:

This defines a tuple of 5 integers

my_tuple = (1,2,3,4,5)

This prints the tuple

print(my_tuple)

To add new element to the tuple; First, we convert it to list. This is done below

mylist = list(my_tuple)

Then, an item is appended to the list

mylist.append(6)

The list is then converted to tuple

my_tuple = tuple(mylist)

This prints the tuple

print(my_tuple)

My pc suddenly freezes and i can't open any apps or task manager. Apps do not open at all and if i restart from the start it gets stuck on restart forever. I have to force restart my pc a couple of times before it is back to normal. What is wrong?

Answers

Answer:

Explanation:

You might need a new computer or a new mother board

A software company used to run an algorithm sequentially on one server. As more users start using their app, the company decided to rewrite the program to be parallel. It is now run on four separate servers instead of one Thanks to the use of a parallel algorithm, the same process that used to take 40 minutes to run now only requires 20 minutes. The company is considering purchasing additional computers to decrease the time the program runs even further. Which of the following best describes the impacts of running the parallel algorithm on an even larger number of computers.

a. The algorithm will likely require more time since it is now being run sequentially on more computers.
b. The algorithm will likely require the same amount of time to run because it is processing the same amount of data.
c. The algorithm will likely require less time to run though the improvements in efficiency will not be as significant as before.
d. The algorithm is unlikely to still run since parallel algorithms are not designed to scale to additional computers

Answers

Answer:

a. The algorithm will likely require more time since it is now being run sequentially on more computers.

Explanation:

Algorithm is a software which enables the users to solve complex problems with input of commands. The software runs the command inserted and then output is generate. The algorithms can be run parallel and sequentially on more computers.

The following example demonstrates a program that uses 3 levels of nested dictionaries to create a simple music library. The following program uses nested dictionaries to store a small music library. Extend the program such that a user can add artists, albums, and songs to the library. First, add a command that adds an artist name to the music dictionary. Then add commands for adding albums and songs. Take care to check that an artist exists in the dictionary before adding an album, and that an album exists before adding a song.

music = {
'Pink Floyd': {
'The Dark Side of the Moon': {
'songs': [ 'Speak to Me', 'Breathe', 'On the Run', 'Money'],
'year': 1973,
'platinum': True
},
'The Wall': {
'songs': [ 'Another Brick in the Wall', 'Mother', 'Hey you'],
'year': 1979,
'platinum': True
}
},
'Justin Bieber': {
'My World':{
'songs': ['One Time', 'Bigger', 'Love Me'],
'year': 2010,
'platinum': True
}
}
}

#complete/edit code given below:

# Get user input

# While user input != 'exit'
# ...

Answers

Answer:

def add_album(artist,album):

   song_list = input("enter the list of song titles separated by comma: ").split(",")

   print(song_list)

   year = int(input("enter release year: "))

   is_platinum = bool(input("Is it platinum? True/False"))

   music[artist][album] = {}

   music[artist][album]['songs'] = song_list

   music[artist][album]['year'] = year

   music[artist][album]['platinum'] = is_platinum

def add_artist():

   artist = input("enter name of artist: ")

   if music.get(artist, "no") == "no":

       music[artist] = {}

       

   else:

       print("artist already exist in dictionary.")

   is_album = input("add album? ")

   if is_album == "yes":

       album_name = input("Enter album name: ")

       add_album(artist,album_name)

           

for _ in iter(dict, 0):

   is_exist = input("Do you want to end the program? yes/no: ")

   if is_exist == "yes":

       break

   elif is_exist == "no":

       is_art = input("Add artist? ")

       if is_art == "yes":

           add_artist()

       else:

           print("enter  yes/no")

   else:

       print("make a decision, yes/no")

Explanation:

The python program defines an "add_artist" and "add_album" function that references the dictionary "music". The functions prompt for user inputs of the artist name, album, year, and platinum record.

The functions use the bracket notation to access and update the dictionary in the memory.

Please select the word from the list that best fits the definition
PLEASE HURRY. ITS TIMED

Enjoys working through a process


Interpersonal

Musical

Body-Kinestetic

Spatial

Linguistic

Intrapersonal

Logical-Mathmatical

Answers

Musical is the one that best fits it

Answer:

im tryna get points for a challenge. im not that smart but those look like cool wrds. mwah

Explanation:

Other Questions
Why did political parties take over by the end of the G.W Presidency? Please help me with this thx Domain and Range functions Let f(x)=42x+3. Evaluate f(1) need help finding x How was the 15 th amendment finally enforced by the passage of the 24 th amendment? Drag each label to the correct location on the table. Not all labels will be used.Identifythe careers that require a college degree.anthropologistfilm actorvideo equipment installerprogrammer analystaeronautical engineerphotographer Alion eats the meat of a buffalo. How do the molecules in the buffalo most likey act as building blocks for thelion? find the value of x. what does migration prevent ? Which of the following statements aboutthe Umayyad dynasty is true?A. The dynasty relocated the Islamic holy city to Cairo inEgypt.B. The dynasty was able to control most of Asia.C. The dynasty was able to control most of Europe.D. It was able to greatly expand the Islamic religion. What is the image point of (9,-1)(9,1) after the transformation T_{-4,-3}\circ R_{270^{\circ}}T 4,3 R 270 ? What happens after magma is formed?1. Magma escapes by intrusion.2. Magma escapes by extrusion.3. Magma escapes to the bodies of water.4. Magma escapes through a magma chamber. 3y + 5x =15dhnsnsishbsdn 16.Mg(OH)2 +H.PO.-> ||||Mg(PO2 +H2O2,3,6,13, 3, 1,63, 2, 1,62,3,1,317. Cr+Fe(NO.)2 ->Fe +_ Cr(NO3)24,6,6,20 2,3,2,30 1,3,3,102.3, 1.20 2,3,3,2these are two questions separated but I would REALLY appreciate if someone could do them its for a test Absolute advantage is found by comparing different producers' Group of answer choices opportunity costs. payments to land, labor, and capital. input requirements per unit of output. locational and logistical circumstances. I really need help guys! Please answer with detail, will give brainliest. What is velocity? If f(x)=x-6 and g(x)=x^1/2(x+3) , find g(x) X f(x) . Help please I need this asap :) Pls help Im failing math