write a program that will create an array of 100 random integers in the range from [0,99] pass the array to a function, printarray(), 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

Answers

Answer 1

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:

See attachment for program source file where comments are used for explanation purpose


Related Questions

All of the following are problem-solving steps except:
A. taking action.
B. defining the problem.
c. doing the first solution that comes to mind.
D. creating possible solutions.

Answers

Answer:

C. Doing the first solution that comes to mind.

Explanation:

Lets break this down a bit.

A is a great problem solving step, so we can mark that off.

We can do the same for B.

However, for C, I am hesitant about this one, so I wont mark it off quite yet.

Finally, for D, it is definitely a step, so I can mark that off.

You should never do the first solution that comes to mind, since you haven't done enough brainstorming about other ideas.

Hope this helps!

Order the steps for creating and assigning a new task in Outlook 2016.
Choose a task list, and
Open the Task view.
Click Assign Task, and
Complete the task
Click Send.
click New Task
specify the assignee.
information
Intro
Done

Answers

Answer:

Open the task viewChoose a task list and click new taskcomplete the task information click assign task and specify the assigneeclick send

Explanation:

Got it right on edge

The process of using the new

information system and doing away

with the old system is known as

system ___.​

Answers

Answer:

The process of using the new

information system and doing away

with the old system is known as

system development

red + blue =
Red + green =
Magenta - blue =
Yellow - green =
Cyan - blue =​

Answers

Answer:

red + blue is green

red + green is blue

6.20 LAB: Acronyms An acronym is a word formed from the initial letters of words in a set phrase. Write a program whose input is a phrase and whose output is an acronym of the input. If a word begins with a lower case letter, don't include that letter in the acronym. Assume there will be at least one upper case letter in the input. Ex: If the input is: Institute of Electrical and Electronics Engineers the output should be: IEEE

Answers

Answer:

Explanation:

The following code is written in Python. It creates a function that takes in a phrase as an argument. Then it splits the phrase into a list of words. Next, it loops through the list and adds the first letter of each word into the acronym variable if it is a capital letter. Finally, returning the acronym variable. Output can be seen in the attached picture below.

def accronymGenerator(phrase):

   phrase_split = phrase.split(' ')

   acronym = ""

   for x in phrase_split:

       if x[0].isupper() == True:

           acronym += x[0]

       else:

           pass

   return acronym

Aspire is a test you take to prepare for the
A. PSAT
B. SAT
C. ACT
D. FAFSA

Answers

Answer:

ACT

Explanation:

"ACT Aspire is a powerful tool to help students and their parents monitor progress toward a successful ACT test from third grade through tenth grade. The Aspire test assess students' readiness in five areas covered by the ACT test: English, math, reading, science and writing." - https://greentestprep.com/resources/act-prep/act-aspire-test/

Aspire is a test you take to prepare for the ACT. Thus, option C is correct.

What is ACT?

"ACT Aspire is a powerful tool to help students and their parents monitor progress toward a successful ACT test from third grade through tenth grade. The Aspire test assess students' readiness in five areas covered by the ACT test: English, math, reading, science and writing.Aspire is a test people take as a preparation for both ACT a d SAT.

Aspire is a valuable tool to help students and their parents monitor progress towards a good ACT exam from 3rd to 10th grade. The Aspire test assesses student performance in five areas covered by the ACT exam: English, math, reading, science and writing. Aspire Test is offered in the spring and fall seasons, the cost of the assessment tool depends on how many subjects you would like to measure and how often you want your student to be tested.

Learn more about Aspire Test on:

https://brainly.com/question/4469429

#SPJ7

PLZZZ HELP!!!!!!!
Select the correct answer.
Which of these examples best describes unit testing?
A.
The tester finds incorrect functionality on the home page.
B.
The login page does not accept existing user credentials.
C.
There is no database connectivity.
D.
The developer checks the loops in the procedure.
E.
Multiple users slow down the speed of the system.

Answers

Answer: A is the correct choice.

The option that is an example that describes unit testing is the developer checks the loops in the procedure.

What is unit testing?

This type of test is known to be called unit component. It is regarded as a form of a single function or code of any kind of application.

Conclusively, A good example that tells more about unit testing is the when a developer monitors the loops in the procedure so as to see if there is any error or omissions.

Learn more about unit testing  from

https://brainly.com/question/24964187

to be useful for most household applications, DC voltage is?please

Answers

Answer: To be useful for most household applications, DC voltage is passed through a step-down transformer.

Explanation: Voltage coming through AC or DC outlets is typically far too high for most household appliances to handle, so the current is passed through a step-down transformer to reduce the voltage to a usable level.

3. Comparing the Utopian and dystopian views of Technology according to Street (1992) which one in your view is more applicable to your society?

Answers

Answer:

The answer is below

Explanation:

The Utopian views of technology, according to Street 1992, describe society to be in good condition in terms of politics, laws, customs, ways of life. Hence, the system is designed to improve the community for the better.

In contrast, Dystopian is described as a society that is heavily controlled by some greedy, larger than life, apocalypse group of people or government, where the rights and freedoms of people are trampled upon, thereby leading to all sorts of negativity such as suffering, poverty, intimidation, violence, disease, and break down.

The view that is more applicable to my society is the Utopia due to the following reason:

1. The people in my society accept the laid down rules and ideals. We also favor individuality and innovation.

2. My society is quite dynamic and improves over time to establish an ideal utopian world.

3. My society ensures some leaders carry the other individuals in the society along in whatever they do.

Label the following website navigation methods
according to their importance, where 1 is most
important and 3 is least important.

Site map:
Navigation menu:
Site search:

Answers

Answer:

Technology is very important

Answer:

Site map: 3

Navigation menu:1

Site search:2

Explanation:

CodeHS 6.3.8: Area of a Square with Default Parameters

Write a program that will calculate and print the area of a square where its side length is given by the user.

To compute the area, write a function named calculate_area that takes a single parameter, side_length. The parameter should be given a default value of 10.

If the user enters a length value of 0 or less, call calculate_area and use the default value. Otherwise, use the length value given as the parameter value.

For example, if the following input is given:

Enter side length: 0

The following output should be printed:

The area of a square with sides of length 10 is 100.​

Answers

The programming language is not stated. I will answer this question using Python.

The program in Python where comments are used to explain each line is as follows:

#This defines the function

def calculate_area(side_length):

#This check if the side length is 0 or less

   if side_length<1:

#If yes, the side length is set to 10

       side_length = 10

#This prints the area of the square

   print("The area of a square with sides of length",side_length,"is",(side_length**2))

#The main begins here

#This gets input for the length of the square

length = int(input("Enter side length: "))

#This calls the calculate_area function

calculate_area(length)

#The program ends here

At the end of the program, the area of the square is calculated and printed.

See attachment for a sample run

Read more about Python programs at:

https://brainly.com/question/22841107

Return the appropriate part of FizzBuzz This is a small part of a classic software engineering interview question. fizz_buzz_check takes a single integer argument, number. Complete the function such that it returns a value using the following rules: If the number is divisible by 3 (i.e division by 3 has a remainder of 0), return the string Fizz. If it is divisible by five, return the string Buzz. If it is divisible by 3 AND 5, return FizzBuzz. Otherwise, just return the original argument back without any changes.

Answers

Answer:

The function in Python:

def fizz_buzz_check(num):

   if num%3 == 0:

       result = "Fizz"

   if num%5 == 0:

       result = "Buzz"

   if num%3 == 0 and num%5 == 0:

       result = "FizzBuzz"

   if num%3 != 0 and num%5 != 0:

       result = num

   return result

Explanation:

The function to complete is not given. So, I write a new function from scratch.

This defines the function

def fizz_buzz_check(num):

This checks if num is divisible by 3

   if num%3 == 0:

If yes, the returned value is stored as "Fizz"

       result = "Fizz"

This checks if num is divisible by 5

   if num%5 == 0:

If yes, the returned value is stored as "Buzz"

       result = "Buzz"

This checks if num is divisible by 3 and 5

   if num%3 == 0 and num%5 == 0:

If yes, the returned value is stored as "FizzBuzz"

       result = "FizzBuzz"

This checks if num is not divisible by 3 and by 5

   if num%3 != 0 and num%5 != 0:

