Name Arranger
Write a
Want to see the full answer?
Check out a sample textbook solutionChapter 10 Solutions
Starting Out with C++ from Control Structures to Objects (8th Edition)
Additional Engineering Textbook Solutions
Database Concepts (8th Edition)
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
Absolute Java (6th Edition)
C Programming Language
Modern Database Management
Starting Out with C++: Early Objects
- (Statistics) Write a program that includes two functions named calcavg() and variance(). The calcavg() function should calculate and return the average of values stored in an array named testvals. The array should be declared in main() and include the values 89, 95, 72, 83, 99, 54, 86, 75, 92, 73, 79, 75, 82, and 73. The variance() function should calculate and return the variance of the data. The variance is obtained by subtracting the average from each value in testvals, squaring the values obtained, adding them, and dividing by the number of elements in testvals. The values returned from calcavg() and variance() should be displayed by using cout statements in main().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(Electrical eng.) Write a program that declares three one-dimensional arrays named volts, current, and resistance. Each array should be declared in main() and be capable of holding 10 double-precision numbers. The numbers to store in current are 10.62, 14.89, 13.21, 16.55, 18.62, 9.47, 6.58, 18.32, 12.15, and 3.98. The numbers to store in resistance are 4, 8.5, 6, 7.35, 9, 15.3, 3, 5.4, 2.9, and 4.8. Your program should pass these three arrays to a function named calc_volts(), which should calculate elements in the volts array as the product of the corresponding elements in the current and resistance arrays (for example ,volts[1]=current[1]resistance[1]). After calc_volts() has passed values to the volts array, the values in the array should be displayed from inside main().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_forwardWrite a statement that declares a procedure-level one-dimensional array named intorders. The array should contain 15 elements.arrow_forwardC Programming qn Write a program that stores the mark allocation weights for 4 assessments as shown in the table below in an array. The program must prompt the user to enter their full name and the 4 mark assessments as follows: "Please enter your first name and your last name: " "Please enter the project mark: " "Please enter the practical mark: " "Please enter test 1 mark: " "Please enter test 2 mark: " The program must use the weights and the entered mark values to calculate the final mark for the student and display the student's name and final mark. Note: format the displayed values to two decimal points. The program must perform the following functionality: Creates a four-element array with the correct data type to store the weights. Prompts the user to obtain the four assessment values. | Prompts the user to for their first name and last name. Calculates the final mark. Prints the student name and final mark to the screen. Assessment Description Weight Project 0,35 Practical…arrow_forward
- Date Printer Write a program that reads a char array from the user containinga date in the form mm/dd/yyyy. It should print the date in the form March 12, 2014.arrow_forwardC++ Rainfall Statistics Write a program that uses a two-dimensional array to store the highest and lowest temperatures for each month of the year. The program should output the average high, average low, and the highest and lowest temperatures for the year. Your program must consist of the following functions: Function getData: This function reads and stores data in the two- dimensional array. The program should verify that the user entered a number and that the high number is higher than the low number for a month. Function averageHigh: This function calculates and returns the aver- age high temperature for the year. Function averageLow: This function calculates and returns the average low temperature for the year. Function indexHighTemp: This function returns the index of the highest high temperature in the array. Function indexLowTemp: This function returns the index of the lowest low temperature in the array. These functions must all have the appropriate parameters. INPUT…arrow_forward7. Quarterly Sales Statistics Write a program that lets the user enter four quarterly sales figures for six divisions of a company. The figures should be stored in a two-dimensional array. Once the figures are entered, the program should display the following data for each quarter: • A list of the sales figures by division • Each division's increase or decrease from the previous quarter (this will not be dis- played for the first quarter) The total sales for the quarter • The company's increase or decrease from the previous quarter (this will not be dis- played for the first quarter) • The average sales for all divisions that quarter • The division with the highest sales for that quarter Input Validation: Do not accept negative numbers for sales figures.arrow_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 PtrProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning