Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Objective -

The purpose of this program is to generate random numbers, report total number created, how many were 15, 16, or 17 and report this information to the user.

You are required to use array, pointer and customised functions in this lab tutorial.

Description of the Problem -

Your program should contain the prototypes fillArray, count15s16sAnd17s, and writeResults functions. In your main function:

1. Create an array of 1000 integers in your main function.

2. The array is passed to a function named fillArray.

  • The function asks the user for the seed value and calls srand().
  • Next, it fills the array with random numbers that are within the range 10 to 50 inclusive-that is, the possible numbers are 10, 11, 12, ... 49, 50.
  • Use modulus arithmetic and simple arithmetic to adjust each of your random numbers to be within the given range.

3. From main, call a function named count15s16sAnd17s.

  • The function is passed your array of numbers.
  • The function goes through your array and counts the total number of 15's, 16's, and 17's that are in your array.
  • The function "returns" the total number of 15's, 16's and 17's.

4. Call a function named writeResults,

  • The function is passed the three total values (count of 15's, 16's, and 17's).
  • The function writes the three totals to the screen in a manner similar to what is shown below.

5. Do not have a "do another" loop. Your program will run this set of functions only once.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92063221

Have any Question?


Related Questions in Computer Engineering

Recall that a k-ary tree is a rooted tree where each node

Recall that a k-ary tree is a rooted tree where each node has up to k children (for some positive integer k). (a) Write a recursive definition of a nonempty A-ary tree with height h greaterthanorequalto 0. (b) A complete ...

Solution must be recursive you are not allowed to use loops

Solution must be recursive. You are not allowed to use loops, or use the Python "in" operator. PYTHON Write a function called first. It is passed a parameter x, that may or may not be a list; if is x is a list it may con ...

System analysis and design1 explain the difference between

System Analysis and Design 1) Explain the difference between too much feedback and too little feedback and provide a scenario for each one (two scenarios are needed - one for a lot of feedback and one for too much) and w ...

In a nationwide poll of 1500 randomly selected us residents

In a nationwide poll of 1500 randomly selected U.S. residents, 77% said they liked pizza. In a poll of 1500 randomly selected U.S residents one month later, 75% responded they liked pizza. a. Does the polling evidence su ...

The relations given below are part of a database schema for

The relations given below are part of a database schema for a hotel management system. Assume that these relations have been populated with suitable data as appropriate, and the underlined attribute is a primary key. Hot ...

Discussion question a sketch the storyboard for the simple

Discussion Question : a) Sketch the storyboard for the simple student information application. Recall that there are 6 files (scripts): connectcode.php, createtables.php, enterstudent.html, enterstudent.php, showstudents ...

Question suppose your computer is able to test 50000

Question Suppose your computer is able to test 50,000 passwords per second. If the password were 8 bytes long (a-z, A-Z, 0-9), what year will the password be cracked through brute force (Show your work)? Assume 1) you we ...

Research the history of specification languages and write a

Research the history of specification languages, and write a report on the successes or failures of some of these languages. Include 5 languages which are successful and 5 which have failed. All work should be typed writ ...

A survey is taken of people in the class of favorite flavor

A survey is taken of people in the class of favorite flavor of ice cream among a forced choice of chocolate, vanilla, or strawberry. 70% prefer chocolate, 20% prefer vanilla, and 10% prefer strawberry. a) What is the ent ...

Garber and skinner suggest that the large per capital

Garber and Skinner suggest that the large per capital health spending in the US (and relatively low returns to health) are due to productive and allocative inefficiencies. Which inefficiency (if either) do you think char ...

  • 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