Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering 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.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92178299
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Question after you have analyzed the existing material used

Question: After you have analyzed the existing material used by the company for their day-to-day duties, the current Access database, and the additional requirements that the current system does not meet, the following r ...

Sql transactions exercisesfor the universal relation rwxyz

SQL Transactions Exercises For the universal relation R(w,x,y,z), consider the decomposition D consisting of R1(w,y,z) and R2(x,y), and the set F of functional dependencies { y->xz ; yz->w ; x->w }. Recall that the proje ...

Question the sunshine health corporation would like you to

Question : The Sunshine Health Corporation would like you to provide an updated explanation and reference guide on 802.11 standards and specifications. Briefly explain the advantages and disadvantages of each. If you loc ...

Respond to the followingin a bst what is the complexity

Respond to the following: In a BST, what is the complexity required to remove the minimum element? In a BST, what is the complexity required to find (but not remove) the minimum element? In a heap, what is the complexity ...

Subject digital securityprovide an fidm authentication

Subject : Digital Security Provide an FIdM authentication system that you have used (being subjet to). Tell the name of the organizations acted as the IdP (Identity Provider) and SP (Service Provider)?

Question suppose you have a set of n project managers and

Question : Suppose you have a set of N project managers and 2N software engineers. Each project manager is only willing to work with certain software engineers. The software engineers have no preferences. Design an algor ...

Can someone answer this c questionimplement a base class

Can someone answer this C++ question? Implement a base class Person. Derive classes Student and Instructor from Person. A person has a name and a birthday. A student has a major, and an instructor has a salary. Write the ...

Q1 the market for apples is perfectly competitive say a

Q1. The market for apples is perfectly competitive. Say a typical firm has a marginal cost function of MC(q) = 2q. (1) The optimal quantity of apples to produce is 10 for the typical firm. How much revenue does the firm ...

Question consider how deming and tqm would have dealt with

Question: Consider how Deming and TQM would have dealt with (or avoided) the problems at Boeing. What does a TQM initiative look like in an IT department? How would IT support Total Quality at Boeing? The response must b ...

Shell scripting -- linuxpart-1 write a script that asks the

Shell Scripting -- Linux Part-1 Write a script that asks the user to enter his name. Read the name. Then asks the user to enter the phone number. Then read the phone number. Append the name and phone number (separated by ...

  • 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