// This
#include <iostream>
using namespace std;
int main()
{
int numCount, total;
double average;
cout ≪ "How many numbers do you want to average? ";
cin ≫ numCount;
for (int count = 0; count < numCount; count++)
{
int num;
cout ≪ "Enter a number: ";
cin ≫ num;
total += num;
count++;
}
average = total / numCount;
cout ≪ "The average is ≪ average ≪ endl ;
return 0;
}
Want to see the full answer?
Check out a sample textbook solutionChapter 5 Solutions
Starting Out with C++ from Control Structures to Objects (9th Edition)
Additional Engineering Textbook Solutions
Computer Systems: A Programmer's Perspective (3rd Edition)
Artificial Intelligence: A Modern Approach
Database Concepts (8th Edition)
Modern Database Management (12th Edition)
Starting Out with C++: Early Objects (9th Edition)
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
- #include using namespace std; int main() int x=1,y=2; for (int i=0; i<3; i++) e{ x=x*y; 8{ } cout<arrow_forwardC++arrow_forward10. a. Point Out errors: #include void main() { char arr[8]="Rhombus"; int i; for(i=0;i #include void main() { char *str1="United"; char *str2="Front"; char *str3; str3=strcat(str1,str2); printf("\n %s",str3); [- [- c. Compare Union and Structure.arrow_forwardFind errors / syntax error. Write line numberarrow_forwardNonearrow_forward2 ii) String character = "Leia"; String planet //L1 = "Alderaan"; //L2 if (character.equals ("Rey")) { planet } //L3 = "Hoth"; //L4 else { planet } "Jakku"; //L5 + planet); //L6 %3D %3D System.out.println(character + at Answer to question 2 ii): Complete the dry run table (you may not need all rows): : LINE character planet character.equals(“Rey")? print Options -arrow_forward#include using namespace std3; int main() { int x-6; int y=103; int z=0; int q=1; Z+= X-- -ys q*=++z+y; cout<arrow_forward8. Determine the value of variable num1, num2 and num3 at the end of the following code. int product(int A, int *B){ *B += 1; A *= *B; return A; } int main(){ int num1 = 2, num2 = 3, num3; num3 = product(num2, &num1); O A. num1 = 3, num2 = 3, num3 = 9 num1 = 2, num2 = 3, num3 = 9 num1 = 2, num2 = 3, num3 = 6 %3D D. num1 = 3, num2 = 2, num3 = 6 B.arrow_forwardInt number[-9]; true False The general form of (Compound if) is: If (condition); {statmenet1; } else {statmenet1; } * true False Program to print numbers from 100 to 10. # includeusing namespace std; int main ( ) { intn; for (n=100; n>9; n++) cout << n << ", ";} * true Falsearrow_forward#include #include #include #include using namespace std; int main (){ const double PI = 3.14159265359; return 0; }arrow_forwardint main(){ long long int total; long long int init; scanf("%lld %lld", &total, &init); getchar(); long long int max = init; long long int min = init; int i; for (i = 0; i < total; i++) { char op1 = '0'; char op2 = '0'; long long int num1 = 0; long long int num2 = 0; scanf("%c %lld %c %lld", &op1, &num1, &op2, &num2); getchar(); long long int maxr = max; long long int minr = min; if (op1 == '+') { long long int sum = max + num1; maxr = sum; minr = sum; long long int res = min + num1; if (res > maxr) { max = res; } if (res < minr) { minr = res; } } else { long long int sum = max * num1; maxr = sum; minr = sum; long long int res = min * num1;…arrow_forward#include #include #include #include #include using namespace std; int main (){ const double PI = 3.14159265359; return 0; }arrow_forwardarrow_back_iosSEE MORE QUESTIONSarrow_forward_iosRecommended textbooks for you
- 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
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