Computers and Technology, 25.01.2020 06:31 rindragon8231
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.
Answers: 1
Computers and Technology, 22.06.2019 16:00
If a client wants to make minor edits, what should he/she use?
Answers: 3
Computers and Technology, 22.06.2019 19:00
If your accelerator suddenly gets stuck what should you do
Answers: 2
Computers and Technology, 23.06.2019 06:00
Respond to the following in three to five sentences. select the workplace skill, habit, or attitude described in this chapter that you believe is most important for being a successful employee.
Answers: 1
Computers and Technology, 23.06.2019 14:30
The option enables you to modify a slide element in most presentation applications.
Answers: 2
Write a marie program to calculate some basic statistics on a list of positive numbers. the program...
English, 09.08.2021 20:40
Chemistry, 09.08.2021 20:40
Mathematics, 09.08.2021 20:40
Social Studies, 09.08.2021 20:40
Physics, 09.08.2021 20:40
Mathematics, 09.08.2021 20:40
Mathematics, 09.08.2021 20:40
Geography, 09.08.2021 20:40