Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Business Economics Expert

PROGRAM A: This program should use a main function and another function named makelist as follows:

  • in main, generate a random integer that is greater than 5 and less than 13.
  • print this number on its own line.
  • call the makelist function with the random integer as sole argument.
  • inside the makelist function:
    • make an empty list.
    • use a loop to append to the list a number of elements equal to the random integer argument. All new list elements must be random integers ranging from 1 to 100, inclusive. Duplicates are okay.
    • return the list to main.
  • back in main, catch the returned list and sort it.
  • finally, use a for loop to display the sorted list elements, all on one line, separated by single spaces.

SAMPLE OUTPUT
List size will be 7
Here is the sorted list:
8 28 35 41 51 62 72

ANOTHER SAMPLE OUTPUT
List size will be 10
Here is the sorted list:
3 3 9 20 36 43 48 50 81 93

PROGRAM B:
Use the text file named scores.txt (supplied). It contains a number of integer test scores, one per line. Your program should use a main function and another function named showscores as follows:

  • in main, create an empty list.
  • open the file named scores.txt.
  • use awhile loop that can detect the end of fileto read the scores, and add them to the list.
  • close the file.
  • call the showscores function with the list of scores as sole argument.
  • inside the showscores function:
    • process the list of scores.
    • NOTE: your instructor will use a modified version of scores.txt with different scores and a different number of scores. Your code should be capable of handling this.
    • print out the average score accurate to two decimal places.

Business Economics, Economics

  • Category:- Business Economics
  • Reference No.:- M92170773
  • Price:- $10

Priced at Now at $10, Verified Solution

Have any Question?


Related Questions in Business Economics

In 2009 the hershey company of pennsylvania became the

In 2009, the hershey company of pennsylvania became the latest company to open a candy factory in mexico, joining other american candy companies including brach's confections and ferrara pan candy, which had opened plans ...

An instrument is made up of 3 parts an upper part a middle

An instrument is made up of 3 parts: an upper part, a middle part and a lower part. the instrument is then assembled. 6% of the upper parts are defective, 3% of the middle parts are defective, and 2% of the lower parts a ...

What is the role of local government leadership in assuring

What is the role of local government leadership in assuring that departments and divisions work together to achieve municipal goals and objectives?

In a survey of 2936 adults 1431 say they have started

In a survey of 2936 adults, 1431 say they have started paying bills online in the last year. Construct a 99% confidence interval for the population proportion. A 99% confidence interval for the population proportion is ( ...

Why would a policy of re-importation of prescription drugs

Why would a policy of re-importation of prescription drugs be ineffective?

Suppose the cost function of making jackets is cx x2 -

Suppose the cost function of making jackets is C(x)= x^2 - 50x+1500. How many jackets should you make to minimize the cost of the jackets? How much would be the minimum cost?

What type of monopoly is sydney water describe the main

What type of monopoly is Sydney Water? Describe the main characteristics of this monopoly type in general and in relation to Sydney Water.

In a sample of phd students 80 have paid assistant-ships a

In a sample of PH.D students 80% have paid assistant-ships. A student is chosen at random from this sample. What is the probability that the student has a paid assistant-ships?

Why did prior to 1945 nearly all neoclassical economists

Why did prior to 1945 nearly all neoclassical economists agreed that democracy and capitalism were natural enemies?

Suppose that 1 of the employees of a certain company use

Suppose that 1% of the employees of a certain company use illegal drugs. This company performs random drug tests that return positive results 99% of the time if the person is a drug use. However, it also has a 2% false p ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As