Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I ' m having trouble fixing the errors in this code: / / DataTypes.cpp : The data types to declare each of the variables is
Im having trouble fixing the errors in this code: DataTypes.cpp : The data types to declare each of the variables is missing.
Based on the value being stored in the variable and the comments beside it
fill in the data type at the beginning of each line. Then compile and run
program to make sure you selected the correct types.
After you submit your answers, try changing the values stored in the
variables. What can you learn about the different data types?
This line is causing an error where a ; is expected.
#include
#include
using namespace std;Error on this line
main
float classAverage ; Decimal number. I added float to this line
char letterScore A; Single letter
int testScore ; Whole number value
float classTestAverage f; Decimal number, notice the f at the end
int colorCode
Green ;
Yellow ;
Red ;
int gradebookColor colorCode; Stores list of values
gradebookColor Green; This line does not need a declaration, it was declared in the line above
Since the line above was not necessary I made that line into a comment.
bool isStudentPassing true; Could be true or false
cout "The class average is currently
classAverage
endl;
cout "The class test average was
classTestAverage
endl;
cout "Your test score was
testScore
endl;
cout "Your current letter score is
letterScore
endl;
cout "The color of your gradebook entry is
gradebookColor
endl;
cout "Are you passing?
bool boolalpha This line allows the word 'true' or 'false' to be printed instead of or
isStudentPassing
endl;
return ;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started