1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
jeka94
4 years ago
5

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.
Computers and Technology
1 answer:
motikmotik4 years ago
5 0

Answer:

a=[23,6,78,36,3,250,127,210,-5]

i = len(a) # calculate length

j = min(a) # calculate minimun

k = sum(a) # calculate sum

l= sum(a)/len(a)  # calculate mean

print(i)

print(j)

print(k)

print(l)

z = 0.0

i=0

x=[23,6,78,36,3,250,127,210,-5]

y = int(l)

while x[i] < y:  

   z= int(x[i]/y)

   print(z)

   x[i] = x[i] - y

   z=z+1

   i=i+1

Explanation:

So above we have calculated Count, minimum, sum and mean/average. Also we did a simple division and printed quotient.

You might be interested in
A(n) ____________________ can improve system performance when two devices have different data transfer rates, as when copying mu
defon

Hello there

the answer to the question is

<u><em>Buffer</em></u>

hope this helps

Best Regards Queen Z

8 0
3 years ago
What is the least number of bits you would need to borrow from the network portion of a Class B subnet mask to get at least 130
Tatiana [17]

Answer: Eight

Explanation:

A class B address is 255.255.0.0. We need to borrow 8 bits from the network portion to have atleast 130 host per subnet.

11111111.00000000.00000000.00000000

8 0
3 years ago
Can someone start me off with a short 2 or 3 paragraphs about the pros and cons of Microsoft Word, and if you can recommend a si
Romashka-Z-Leto [24]
Microsoft Word is an overall very good application. It can be easily used with other Microsoft products, such as PowerPoint and Excel. However, there are some cons.

The spelling and grammar check is widely considered not very good. It does pick up many spelling errors, but many grammar errors are either not noticed, or are incorrectly noticed - it may say that you have made an error when you have not.
7 0
3 years ago
If the algorithm does not have instructions for unanticipated results, the computer program will
bixtya [17]
ANSWER: The computer program will ✔ halt . A(n) ✔ recipe is an algorithm.

BRAINLIEST please and good luck!
7 0
3 years ago
If you see someone harassing someone else online you should ​
Sever21 [200]

Try to say something yourself, but if you are too scared, get an adult involved. The one bad thing you could do is ignore it.

4 0
4 years ago
Read 2 more answers
Other questions:
  • In older systems, often the user interface mainly consisted of ____-control screens that allowed a user to send commands to the
    11·1 answer
  • 6. When should you return to the right lane after passing another car on the left?
    14·2 answers
  • Using truth table, prove that:<br><br> (A + B). C = (A . C)+ (B .C) ?
    7·1 answer
  • With a DUI charge on a driver’s record A. the price of his/her insurance greatly increases. B. he/she may drive only during day
    5·2 answers
  • When an object is acted on by unbalanced forces, the object will always
    11·1 answer
  • Font size means the height of characters.<br>True<br>False​
    11·1 answer
  • Simplify the expression 7(2y + 1) + 3y
    10·2 answers
  • 7 TH GRADE QUESTION...PLS HELP
    12·2 answers
  • What (if any) are the same feature requirements that might be found in server software/OS environments
    10·1 answer
  • ________ involves disconnecting individual users from their selected internet service providers and redirecting them to illegiti
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!