Program to generate random numbers

Assignment Help Computer Engineering
Reference no: EM131308592

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.

Reference no: EM131308592

Questions Cloud

Alternative market entry strategies for international market : Compare and contrast alternative market entry strategies for international markets. What are their strengths and weaknesses? What level of risk do you associate with each one?
Two investment advisors are comparing performance : Two investment advisors are comparing performance. Advisor A averaged a 20% return with a portfolio beta of 1.75 and Advisor B averaged a 15% return with a portfolio beta of 1.45. If the T-bill rate was 2% and the market return during the period was ..
Using the fama and french three factor model : An analyst has modeled XYZ stock using the Fama & French three factor model (FF3FM). Over the past few years the risk premium on SMB was 2.25% and the risk premium on HML was 2.95%. Regression analysis shows that XYZ’s beta coefficient on SMB is 2.5 ..
Healthcare organization or an integrated delivery system : This Course Project gives you the opportunity to select a managed healthcare organization or an integrated delivery system that currently exists in our healthcare system and analyze the positive and negative aspects of the integrated delivery syst..
Program to generate random numbers : 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. Create an array of 1000 integers in your main function
Create a diagram for a layered architecture view of system : To present a static model of system, create a diagram for a layered architecture view of system. Using components you identified in your layered view of the system, create an activity diagram that shows how a customer would place an order.
What is the yield to maturity to the nearest percent : What is the yield to maturity, to the nearest percent, for the following bond: current price is $908, coupon rate is 11 percent, $1,000 par value, interest paid annually, eight years to maturity?
Importance of organize behavior : 1. What work-related outcomes are associated with job satisfaction and how can changes in the workplace improve job satisfaction? 2. How can I use knowledge of OB to enhance my job performance and career?
Assess the challenges of managers providing accurate : Assess the challenges of managers providing accurate, timely, and effective feedback to employees. Recommend how managers can overcome any two (2) of the challenges you identified.

Reviews

Write a Review

Computer Engineering Questions & Answers

  What ordering results in an optimal tree

Inserting the values in different orders results in different shapes of trees. What ordering results in an optimal (complete) tree? Show the resulting tree.

  Define the divide-and-average algorithm

The divide-and-average algorithm for approximating the square root of any positive number a is as follows: Take any initial approximation x that is positive, and then find out a new approximation by calculating the average of x and a/x, that is, (..

  What is largest and smallest number that can be represented

What is the value n, the smallest number of bits needed to represent all of these numbers in 2's complement representation? What is the largest and smallest number that can be represented?

  How this might be solved by a parallel computing machine

Write at least two paragraphs: the first one identifying and describing a problem, the second one describing how you imagine solving it on a parallel platform.

  How to create a class named integerset

A set is represented internally as an array of Booleans. Array element a[i] is true if integer "i" is in the set. Array element a[j] is false if integer "j" is not in the set. The no-argument constructor initializes a set to the so-called "empty s..

  Make use of a group box to enclose the radio buttons

You have been hired by an engineering company to develop software to perform advanced geometric calculation. Your new boss asked you to develop an application that allows engineers to calculate the surface area and the volume of a sphere.

  Give employee''s pay according to that employee''s pay code

A company pay its employees as managers (who receive a fixed weekly salary), hourly workers (who receive a fixed hourly wage for up to the 40 hours they work and "time-and-a-half"- 1.5 times their hourly wage- for overtime hours workers).

  Regarding delivery of the packet wirelessly

Supposing no malfunction in any of stations or nodes of the network, also explain in scholarly detail if it is possible for the packet to be delivered to the wrong destination

  Write a 700 to 1050 word paper on a specific web or mobile

write a 700 to 1050 word paper on a specific web or mobile application.describe a specific web or mobile applications

  Converting the skip list l into binary search tree t(l)

Any skip list L can be converted into binary search tree T(L)as follows: The root of T(L) is considered as the leftmost node on the highest non-empty level of L the left and right sub-trees.

  Questioncreate a set of in third normal form 3nf from

questioncreate a set of in third normal form 3nf from following un-normalised relation. you must use finkelstein

  Explore the effectiveness of this technique for task

Analyze your approach to problem giving estimates of its time and space requirements. Also, critically explore the effectiveness of this technique for this task.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd