Ascending Circles
Want to see the full answer?
Check out a sample textbook solutionChapter 9 Solutions
STARTING OUT WITH C++ MPL
Additional Engineering Textbook Solutions
Differential Equations: Computing and Modeling (5th Edition), Edwards, Penney & Calvis
C How to Program (8th Edition)
Java: An Introduction to Problem Solving and Programming (8th Edition)
Modern Database Management
C Programming Language
Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
- (Statistics) a. Write a C++ program that reads a list of double-precision grades from the keyboard into an array named grade. The grades are to be counted as they’re read, and entry is to be terminated when a negative value has been entered. After all grades have been input, your program should find and display the sum and average of the grades. The grades should then be listed with an asterisk (*) placed in front of each grade that’s below the average. b. Extend the program written for Exercise 1a to display each grade and its letter equivalent, using the following scale: Between90and100=AGreaterthanorequalto80andlessthan90=BGreaterthanorequalto70andlessthan80=CGreaterthanorequalto60andlessthan70=DLessthan60=Farrow_forward(Numerical) Given a one-dimensional array of integer numbers, write and test a function that displays the array elements in reverse order.arrow_forwardFinding the common members of two dynamic arrays: Write a program that first reads two arrays and then finds their common members (intersection). The program should first read an integer for the size of the array and then should create the two arrays dynamically (using new) and should read the numbers into array1 and array2 and then should find the common members and show it. Note: The list of the common members should be unique. That is no member should be listed more than once. Tip: A simple for loop is needed on one of the arrays (like array1) and one inner for loop for on array2. Then for each member of array1, if we find any matching member in array2, we record it. Sample run: Enter the number of elements of array 1: 7 Enter the elements of array 1: 10 12 13 10 14 15 12 Enter the number of elements of array 2: 5 Enter the elements of array 2: 17 12 10 19 12 The common members of array1 and array2 are: 12 10arrow_forward
- Problem2 Write a program that display the position of a given element in an array. You should print the index (i.e. the position) of the element. If the element appears more than one time than you should print all its positions. The size of the array should be entered by the user. If the element does not occur then you should display element not found. Sample1: Enter the size of the array: 5 Enter an array of size 5: 44 5 13 44 67 Enter the element to find: 44 44 is found at position 44 is found at position 44 occurs 2 time(s) Sample2: Enter the size of the array: 4 Enter an array of size 4: 12 150 17 20 Enter the element: 18 18 is not foundarrow_forward8. A magic square is an n by n square in which each element is an integer between 1 and n*n and all column sums, row sums and diagonal sums are equal. For example, the following is a 3 by 3 magic square in which each row, each column, and each diagonal adds up to 15. 4 3 8 9 1 7 6. Write a program that accepts a two-dimensional array size 10 by 10. The program should check and output whether it is a magic square or not. What is the output of the following code?arrow_forwarduse C++ programming language A local zoo wants to keep track of how many pounds of food each of its three monkeys eats each day during a typical week. Write a program that stores this information in a two-dimensional 3×7 array, where each row represents a different monkey and each column represents a different day of the week. The program should first have the user input the data for each monkey. Then it should create a report that includes the following information: Average amount of food eaten per day by the whole family of monkeys The least amount of food eaten during the week by any one monkey The greatest amount of food eaten during the week by any one monkey.arrow_forward
- C++ program This assignment is about array operations. Create an array with 1000 items and fill it with random numbers from the range of -100, 100 (including -100 and 100). Then, your program asks user to enter a number. The program keeps running until user enters a out-of-range (-100,100) number. An example run is given below. Enter a number: -4Frequency of -4: 54Enter a number: 4Frequency of 4: 15Enter a number: 35Frequency of 35: 8Enter a number: 43Frequency of 43: 2Enter a number: 101Bye...arrow_forwardC++ program This assignment is about array operations. Create an array with 1000 items and fill it with random numbers from the range of -100, 100 (including -100 and 100). Then, your program asks user to enter a number. The program keeps running until user enters a out- of-range (-100,100) number. An example run is given below. Enter a number: -4 Frequency of -4: 54 Enter a number:4 Frequency of 4: 15 Enter a number: 35 Frequency of 35: 8 Enter a number: 43 Frequency of 43:2 Enter a number: 101 Bye..arrow_forwardMonkey BusinessA local zoo wants to keep track of how many pounds of food each of its three monkeys eats each day during a typical week. Write a program that stores this information in a two-dimensional 3 × 7 array, where each row represents a different monkey and each column represents a different day of the week. The monkeys are represented by integers 1, 2, and 3; the weekdays are "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday". The program should first prompt the user to input the data for each monkey, starting with "Sunday" for monkey #1, then monkeys #2 and #3, followed by "Monday" for monkey #1, then monkeys #2 and #3 and so on, through "Saturday". The program then creates a report that includes the following information, each properly labeled (see below): Average amount of food eaten per day by the whole family of monkeys. The least amount of food eaten during the week by any one monkey. The greatest amount of food eaten during the week by any…arrow_forward
- In C++Monkey Business A local zoo wants to keep track of how many pounds of food each of its three monkeys eats each day during a typical week. Write a program that stores this information in a two-dimensional 3 × 5 array, where each row represents a different monkey, and each column represents a different day of the week. The program should first have the user input the data for each monkey. Then, it should create a report that includes the following information: Average amount of food eaten per day by the whole family of monkeys. The least amount of food eaten during the week by any one monkey. The greatest amount of food eaten during the week by any one monkey. Write functions: average() least() greatest() main()arrow_forwardPayroll System In this lab, you're going to be working with partially filled arrays that are parallel with each other. That means that the row index in multiple arrays identifies different pieces of data for the same person. This is a simple payroll system that just calculates gross pay given a set of employees, hours worked for the week and hourly rate. Parallel Arrays First, you have to define several arrays in your main program: 1. employee names for each employee 2 hourly pay rate for each employee 3. total hours worked for each employee 4. gross pay for each employee Second, you will need a two dimension (2-D) array to record the hours worked each day for an employee. The number of rows for the 2-D array should be the same as the arrays above since each row corresponds to an employee. The number of columns represents days of the week (7 last I looked). Functions Needed In this lab, you must read in the employee names first because this identifies how many elements will be in each…arrow_forwardQ3: write a program to pass a two dimensional array as a parameter to a function which is used to find the summation of the upper triangular elements of the array. Co 0 Co1 Co 2 Col 3 Ro 0 Ro 1 Ro 2 Ro 3arrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning