subject
Computers and Technology, 10.03.2020 19:01 Seaport

Write two versions of a program that reads a sequence of positive integers from the user, calculates their geometric mean, and print the geometric mean. Note: In mathematics, geometric mean of a dataset {a1, a2, a3 ..., an} is given by: a1 For example, the geometric mean of 2,9 and 12 is equal to 6 (V2 -9 12 = Your two versions of the program should read the integer sequence in two ways:

a) First read the length of the sequence For example, an execution would look like: Please enter the length of the sequence: 3 Please enter your sequence: a2 a3 an 6). 1 2 3 The geometric mean is: 1.8171
b) Keep reading the numbers until 'done' is entered. For example, an execution would look like: Please enter a non-empty sequence of positive integers, each one in a separate line. End your sequence by typing done: 1 2 3 done The geometric mean is: 1.8171

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 12:30
An atom's diameter is about 0.1 nanometer (1×10-9m), and a human hair is about 1×10-3m. how many times greater is a human hair than an atom's diameter? sorry pushed wronf button but this is math
Answers: 3
question
Computers and Technology, 22.06.2019 19:20
Amedian in the road will be marked with a white sign that has a black arrow going to the left of the median. true false
Answers: 1
question
Computers and Technology, 22.06.2019 20:40
Write a program that begins by reading in a series of positive integers on a single line of input and then computes and prints the product of those integers. integers are accepted and multiplied until the user enters an integer less than 1. this final number is not part of the product. then, the program prints the product. if the first entered number is negative or 0, the program must print “bad input.” and terminate immediately. next, the program determines and prints the prime factorization of the product, listing the factors in increasing order. if a prime number is not a factor of the product, then it
Answers: 2
question
Computers and Technology, 23.06.2019 16:30
20 points archie wants to use a reflector as he photographs a newlywed couple. what would he consider in his choice? a. shadow and sunny b. homemade and professional c. lamps and boards d. incident and reflected e. neutral density and enhancement
Answers: 3
You know the right answer?
Write two versions of a program that reads a sequence of positive integers from the user, calculates...
Questions
question
Mathematics, 02.03.2021 02:10
question
Social Studies, 02.03.2021 02:10
question
Chemistry, 02.03.2021 02:10
question
Mathematics, 02.03.2021 02:10
question
Business, 02.03.2021 02:10
question
Geography, 02.03.2021 02:10