If yes, the returned value is stored as the initial argument

       result = num

This returns the appropriate value

   return result

Need help ASAP??? Pick the best answers

Answers

Answer:

A and C are correct pick both

What are some examples and non-examples of digital law?

Answers

Examples: Plagiarism. Illegal downloads - music, games, movies etc. Piracy. Stealing someone's identity.

Non-Examples: Sending Scams, Copyright Infringement, Sexting

-- of 5 points Question 3 1 try left While designing a new system, a company uncovered several processes that were quite rule-based, and that didn't really require staff to handle. The company chose to automate those processes using ___________________________ so they would no longer need to assign people to perform those tasks. A. code review B. robotic process automation C. application programming interfaces D. service-oriented architecture

Answers

Answer:

B. robotic process automation.

Explanation:

In the design of a new system, a company was able to uncover several processes that were typically rule-based, and which did not really require staff to control or handle.

Hence, the company chose to automate those processes using robotic process automation so they would no longer need to assign people to perform those tasks.

how do you think the blitz might have affected civilian morale in london

Answers

Answer:

It would have seriously negatively affected civilian morale in London. Hearing about the horrors of the war even from far away does a number on morale. This, however, was not exactly the case for London in WWII, because even as air raids were executed on the city, the citizens, confined to underground bomb shelters, still managed to pull together and keep morale high, causing London NOT to plunge into chaos, but to stand united against Germany.

⚠️⚠️⚠️⚠️HELP - What is the software that allocates resources of a physical computer to a virtual machine?
Group of answer choices

Switch

Operating systems

Hypervisor

HostVM

Answers

Answer:

the answer is going to be hostvm

An array stores data using multiple variable names.

True

False

Answers

Answer: False

Explanation:

It is false that an array stores data using multiple variable names, as it may not as, for starters, an Array cannot store multiple types of variable values. A container object that holds a fixed number of single-type values is known as an array.

What is an array?

A data structure that stores a collection of elements of the same data type under a single variable name is known as an array.

The index number, which is an integer value that represents the element's position within the array, is used to access it.

In other words, an array stores multiple values of the same data type in contiguous memory locations using a single variable name.

For starters, we cannot store multiple types of variable values in an Array. An array is a container object that holds a fixed number of single-type values.

Thus, the given statement is false.

For more details regarding an array, visit:

https://brainly.com/question/19570024

#SPJ3

All changes
1.(01.01 LC)
To make sure you do not get too tired when using the computer for long periods of time, how often should you get up to stretch and move? (5 points)
O Every hour
O Every 10 minutes
O Every 30 minutes
O Every two hours

Answers

You should get up and move every 30 minutes

Hope  this helps

-scav

Answer:

C

Explanation:

PLZZ HELP!!!
Select the correct answer.
Brian’s team has built a new application based on the client’s requirements. They will deploy this application in multiple locations on the client side. Brian is unsure about the hardware and software specifications at the client side. Which option will help him best solve this issue?
A.
creating multiple test scripts
B.
automating test scripts
C.
creating multiple test plans
D.
creating multiple test environments
E.
communicating with the development team

Answers

Answer: Option D creating muiltiple test enviroments

Explanation: I had the same question and I hope this helps ( :

The option that will help Brain best solve this issue is by creating multiple test environments.

What is the specification of software?

A software requirements specification (SRS) is known to be a type of requirement that are often written in a document that tells more about what the software can do.

Hence in the above scenario, what will help help Brain best solve this issue is by creating multiple test environments where the client can see a demonstration and be convince in getting the product.

Learn more about application from

https://brainly.com/question/24847617

What information will you find in the 16-bit field in an IP datagram?

Answers

Answer: This 16-bit field defines the entire packet size in bytes, including header and data. The minimum size is 20 bytes (header without data) and the maximum is 65,535 bytes. All hosts are required to be able to reassemble datagrams of size up to 576 bytes, but most modern hosts handle much larger packets.

Explanation: Hopefully this helps you with what ever u are doing.

An information which you will find in the 16-bit field in an IP datagram is: the total length of the datagram it's attached to.

An IP address is an abbreviation of internet protocol address and it can be defined as a unique number assigned to a computer or other network devices such as routers, switches, etc., in order to differentiate each device from one another in an active network system. Thus, an IP address is typically used to uniquely identify each computer or network device connected to the internet or an interconnected network.

In Computer networking, IP address are classified into two (2) main categories and these are;

Local (internal) IP address.Global (external) IP address.

An IP datagram can be defined as the standard format of data that an internet protocol (IP) recognizes.

Generally, an IP datagram comprises two (2) main components and these include:

1. The header: it is used for sending messages on a computer to the protocol in the same layer of a destination (recipient) computer.

2. The data: this is a set of information that is transmitted from one computer to another over an interconnected network.

On a related note, an IP datagram contain three (3) fields which are typically used for the transmission of data;

Header length.IP version.Total length.

The Total length is a field that is used to specify the total length of an IP datagram and it is typically 16-bits in size.

In conclusion, an information which is found in the 16-bit field in an IP datagram is the total length of the datagram it's attached to.

Find more information here: https://brainly.com/question/19204809


3. Java is Platform Independent. This means;
A. Java can run on any OS
need an OS to run
C. Java requires more than one OS to run
portable
D. Java is not
B. Java does

Answers

A . I hope this is right

Answer:

Java can run on any OS

need an OS to run

Which one of the following is NOT a use of a database? sales statement patient list customer list inventory list

Answers

Answer:

a sales statement

Explanation:

From the different options provided, the only one that is not a use of a database would be a sales statement. These statements usually made at the end of the month or year which detail the companies' entire sales amount for that given time period. These hold alot of information but are mainly created once every cycle so there is never a need to use a database for such files. Also, these statements are rarely modified or requested so database usage would be wasted.

Why data mining is crucial for the success of a business, explain with examples

Answers

Answer:

For businesses, data mining is used to discover patterns and relationships in the data in order to help make better business decisions. Data mining can help spot sales trends, develop smarter marketing campaigns, and accurately predict customer loyalty.

Justify any FOUR significant factors to remember when installing your motherboard

Answers

Answer:

The answer is below

Explanation:

When a computer system is being assembled by individuals or to provide a repair. There are factors to remember when installing your motherboard. Some of them include:

1. RAM (Random Acess Memory) support: Ensure the RAM of the PC supports the motherboard capacity.

2. Main Use of the PC: The motherboard to be installed on a PC should be based on the regular usage of the PC.

3. Compatibility with the operating system of the PC is essential. This will allow you to check if it will work well with PC without a glitch

4. Cost of the motherboard: it is advisable to go for a motherboard that can deliver value even if it is somehow expensive.

which of the following is an example of bias in media?
A. a website that represents a controversial opinion as though it were fact
B. a television news program that presents both sides of a particular issue
C. a podcast expressing an authors opinion
D. a blog about the history of the civil war

Answers

Answer is A because stating a opinion as a fact is bias.

a website that represents a controversial opinion as though it were fact because stating a opinion as a fact is bias.

What is Website?

A website is a group of interconnected, publicly accessible Web pages with a common domain name. A website can be developed and maintained to serve a variety of objectives by an individual, group, company, or organization.

The World Wide Web is made up of all websites that are open to the public.

Although it is occasionally referred to as a "web page," this description is incorrect because a website is made up of multiple webpages. A "web presence" or simply "site" are other names for websites.

Therefore, A website that represents a controversial opinion as though it were fact because stating a opinion as a fact is bias.

To learn more about Website , refer to the link:

https://brainly.com/question/29777063

#SPJ2

HELP! WILL GIVE BRANLIESt!

Answers

Answer:

36:12, 36/12, 3/1

Explanation:

I’ve never solved a problem like this but mathematically this answer makes sense

Evaluate the following information that shows the projected change in employment from 2014-2024: How can job seekers use the chart? Add data to a résumé and cover letter Gain awareness of how growth trends can impact career plans Research which careers match current skills Talk to community members in a knowledgeable manner You must check the box below prior to submitting your exam! Check this box to indicate you are ready to submit your exam Submit Exam FDK191.10

Answers

Answer:

Answer is B.

Gain awareness of how growth trends can impact career plans

Explanation:

5) Write a program to read text to end-of-file, and print a count of word lengths, i.e. the total number of words of length 1 which occurred, the number of length 2, and so on. Define a word to be a sequence of alphabetic characters. You should allow for word lengths up to 25 letters. A typical output should be like this: length 1 : 10 occurrences length 2 : 19 occurrences length 3 : 127 occurrences length 4 : 0 occurrences length 5 : 18 occurrences

Answers

Answer:

Explanation:

The following code is written in Python. It is a function that takes in the name of the file to be read and the size of the word. Then the function reads the file, removes whitespace and commas, splits the text into words, and scans the words for all the words that have the same length as the number passed. It counts all those words and prints out the number of occurrences of words of that length.

def countOccurrences(file_name, word_size):

   f = open(file_name, 'r')

   text = f.read()

   text = text.replace(',', '')

   split_text = text.split(' ')

   occurrences = 0

   for word in split_text:

       if len(word) == word_size:

           occurrences += 1

   print("Length 1: " + str(occurrences) + " occurrences")

Can someone plz answer these questions plz

Answers

Answer:

ñbyte I'm pretty sure, sorry if u get it wrong you should do more research about the question if i get it wrong!!

Other Questions
Which statement best describes the relationship between childrenand temporary role-reversal? A Occasional role-reversal allows children to experience what futurerelationships and duties will be like, making them appreciate theircarefree childhood even more.B Role-reversal is a crucial part of a child's development, preparing them for when they will eventually have to take care of, or "parent," their own parents/elders.c Occasional role-reversal allows children to experience what future relationships and duties will be like, preparing their eventual transition into adult life.D If it is initiated by the child and not forced, role-reversal can be a fun activity and change for children. I NEED HELP ASAP PLZZZZ i dont get it plz help New classical economists say that an unanticipated increase in aggregate demand first: Group of answer choices increases the price level and real output, and then reduces short-run aggregate supply such that the economy returns to the full-employment level of output. increases the price level and real output, and then increases long-run aggregate supply. increases long-run aggregate supply, and then increases the price level and real output. reduces short-run aggregate supply, and then reduces long-run aggregate supply. Determine which molecule in each pair has the stronger intermolecular forces. Explain why. The main reason that NH3 has [ Select ] intermolecular forces than CH4 is that NH3 [ Select ] . The main reason that NO2 has [ Select ] intermolecular forces than CO2 is that NO2 [ Select ] . The main reason that CS2 has [ Select ] intermolecular forces than CO2 is that CS2 [ Select ] . you are charged 6% salex tax. You purchase a new bicycle and pay $27 in sales tax what is the purchase price of the bicycle Please Help!!One of the longer sides of a kite is 39 feet. One of the shorter sides is 25 feet. Half the length of the shorter diagonal is 15 feet. what is the area of the kite? (Round to whole if necessary) letter of complaint of washing machine find the value of each variable Why was he FDR so popular? What was one failing of the Brown v. Board of Education ruling What is the value of the expression below? 8 + 24 / 2 X 6 - 4the answer is 76 but i just need to know the step by step explanation Which equation represents a double replacement reaction? A) 2Al(s) + 6HCl(aq) 2AlCl3(aq) + 3H2(g) B) 2Al(s) + 3Cl2(g) - 2AlCl3(s) C) 2AlCl3(s) + 2Al(s) + 3Cl2(g) D) AlCl3(aq) + 3KOH(aq) - Al(OH)3(s) + 3KCl(aq) What does the point of view of this excerpt help the reader understand? The winter hibiscus After stepping into your room with unusual lighting Michaels pupil has a diameter of 6 millimeters.What is the pupils radius HELP I NEED HELP ASAP HELP I NEED HELP ASAP HELP I NEED HELP ASAP HELP I NEED HELP ASAP HELP I NEED HELP ASAP HELP I NEED HELP ASAP What is the y-intercept of the line graphed on the grid?(9,2)(-5,-5)Help pleaseeee besties please help me with my science will give brainlest help asap 2 question, please dont answer just for points :( what was the mission or goal of the whitecaps? TrigonometryHELP ASAP !