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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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