
EBK JAVA PROGRAMMING
9th Edition
ISBN: 9781337671385
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
expand_more
expand_more
format_list_bulleted
Topic Video
Question
![Write your C++ program in main.cpp.
Write a program that generates n random numbers each in the interval [11, 213] inclusive. The user will provide the
value for n. The program prints the numbers, the minimum, the maximum, and the numbers average.
Note: Your output will be different as the numbers are generated randomly.
When you are done:
Download your code. It will save the file main.cpp and rename the file to Lab8_Ex1.cpp.
This is very important so that you can always access the code later.
How to Submit:
Select all the code using Ctrl + A / Cmd + A.
Copy the code using Ctrl + C / Cmd + C.
Paste the code in the answer box using Ctrl +V/ Cmd +V on the blackboard.
Ignore if the formatting of the code is different.
Move to the next question or press the Save and Submit button.
Sample Input/Output:
Enter how many numbers: 5
The 5 random numbers are:
188
31
183
72
The minimum is 31
The maximum is 188
The average is 118.6
119](https://content.bartleby.com/qna-images/question/9354c5e6-03df-4f22-837b-6fa33edf7e90/96dff142-9613-437e-b096-97fe9f80841e/2pesqia_thumbnail.png)
Transcribed Image Text:Write your C++ program in main.cpp.
Write a program that generates n random numbers each in the interval [11, 213] inclusive. The user will provide the
value for n. The program prints the numbers, the minimum, the maximum, and the numbers average.
Note: Your output will be different as the numbers are generated randomly.
When you are done:
Download your code. It will save the file main.cpp and rename the file to Lab8_Ex1.cpp.
This is very important so that you can always access the code later.
How to Submit:
Select all the code using Ctrl + A / Cmd + A.
Copy the code using Ctrl + C / Cmd + C.
Paste the code in the answer box using Ctrl +V/ Cmd +V on the blackboard.
Ignore if the formatting of the code is different.
Move to the next question or press the Save and Submit button.
Sample Input/Output:
Enter how many numbers: 5
The 5 random numbers are:
188
31
183
72
The minimum is 31
The maximum is 188
The average is 118.6
119
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 2 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- (Numerical) Write a program that tests the effectiveness of the rand() library function. Start by initializing 10 counters to 0, and then generate a large number of pseudorandom integers between 0 and 9. Each time a 0 occurs, increment the variable you have designated as the zero counter; when a 1 occurs, increment the counter variable that’s keeping count of the 1s that occur; and so on. Finally, display the number of 0s, 1s, 2s, and so on that occurred and the percentage of the time they occurred.arrow_forwardWrite a program that reads in a line consisting of a students name, Social Security number, user ID, and password. The program outputs the string in which all the digits of the Social Security number and all the characters in the password are replaced by x. (The Social Security number is in the form 000-00-0000, and the user ID and the password do not contain any spaces.) Your program should not use the operator [] to access a string element. Use the appropriate functions described in Table 7-1.arrow_forwardWhat is incorrect about the following code? Suggest a possible revision of the code to correct the error.arrow_forward
- Write a program to implement the algorithm that you designed in Exercise 22 of Chapter 1. (Assume that the account balance is stored in the file Ch4_Ex15_Data.txt.) Your program should output account balance before and after withdrawal and service charges. Also save the account balance after withdrawal in the file Ch4_Ex15_Output.txt.arrow_forwardIn Chapter 4, you created a program that generates a random number, allows a user to guess it, and displays a message indicating whether the guess is too low, too high, or correct. Now, create a modified program called GuessingGame2 in which the user can continue to enter values until the correct guess is made. After the user guesses correctly, display the number of guesses made. Recall that you can generate a random number whose value is at least min and less than max using the following statements: Random ranNumber = new Random(); int randomNumber; randomNumber = ranNumber.Next(min, max);arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrEBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT

EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT

C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning

Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage

C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr

EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT