Computers and Technology

Write a marie program to calculate some basic statistics on a list of positive numbers. the program will ask users to input the numbers one by one. assume that all numbers will be in the range 1 to 1000. to terminate the data entry, user will input any negative number. once the data entry is complete, the program will show four statistics about the list of numbers: (1) count (2) minimum value (3) sum of numbers (4) "mean/average" calculation.

as an example, if the user enters the following decimal numbers as input (one after the other)

23, 6, 78, 36, 3, 250, 127, 210, –5

the program would output the following values as the count, minimum, sum and mean respectively:

8
3
733
91

the average is calculated by dividing sum by count. note that marie does not support floating point numbers, hence the result of division will only have the integer part (as shown in above example, average is 91 instead of 91.625)

a simple algorithm for implementing division in marie is shown below.

let x = dividend, y = divisor, z = quotient (result) of division.

set initial z to 0
while x > y, do
set x to (x – y)
increase z by 1
endwhile

assume that the user will always provide valid numbers as input, that is, do not worry about dealing with invalid input data.

write comments within your program so that a reader can understand it easily.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 22:00, delawdermia27
Researchers measured the data speeds for a particular smartphone carrier at 50 airports. the highest speed measured was 78.1 mbps. the complete list of 50 data speeds has a mean of x overbarequals16.11 mbps and a standard deviation of sequals18.65 mbps. a. what is the difference between carrier's highest data speed and the mean of all 50 data speeds? b. how many standard deviations is that [the difference found in part (a)]? c. convert the carrier's highest data speed to a z score. d. if we consider data speeds that convert to z scores between minus2 and 2 to be neither significantly low nor significantly high, is the carrier's highest data speed significant? a. the difference is nothing mbps.
Answers: 3
image
Computers and Technology, 23.06.2019 00:50, AmbitiousAndProud
Representa os dados de um banco de dados como uma coleç? o de tabelas constituídas por um conjunto de atributos, que definem as propriedades ou características relevantes da entidade que representam. marque a alternativa que representa o modelo descrito no enunciado. escolha uma:
Answers: 3
image
Computers and Technology, 23.06.2019 18:00, joybeth9591
What can a word user do with the customize ribbon dialog box? check all that apply. minimize the ribbon add a new tab to the ribbon remove a group from a tab add a group to a tab choose which styles appear choose which fonts appear choose tools to appear in a group
Answers: 1
image
Computers and Technology, 23.06.2019 23:30, issacurlyheadka
A. in packet tracer, only the server-pt device can act as a server. desktop or laptop pcs cannot act as a server. based on your studies so far, explain the client-server model.
Answers: 2
Do you know the correct answer?
Write a marie program to calculate some basic statistics on a list of positive numbers. the program...

Questions in other subjects:

Konu
Physics, 20.01.2021 14:20
Konu
History, 20.01.2021 14:20