The following
// Write the avgArray function prototype here.
// It should have a const array parameter.
int main()
{
const int SIZE= 10;
int userNums[SIZE];
cout << "Enter 10 integers: ";
for ( int count= O; count< SIZE; count++)
{
}
cout << "#" << (count + 1)
cin >> userNums[count];
}
cout << "The average of those numbers is";
cout << avgArray(userNums, SIZE)<< endl;
return 0;
}
// Write the avgArray function here.
Want to see the full answer?
Check out a sample textbook solutionChapter 8 Solutions
Starting Out with C++: Early Objects (9th Edition)
Additional Engineering Textbook Solutions
Starting Out with C++ from Control Structures to Objects (8th Edition)
Differential Equations: Computing and Modeling (5th Edition), Edwards, Penney & Calvis
Digital Fundamentals (11th Edition)
Concepts of Programming Languages (11th Edition)
Concepts Of Programming Languages
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
- (Numerical) Write and test a function that returns the position of the largest and smallest values in an array of double-precision numbers.arrow_forwardDisplay Array values Write a program that lets the user enter ten values into an array. Then pass the array, the size of the array, and the number, num to a function called displayArrayValues(). The function should then display all the numbers in the array larger than n. Write a program using C++.arrow_forwardTRUE OR FALSE, C++ When passing an array to a function, you must include & in front of the array name. When passing an array to a function, you must include & in front of the array name. It is possible to have a 2-dimensional array where each row has a different number of columns. The * is called the address of operator.arrow_forward
- 2. Lottery Number Generator Design a program that generates a 7-digit lottery number. The program should have an Integer array with 7 elements. Write a loop that steps through the array, ran- domly generating a number in the range of 0 through 9 for each element. (Use the random function that was discussed in Chapter 6.) Then write another loop that displays the contents of the array.arrow_forwardAnswer in C programming languagearrow_forwardProgram Number 2: Password Verifier Imagine you are developing a software package that requires users to enter their own passwords. Your software requires that user’s passwords meet the following criteria: The password should be at least six characters long. The password should contain at least one uppercase and at least one lowercase letter. The password should have at least one digit. Contains at least one @ in array. Write a program that asks for a password and then verifies that it meets the stated criteria. If it doesn’t, the program should display a message telling the user why.arrow_forward
- PART 2 Problem #1 Write a program that does the following: Reads an integer from the user that represents the number of the students in a class. Reads the scores of the students from the user and stores them in an array. Calculates and prints the average of the students with a passing grade (above or equal to 60). ● ● ● Hints: ● Assume that the scores of the students are integers between 0 and 100 (inclusive) Assume that there is at least one student in the class with a passing grade. Sample run 1: Enter the number of students in the class: 3 Enter the scores of 3 students: 90 80 40 The average of the students with a passing grade is 85.0 Sample run 2: T Enter the number of students in the class: 5 Enter the scores of 5 students: 90 80 40 60 70 The average of the students with a passing grade is 75.0arrow_forwardAn array definition reserves space for the array. true or falsearrow_forwardTRUE or FALSEA static array's capacity will change whenever it deems necessary.arrow_forward
- True or False You can store a mixture of data types in an array.arrow_forwardC++ programming language please use <iostream> Can you make some explanations when you writing program to be clear Thank you so much Have a nice day :)arrow_forwardpseudo code in problem solving and logic and flowchartTotal Sales (Arrays) Design a program that asks the user to enter a store’s sales for each day of the week (for one week). The amounts should be stored in an array. Use a loop to calculate the total sales for the week and display the result. Guideline: Rename the variables with your student number (e.g., amount_697) Use an array to solve the above problem Add comments with your name/student number Comment your codearrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning