subject

Using vectors: Create a vector of integers of size 100, with random numbers ranging from 1 to 50. Print out these 100 numbers in a readable format. Find the average of these 100 numbers, print out the overall average. Then take the original list of 100 numbers, and find all the numbers that are between 1 and 30 and put them into a new vector. Do the same with all the numbers from 31 to 50 putting them into a third vector. Find the average of vectors 2 and 3 and call them avg1 and avg2. Print out avg1 and avg2. Find the average of avg1 and avg2. Write a final output line showing/comparing the average from step 3 and the average from step 7 are not the same, and hence the average of averages doesn't work. You have just proved a mathematical theorem.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 01:50
Write a program that uses a random number generator to generate a two digit positive integer and allows the user to perform one or more of the following operations: a. double the number. b. reverse the digits of the number. c. raise the number to the power of 2, 3, or 4. d. sum the digits of the number. e. if the number is a two-digit number, then raise the first digit to the power of the second digit. f. if the number is a three-digit number and the last digit is less than or equal to 4, then raise the first two digits to the power of the last digit. after performing an operation if the number is less than 10, add 10 to the number. also, after each operation determine if the number is prime. each successive operation should be performed on the number generated by the last operation. your program should not contain any global variables and each of these operations must be implemented by a separate function. also, your program should be menu driven. 7. (fraction calculator) write a program that
Answers: 1
question
Computers and Technology, 23.06.2019 06:00
Which statement is true of web-based social media? a.they allow consumers to interact with and update content. b.they cannot be updated easily, as compared to print media. c.they are expensive to produce and maintain, as compared to print and television. d.they can exist independent of the internet.
Answers: 1
question
Computers and Technology, 23.06.2019 15:30
The processing of data in a computer involves the interplay between its various hardware components.
Answers: 1
question
Computers and Technology, 23.06.2019 18:00
Apunishment or the threat of punishment used to enforce conformity. select the best answer from the choices provided t f
Answers: 1
You know the right answer?
Using vectors: Create a vector of integers of size 100, with random numbers ranging from 1 to 50. Pr...
Questions
question
Mathematics, 16.09.2020 06:01
question
Mathematics, 16.09.2020 06:01
question
English, 16.09.2020 06:01
question
Mathematics, 16.09.2020 06:01
question
Mathematics, 16.09.2020 06:01
question
Mathematics, 16.09.2020 06:01
question
Mathematics, 16.09.2020 06:01
question
Mathematics, 16.09.2020 06:01
question
Mathematics, 16.09.2020 06:01
question
Physics, 16.09.2020 06:01
question
Mathematics, 16.09.2020 06:01
question
Mathematics, 16.09.2020 06:01
question
Mathematics, 16.09.2020 06:01
question
Mathematics, 16.09.2020 06:01
question
Mathematics, 16.09.2020 06:01
question
Mathematics, 16.09.2020 06:01
question
Mathematics, 16.09.2020 06:01
question
Social Studies, 16.09.2020 06:01
question
Mathematics, 16.09.2020 06:01
Questions on the website: 13722363