Method to generate the random numbers

Assignment Help C/C++ Programming
Reference no: EM13699383

Can you write the code that will generate random integers?

Program: Write a program that will generate a set of 75 random integers in the range -26 to + 42. The program should display the following:

a) The number of positive and negative numbers (treat 0 as positive).

b) The average value of the positive numbers

c) The average value of the negative numbers

d) The largest and smallest number.

e) The average of all the numbers.

You have to use a for loop structure for this question along with the Math.random() method to generate the random numbers.

Hint: Produce numbers in the range of 0-68 and subtract 26.

Add comments in code section that will be useful in the future.

Reference no: EM13699383

Questions Cloud

What is the reaction of a ketoester with sodium borohydride : Problem- What is the reaction of a ketoester ( a compound that contains both a keton functional group and an ester functional group) with sodium borohydride
What addressing mode is most appropriate : Suppose n will be the result of an addition instruction and, thus, is not known statically. What addressing mode is most appropriate to use to access the data located in memory at an address that is n bytes larger than the contents of register X?
It can be produced by the reaction of butanoic acid : Problem- Ethyl butyrate, CH3CH2CH2CO2CH2CH3, is an artificial fruit flavor commonly used in the food industry for such flavors as orange and pineapple. Its fragrance and taste are often associated with fresh orange juice, and thus it is most commo..
What is a telecommunications network protocol : What is telecommunications network architecture? Select a network protocol and provide details on the steps that preceded the formal adoption of the protocol by the industry.
Method to generate the random numbers : Write a program that will generate a set of 75 random integers in the range -26 to + 42. The program should display the following:
Calculate the final temperature of a mixture of ice : Problem- Calculate the final temperature of a mixture of 150.0 g of ice initially at -14.0C and 371.5 g of water initially at 91.5C
How many carbon atoms butane : Problem- The fuel used in many disposable lighters is liquid butane, C4H10. How many carbon atoms are in 4.00g of butane
Submit the given circuit drawn in multisim : Ensure to use only MULTI SIM and please attach ALL screen shots for the steps thanks!!
Explain an artificial fruit flavor commonly used in the food : Problem- Ethyl butyrate, CH3CH2CH2CO2CH2CH3, is an artificial fruit flavor commonly used in the food industry for such flavors as orange and pineapple. Its fragrance and taste are often associated with fresh orange juice, and thus it is most commo..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Show the restriction range of values from rand

How to write a program to demonstrate the use of random number functions in c++ program. and to show the restriction range of values from rand()using %

  Implement method to advance any given date by one day

Write C++ implementation of this method. Create and specify any other methods that you require. Include comments which will be helpful to someone who will maintain implementation in the future.

  Program on basic arithmetic operation

Two integers must be compared before the arithmetic operation and Subtract the two integers provided the first integer is greater than the second integer, otherwise add the two integers and subtract the second integer from the first integer.

  Create a structure that has one variable called value

"Create a structure that has one variable called value and one pointer to the list (making it a linked list). Prompt for 5 values from the keyboard as input and store them in the linked list. Print out the current contents of the list.

  Write a function that permanently swaps two integers

Write a function that permanently swaps two integers using pointers.

  Write a program that reads in a list of integer numbers and

Write a program that reads in a list of integer numbers and print out the sum of all numbers, the average, the lowest and the highest value entered. The first input number indicates how many numbers the program is attempting to read. For example, if ..

  A text file students.txt contains student records

A text file students.txt contains student records (name, date of birth, and GPA). Write a program that reads student records from students.txt and creates an array of student structures

  Calculate and return the average of one of numerical values

Write a method that uses the array to output to the console the list of entries in reverse order. Each entry is displayed on a new line.

  Analyze a basic set of requirements for a problem

Create the main bank program. Note that you can create the main bank program in the main function or you can try to create another class for the main bank program.

  Add 10 people to the line

Add 10 people to the line and process them. Each time you process someone, print out their ticket information. After all 10 have been serviced, print the average wait time. Below is an example of the time calls you will need and a wait function.

  Generate two files of 100 by 100 mazes

Write a C++ program that opens a file representing an encoded maze and reads it

  What are the primary differences between object-oriented

1. what is instruction explosion?2. what are the primary differences between object-oriented programming languages and

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