write a c++ program: Create an array with 11 integers, which will be randomly selected from the range of 0 to 100. Print the items of the array on screen as one line. Develop a function that takes the array as argument and perform these operations: -Find the minimum of array items and replace (swap) with first item of the array. -Find the maximum of array items and replace (swap) with last item of the array. -Find the average of array’s items and assign it to middle location of the array. The average of numbers should be calculated as an integer. (hint: static_cast<int>(float))

Question

write a c++ program:

Create an array with 11 integers, which will be randomly selected from the range of 0 to 100. Print the items of the array on screen as one line. Develop a function that takes the array as argument and perform these operations: -Find the minimum of array items and replace (swap) with first item of the array. -Find the maximum of array items and replace (swap) with last item of the array. -Find the average of array’s items and assign it to middle location of the array. The average of numbers should be calculated as an integer. (hint: static_cast<int>(float))

Expert Answer

Want to see the step-by-step answer?

Check out a sample Q&A here.

Want to see this answer and more?

Experts are waiting 24/7 to provide step-by-step solutions in as fast as 30 minutes!*

*Response times may vary by subject and question complexity. Median response time is 34 minutes for paid subscribers and may be longer for promotional offers.
Tagged in
Engineering
Computer Science

Related Computer Science Q&A

Find answers to questions asked by students like you.

Q: Think of one of your Math homework. How can you use program to reveal the answer? Write a calculatio...

A: Variables in PHP: Variables are used to store values like numbers, characters etc. that is of differ...

Q: Python   1. Write a for loop (using the range() function) that will print the integers 10,15,20,25,3...

A: Program:#display the statementprint("The integers are: ") #iterate "i" in the range of 10 to 51 with...

Q: Find the truth table that describes the following circuit.

A: The diagram shown below is taken from the given question- 

Q: Assignment First, launch NetBeans and close any previous projects that may be open (at the top menu ...

A: Program: public class MultiTable{public static void main(String[] args){ int i, j; System.out.print(...

Q: What are the components of a function and how do I use it in a program?

A: In programming language there are two types of function one is build in type and the other is user-d...

Q: Double any element's value that is less than minValue. Ex: If minValue = 10, then dataPoints = {2, 1...

A: Completing the given C++ program so, that it can follow the given rubrics:The array is already decla...

Q: Given a nested list named NxN_table that represents a table with N rows and N columns, print each el...

A: Following Variables and functions has been used to solve this diagonal problem:Variables: N, i, tabl...

Q: How do I code this on python heres the problem  Use the Design Recipe to define a function count_val...

A: Programming instructions: Define the function count_value which takes the list and a value as an arg...

Q: 1.Write a program in C++ , to count the number of people in each of the following age groups: 0-16 (...

A: Following is the approach of the program to count the number of persons of different age groups:Decl...

Q: using the web resarch Mafiaboy's exploits. when and how did he comprmise sites? How was he caught?

A: Mafiaboy was arrested by the FBI, who was surveilling him, after he claimed to have brought down the...

Q: How do I write a line of code in Java to find how many numbers are below and above average ?

A: ⦁ Create two variables in the main method and initialize them with zero.⦁ Iterate the all numbers wi...

Q: program3_3.py in pythonWrite a wholly creative quiz program that consists of three original question...

A: The code consists of three inputs such as int, float and string for wholly creative quiz program. 

Q: One of the inital versions of the rules for an MLFQ scheduler was: “Rule 1: If Priority(A)&gt;Priori...

A: This problem is referred to as Starvation or Indefinite Blocking.Starvation: Starvation is the condi...

Q: PLEASE EXPLAIN ALL STEPSPredict the output of the following assembly language program if the input i...

A: Before explaining the difference first user must know about the Assembly languageAssembly language:A...

Q: Use the Design Recipe to write a function called my_sum  that consumes one parameter, assumed to be ...

A: The python program obeys the following rubrics:Defining a function my_sum which accepts a parameter,...

Q: 1. Write a program in Python named filemaker.py that will be used to store the first name and age of...

A: This python program asks user to enter First name and Age of a number of friends. This program name ...

Q: Translate the following pseudocode for finding the minimum value from a set of inputs.Set a Boolean ...

A: For solving this question first, we must know what pseudocode code is and what exactly question is a...

Q: Please make a k-map to simplify the given boolean equation (and list the final simplified expression...

A: Convert the given expression into SOP canonical form:= (Y~Z + ~YZ + ~Z) ~(X + Y) + ~(Y~Z + ~YZ + ~Z)...

Q: Siobhan’s laptop has 8GB of RAM. Her operating system takes up 2GB, and her application programs use...

A: Random Access Memory (RAM):RAM is a memory device used for storage purposes.The data stored in the m...

Q: Preffered language is java. Will be compiled with intellij. Need a solution for each part 1-5. Is it...

A: This program asks the user a question and tells whether the answer is correct or not. Keeps asking t...

Q: Write a program in Python that converts an improper fraction to a mixed number. The program should p...

A: Program:#Display the messageprint("Calculate Mixed Number")print("======================")print()#Pr...

Q: a. Show that the disk moves made in the classic recursive algorithm for the Towers of Hanoi puzzle c...

A: a.Disk moves for Tower of Hanoi puzzle The disk moves that are made in the classic recursive algorit...

Q: I need help with this programming exercise:   Write a C++ console application that allows your user ...

A: Before solving this problem our first duty is to understand what question is asking:Here user wants ...

Q: Add each element in origList with the corresponding value in offsetAmount. Print each sum followed b...

A: Completing the given C++ program so, that it can follow the given rubrics:Two vector, origList and o...

Q: DISCUSS CRYPTOCURRENCY WITH A SUITABLE EXAMPLE?

A: Cryptocurrency:Cryptocurrency refers to a digital asset that is derived for working as a medium of e...

Q: Too Many Networks While attempting to connect to the wireless network at your job, you notice that f...

A: Selecting the appropriate wireless network:The user can determine the wireless network to which he/s...

Q: Hi I am coding for java where I have to have 20 fibonacci numbers printed out 5 in a row. Then I nee...

A: In the given code, the statement “if(count==5)” is never gets “true” because , after printing each F...

Q: Consider the following information about a university database: Professors have an SSN, a name, an ...

A: Below is the ER Diagram based on the information given in the question about the university.

Q: I need help with this C++ problem.   What is the maximum number of comparisons that a binary search ...

A: A maximum number of comparisons will be done on the bases of a number, for example, a number must be...

Q: What is the forensic recovery process for files on a solid state drive?

A: Forensic recovery process is different from the other recovery processes, but it might produce the r...

Q: Algorithm problem w/ recurrence: Frying pancakes: a small pan can only hold two pancakes at a time. ...

A: Let T(n) be the time required to fry n pancakes on both the sides.Given condition:If n=1, time requi...

Q: Hello! I am new to Java and have nearly finished up a project involving a mortgage table, and everyt...

A: According to the question, students need only in output spacing.To display output in proper spacing ...

Q: Evaluate cloud computing in relation to each of these four (4) criteria Dependable Manageable Adapta...

A: DescriptionEvaluating cloud computing in relation to the following four criteria’s:DependableDependa...

Q: Consider partitioning the list {1,4,0,1,1,1,2,3,1,0,4,4,1,2,0,1} where the first element ofthe array...

A: Program description for part (A)The program for part A works by using two new arrays for the left an...

Q: PLEASE EXPLAIN ALL STEPS  In the following code, determine the values of the symbols this, that, and...

A: Before explaining the difference first user must know about the Assembly language.Assembly language:...

Q: Write down two approaches to reduce re-work cost. Inyour opinion how incremental delivery supports b...

A: The two approaches that are used to reduce re-work cost are as follows:Change toleranceChange avoida...

Q: Write a C++ program: A palindrome is a word that reads the same forwards and backwards for example "...

A: Program:#include&lt;iostream&gt;#include&lt;bits/stdc++.h&gt;using namespace std;void Palindrome_Che...

Q: Think of one of your Math homework. How can you use program to reveal the answer? Write a calculatio...

A: Take a math problem.Create a program to reveal the answer to that math problem.The program must have...

Q: Write a loop that reads positive integers from standard input and that terminates when it reads an i...

A: To check the condition that the number is positive and print the sum, count of even and odd integers...

Q: Preffered language is java. Will be compiled with intellij Problem 1 consists of multiple parts. You...

A: Since there are multiple questions and you have not specified which part needs to be answered, we ha...

Q: How do I start creating a program to shuffle and deal a deck of cards?  The program should consist o...

A: Program:Filename: Game.java package deckOfCards;import java.util.Scanner;public class Game {public s...

Q: Implement the following two methods in javascript:   String multiply2(String num) - return num*2 wit...

A: Program Instructions:In the function multiply2(), take one digit at a time, multiply it by two, and ...

Q: for C++ write a progam for the greatest common divisor of integers x and y is the largest integer th...

A: program to find the greatest common divisor of x and y.if x is 0 then answer is y.if y is 0 then the...

Q: First, launch NetBeans and close any previous projects that may be open (at the top menu go to File ...

A: Program:  import java.util.Scanner; public class AtmSimDoLoop{public static void main(String[] args)...

Q: WAHT IS A BYZANTINE GENERALS PROBLEM OF DIGITAL CASH TRANSACTIONS?

A: The Bitcoin protocol provides a means for digital currency transactions, so that everyone can decide...

Q: Python 3.7.4 The current calendar, called the Gregorian calendar, was introduced in 1582. Every year...

A: The following is the source code which takes the input from the user and tells whether the input yea...

Q: What is the new risk management framework initiative? How is it superior to the previous approach fo...

A: The New risk management framework initiative:It is the NIST special publication 800-37, this is the ...

Q: Create a new file (in Dev C++) and save it as lab7_XYZ.cpp (replace XYZ with your initials). In Lab ...

A: Code-#include&lt;iostream&gt;using namespace std; int main(){    cout&lt;&lt;"Hello\n";   int choice...

Q: Suppose you have two columns, [Text1] and [Text2], in a MS Access table, how do you enforcethat only...

A: Validation rule to have value in one column:[Text1] and [Text2] are the two columns in a MS access t...