C++ How to Program (10th Edition)
10th Edition
ISBN: 9780134448237
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter E, Problem E.9E
Program Plan Intro
- Include the required header files.
- Declare function prototype which is used in the program.
- Define the “main()” function.
- Declare the variable n to assign number of elements.
- Declare the int array named arr[n] with size n.
- run a loop from 0 to n to take values from keyboard
- Call the function PRINTARRAY() to print the values in the array.
- Function PRINTARRAY(int arr[], int) Function has two arguments one is array argument which receives the array passed by the calling function second is to receive the number of elements in the array.
Runs a for loop from 0 to n (total number of elements).
Prints the array elements.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
In C Programming
Write a main function that declares an array of 100 ints. Fill the array with random values between 1 and 100.
Calculate the average of the values in the array. Output the average.
2. Write a general program that creates a table as seen below. Your program should calculate the
grade average. You can only use integer or character multi-dimensional arrays to store or
calculate data values. You are only allowed to use loops to calculate and print the table. All
calculation and printing should be made in gradecalculator function. Data should be taken in the
main function.
Names
Homework
Midterm 1
Midterm 2
Final
Grade
10%
20%
20%
50%
average
Ali
89
70
61
60
Ahmet
78
60
59
88
Ayse
99
70
77
66
Есе
100
68
55
72
Selen
80
55
30
82
Using c++ Compiler.
Create a program that will store 5 integer numbers and store it on the array. Afterward, accept input for the integer number to be search on the array. Your program must display the index number where the integer number being search was found. If the integer number being search was not found on the array display NOT FOUND as message.
Chapter E Solutions
C++ How to Program (10th Edition)
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
- Write a function that determines the average of the values in an array. In the main() function declare a floating point array with a length of 8 elements, and have the user enter the value of each element using a loop. The program should then call and pass the array to the function, then display the average.arrow_forward27. In C programming . make a program that lists 10 numbers from the user into an array, create a moving_average function that when its in a loop it makes a length 3 moving average array. make sure it prints the inputted array and then the moving average array. make a flowchart with itarrow_forwardCreate a program in C Language that calculates a student's overall grade based on their assignments, quizzes, and exams. Create three separate arrays of `double` which will store 5 assignments, 3 quizzes, and 2 exams, respectively. The program should prompt the user to enter the grades for each group on one line (see example). The program should then compute the average of each individual group and then weight that group based on the value given for the corresponding weight. In the example run below, the average assignment score is first calculated and then multiplied by the given assignment weight. The final grade is calculated as the sum of all weighted groups and should be printed to 2 decimal places. Submit your code as grades.c Other Requirements Do not hard code any values. Use preprocessor directives or `const` globals for array sizes. Your code must use consistent formatting and spacing. Points will be taken off for inconsistent or sloppy code. Example Run Enter 5 assignment…arrow_forward
- (Data processing) A bank’s customer records are to be stored in a file and read into a set of arrays so that a customer’s record can be accessed randomly by account number. Create the file by entering five customer records, with each record consisting of an integer account number (starting with account number 1000), a first name (maximum of 10 characters), a last name (maximum of 15 characters), and a double-precision number for the account balance. After the file is created, write a C++ program that requests a user-input account number and displays the corresponding name and account balance from the file.arrow_forward(File creation) Write a C++ program that creates an array containing the integer numbers 60, 40, 80, 90, 120, 150, 130, 160, 170, and 200. Your program should then write the data in the array to a text file. (Alternatively, you can create the file with a text editor.)arrow_forward(Electrical eng.) Write a program that specifies three one-dimensional arrays named current, resistance, and volts. Each array should be capable of holding 10 elements. Using a for loop, input values for the current and resistance arrays. The entries in the volts array should be the product of the corresponding values in the current and resistance arrays (sovolts[i]=current[i]resistance[i]). After all the data has been entered, display the following output, with the appropriate value under each column heading: CurrentResistance Voltsarrow_forward
- Write the code that converts your student number to binary values. Just after calculating each digit of the binary value, dynamically add it to the array that you expand with each step. After completing the calculation and adding to the dynamic array, list the binary code in the dynamic array correctly. Perform the necessary coding with the C programming language.arrow_forwardWrite a C++ program that asks a user to input 10 numbers. The numbers are stored in the array if it is not Odd and not already available. After creating the array, it asks the user to enter a number and deletes it from the arrayarrow_forwardIn C++: Write a program which will prompt the user to enter an array of 12 characters. The program should then print the array, and then print the array again, but this time as a 4 colums by 3 rows array.arrow_forward
- Write a program in C++ programming language that prompts the user to input any set of elements. The program should display the first and the last element of the array.arrow_forwardCreate a C # program that lets you keyboard 10 values into an array, but none of them should be repeated. That is, your program should not allow the entry of the value towards the arrangement if it was already entered before. Then display each array value in reverse order to which they were entered. ps: it is suggested that you apply repeat cycles to achieve the requested goalarrow_forwardIn a program you need to store the identification numbers of 10 employees (as ints) and their weekly gross pay (as doubles). A) Define two arrays that may be used in parallel to store the 10 employee identification numbers and 10 weekly gross pay amounts.B) Write a loop that uses these arrays to print each employee’s identification number and weekly gross pay.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
9.1: What is an Array? - Processing Tutorial; Author: The Coding Train;https://www.youtube.com/watch?v=NptnmWvkbTw;License: Standard Youtube License