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 cell reference is also called a cell _______.
viva [34]
A cell reference is also called a cell address.
7 0
3 years ago
What is the term used to describe the basic unit of data passed from one computer to another
irinina [24]

Answer:

The term used to passed one computer to another is called a packet

8 0
3 years ago
Once Raul selects a technology solution, he has completed the process. <br> a. True<br> b. False
romanna [79]
The answer is true because choosing a technology solution is the last step
7 0
3 years ago
Read 2 more answers
Which of the following is another term for a subfolder?
LenKa [72]
Subdirectory

Have a great day! c:
5 0
3 years ago
A client computer networked to a server computer, with processing split between the two types of machines, is called a(n) ______
butalik [34]
<span>Two-tiered client/server architecture. The two-tier is based on Client Server architecture. The two-tier architecture is like client server application. The direct communication takes place between client and server. There is no intermediate between client and server. Because of tight coupling a 2 tiered application will run faster</span>
6 0
3 years ago
Other questions:
  • You have been hired to upgrade a network of 50 computers currently connected to 10 mbps hubs. this long-overdue upgrade is neces
    12·1 answer
  • What is the 7 X 7 when referring to PowerPoint presentations?
    12·2 answers
  • Under what circumstances are composite primary keys appropriate?
    5·1 answer
  • Nathan wants to create multiple worksheet containing common formatting styles for his team members. Which file extension helps h
    9·1 answer
  • Consider a system consisting of m resources of the same type, being shared by n processes. Resources can be requested and releas
    13·1 answer
  • What are the benefits of using an ordered list vs. an unordered list? What are the costs?
    10·1 answer
  • Reading a news release about a product is an example of <br> research.
    9·1 answer
  • நெறி என்னும் சொல்லின் பொருள்___ *​
    14·1 answer
  • What does the following code print? time_of_day = ["morning", "afternoon", "evening"] for word in time_of_day: print "Good " + w
    15·1 answer
  • // This pseudocode is intended to describe
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!