login! Nashville Si- Chapter l and 2 a C ià https://elearn.nscc.edu/d2%ne/conten
ID: 3751572 • Letter: L
Question
login! Nashville Si- Chapter l and 2 a C ià https://elearn.nscc.edu/d2%ne/content/7495466/wewContent/52 1 48790Wow x G Are these ho ino, x | D TablSPd, Nashvills State CISP-1010-NO1 - Computer Science ontent Evaluation Communication Resources Course Tools Chapter 1 and 2 Quiz Chapter 1 and 2 Quiz Time Limit: 2:00:00 Time Left:1:41:58 Samia Jabeen: Attempt 1 1) #include "stdafx.h" 2) include 3) using namespace std: 5) int main 7) 8) 9)cout s Pay ss endl: 10) Pay-23450.00: system(" PAUSE") return 0: 12) 13) ) The above program has a compile error. 1) Give a brief description on what is wrong with the code above and what line number the error is on. 2) Write the code you would use to fix the error and indicate what line number it needs to be placed on. Note: You do not need to rewrite the whole program. You only need to write the code that it takes to correct the program. Please remember to use correct syntax when writing your code, points will be taken off for incorect syntaxExplanation / Answer
1)
Error is in line number 8.
Here the data type of variable Pay is not declared.
Since it is a real value variable Pay should be declared as double.
2)
Correction to be done on line number 8
The corrected program is
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
double Pay=23450.00;
cout<<Pay<<endl;
system("PAUSE");
return 0;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.