Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
C++ QUESTION
define an array with 10 elements, and enter the initial values from the keyboard. Compute the maximum value using function, finally print the result on the screen in the main function.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 3 steps with 1 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
- Exercise 2 This exercise is designed to assess student’s skills of writing programs using arrays and loops. Write a C++ program using array and loop that prompts a user to enter 15 Students’ marks in ProgramDesign and Implementation (PDI) Module in an array. The program sorts the students’ marks in descending order using a loop and displays the marks of all students as well as lowest, highest, average marks, and the class result based on the average module marks. The result criteria is given below:Average is less than 40 = Poor ResultAverage is between 40 to 49 = Fair ResultAverage is less than 50 to 59= Good ResultAverage is less than 60 to 69 = Very Good ResultAverage is between 70 to 79 = Excellent ResultAverage is 80 or greater = Outstanding ResultNote: You must demonstrate the use of arrays and loops. Your code must be properly commented Sample Output:Welcome to Result Management SystemEnter PDI Marks of Student 1: 50Enter PDI Marks of Student 2: 35Enter PDI Marks of Student 3:…arrow_forwardDo the following lab by one dimensional array(not vector) Write a C++ program that: part a) for 3 students find the average of a student by asking him how many grades do you have. To answer to this question, determine the size of the array(number of grades) and then ask the user to enter grades(the number of the grades is equal to the size of the array) then calculate the average for each student. Hence, you will calculate 3 averages. to calculate the average, use the array accumulator. Also when you get each grade validate it. validation for grade means that you check whether a grade is between 0 and 100. if the grade is negative or a grade is more than 100 then it is not valid and you have to ask the user to enter a grade again. Part b) Find the maximum and minimum grades for each student. Part c) Print the sorted list of the grades for each student. example: if grades user entered are: 60 78 98 23 45 then sorted list is:23 45 60 78 98arrow_forwardPrograming language is Carrow_forward
- Declare 2D array whose size and elements must be according to the desire of user then perform the following functions on it Display a lower triangular matrix. Find the sum of an upper triangular matrix. DO IT IN C++arrow_forwardC++ Do the following lab by an array(not vector) for 3 students find the average of a student by asking him how many grades do you have. The answer to this question, determine the size of the array(list of grades) and then ask the user to enter grades(the number of the grades is equal to the size of the array) then calculate the average for each student. Hence, you will calculate 3 averages. to calculate the average, use the array accumulator. Also when you get each grade validate it. validation for grade means that you check whether a grade is between 0 and 100. if the grade is negative or a grade is more than 100 then it is not valid and you have to ask the user to enter a grade again. Find the maximum and minimum grades for each student. Print the sorted list of the grades for each student. example: if grades user entered are: 60 78 98 23 45 then sorted list is:23 45 60 78 98arrow_forwardIn C++ language Write a function that takes a 1 Demensional array and an integer n and reutrns the number of times 'n' appears in the array. If 'n' does not appear in the array, return -1.arrow_forward
- c++ programming Initialize a string array named person with your first, middle andlast name as separate elements. Print the middle name from the array. Iterate to print all values of the array. Output Example WilliamJohn William Henryarrow_forwardSummary In this lab, you use what you have learned about searching an array to find an exact match to complete a partially prewritten C++ program. The program uses an array that contains valid names for 10 cities in Michigan. You ask the user to enter a city name; your program then searches the array for that city name. If it is not found, the program should print a message that informs the user the city name is not found in the list of valid cities in Michigan. The file provided for this lab includes the input statements and the necessary variable declarations. You need to use a loop to examine all the items in the array and test for a match. You also need to set a flag if there is a match and then test the flag variable to determine if you should print the the Not a city in Michigan. message. Comments in the code tell you where to write your statements. You can use the previous Mail Order program as a guide. Instructions Ensure the provided code file named MichiganCities.cpp is…arrow_forwardHello, i need help and i would like explanation too and include pictures of the program too please and thank you!! in c languagearrow_forward
- C++ Coding: ArraysTrue and False Code function definitions for eoNum() and output(): Both eoNum() and output() are recursive functions. output() stores the even/odd value in an array. Store 0 if the element in the data array is even and store 1 if the element in the data array is odd. eoNum() displays all the values in an array to the console.arrow_forwardC++ Write the program that outputs the following menu. The program should allow a user to input numbers into an array of integers. The array size should be 10. The first number should be stored in the zero position of the array. The next number should be stored in the next available location. Each option below should be written using a procedure, except Quit. Remember to comment the procedures with (given, task and return). (MENU) 1) Input number. 2) Sort numbers. 3) Output numbers 4) Quit Option 1) Allows the user to input a number and store it into the array. If the array is full no more numbers should be input. When the user select option 1 and the array is full it should output (Memory Full!). This option will only allow one number to be entered. If the user want to input another number they will need to select option 1 again. Option 2) This option should take the array and sort it in ascending order. Use the selection sort to do this. Option 3)…arrow_forwarduse c++ Programming language Write a program that creates a two dimensional array initialized with test data. Use any data type you wish . The program should have following functions: .getAverage: This function should accept a two dimensional array as its argument and return the average of each row (each student have their average) and each column (class test average) all the values in the array. .getRowTotal: This function should accept a two dimensional array as its first argument and an integer as its second argument. The second argument should be the subscript of a row in the array. The function should return the total of the values in the specified row. .getColumnTotal: This function should accept a two dimensional array as its first argument and an integer as its second argument. The second argument should be the subscript of a column in the array. The function should return the total of the values in the specified column. .getHighestInRow: This function should accept a two…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education