Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Find as many syntax or logical errors as possible in the following porgrams #inc

ID: 3646321 • Letter: F

Question

Find as many syntax or logical errors as possible in the following porgrams
#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; cout< numCount; count++)
{
total = 0;
int num;
cout << "Enter a number: ";
cin>>num;
total += num;
Count++;
}
average = total / numCount;
cout << "The average is << average <<endl;
return 0;
}

Second program

#include<iostream>
using namespace std;
int main()
{
int num, bigNum, power, count;
cout << "Enter an integer: ";
cin >> num;
cout << "What power do you want it raised to? ";
cin>>power;
bigNum = num;
while (count++ < power)
bigNum *= num;
cout << "The result is << bigNum << endl;
return 0;
}

Explanation / Answer

1st program: logical errors: total must be declared to 0,total=0; Syntax errors: Line 2: error: expected identifier before ' numCount; for (int count =0; countnum; total += num; count++; } average = total / numCount; cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote