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
Rzqust [24]
3 years ago
11

Write a program that can be used to gather statistical data about the number of movies college students see in a month. The prog

ram should ask the user how many students were surveyed and dynamically allocate an array of that size. The program should then allow the user to enter the number of movies each student has seen. The program should then calculate the average, median, and mode of the values entered. Be sure to including comments throughout your code where appropriate.
Computers and Technology
1 answer:
DochEvi [55]3 years ago
7 0
Bet ... a program that can be used to gather statistical data about the number of movies college students see in a month. The program should ask the user how many students were surveyed and dynamically allocate an array of that size. The program should then allow the user to enter the number of movies each student has seen. The program should then calculate the average, median, and mode of the values entered. Be sure to including comments throughout your code where appropriate.
You might be interested in
1.Write the Qbasic program to find sum of any 10 different numbers.
dybincka [34]

Answer:

1.

DIM myArray(10) as INTEGER

LET A = 0

FOR I = 1 TO 10 STEP 2

INPUT “INPUT NUMBER”; myArray(i)

LET A = A + myArray(i)

NEXT  

PRINT A

END

2.

REM PROGRAM FOR CALCULATING THE SIMPLE INTEREST

CLS

INPUT “INPUT THE PRINCIPAL”; P

INPUT “INPUT THE TIME”; T

INPUT “INPUT THE RATE”;R

SI = P* T * R / 100

PRINT “SIMPLE INTEREST =”; SI

END

Explanation:

Please find the respective programs in the answer section.

4 0
3 years ago
Write a function get_initials(the name) that takes a string of a name and returns the initials of the name, in upper case, separ
spayn [35]

Answer:

Following are the code to this question:

def get_initials(the_name): #defining a method get_initials

   name = the_name.split(" ") #defining name variable that splits value

   val = ''#defining a string variable val  

   for n in name:  #defining loop to convert value into upper case and store first character

       val = val + n[0].upper() + "."  # use val variable to hold value

   return val # return val

print(get_initials("Gloria kind of a big deal Tropalogos"))#call method and print return value

print(get_initials("Homer J Simpson"))#call method and print return value

print(get_initials("John Q Public")) #call method and print return value

Output:

J.Q.P.

H.J.S.

G.K.O.A.B.D.T.

Explanation:

In the given code, the last is incorrect because if we pass the value that is "Gloria kind of a big deal Tropalogos" so, will not give G.O.O.D. instead of that it will return G.K.O.A.B.D.T.  So, the program description can be given as follows:

  • In the given python code, a method "get_initials" is declared, that accepts "the_name" variable as a parameter, inside the method "name" variable is declared, which uses the split method that splits all values.
  • In the next step, a string variable "val"  and for loop is used, in which the "val" variable converts the first character of the string into the upper case and stores its character with "." symbol in "val" variable and return its value.
  • In the last step, the print method is used, that passes the string value and prints its sort value.
3 0
4 years ago
The first and second numbers in the Fibonacci sequence are both 1. After that, each subsequent number is the sum of the two prec
vlabodo [156]

Answer:

In Python:

def fib(nterms):

   n1, n2 = 1, 1

   count = 0

   while count < nterms:

       term = n1

       nth = n1 + n2

       n1 = n2

       n2 = nth

       count += 1

   return term

Explanation:

This line defines the function

def fib(nterms):

This line initializes the first and second terms to 1

   n1, n2 = 1, 1

This line initializes the Fibonacci count to 0

   count = 0

The following while loops gets the number at the position of nterms

<em>   while count < nterms: </em>

<em>        term = n1 </em>

<em>        nth = n1 + n2 </em>

<em>        n1 = n2 </em>

<em>        n2 = nth </em>

<em>        count += 1 </em>

This returns the Fibonnaci term

   return term

7 0
3 years ago
When you download a file from the internet where should you go to find it?.
Gnom [1K]

Answer:

your downloads

Explanation:

6 0
2 years ago
A batholith is an example of a(n) _____ igneous rock (one of the two main igneous rock groups).
Naily [24]
A batholith is an intrusive igneous rock.
3 0
4 years ago
Read 2 more answers
Other questions:
  • What three characteristics of a function are described in an IPO chart? What is performed at each characteristic?
    12·1 answer
  • A network in which communication passes from one person to another in a sequential pattern rather than being shared among member
    6·2 answers
  • If the polar bear were taken out of the food chain what would happen to the seal population
    10·1 answer
  • Explain in two or three sentences why health science careers are among the fastest growing careers in
    9·1 answer
  • Worksheet titles and subtitles should be as wordy as possible.<br> a. True<br> b. False
    9·2 answers
  • How is a geometric constraint different from a numeric constraint?
    12·1 answer
  • Please write a complete program to calculate monthly payment given
    15·1 answer
  • Which of the following options allow you to access a computer remotely? Check all that apply.
    10·1 answer
  • Which of the following art forms gained in popularity during the Renaissance?
    10·2 answers
  • X = 19 y = 5 print (x % y)
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!