Create a program which writes the following statement to the console (you do not
ID: 3882496 • Letter: C
Question
Create a program which writes the following statement to the console (you do not need to print words in color): My name is Kang Chen and I am a freshmen at Southern Illinois University. I hope to achieve an A in this course and to graduate by 2020. Where the words in: Red: is your name stored as a string variable called name Blue: is your current role stored as a string variable called yearOfStudy Yellow: is what you hope to achieve as a grade stored as a character called grade Green: is what year you expect to graduate stored as an integer called yearExplanation / Answer
#include <iostream>
using namespace std;
int main() {
string name = "Kang Chen";
string yearOfStudy = "freshman";
char grade = 'A';
int year = 2020;
cout << "My name is " << name << " and I am a " << yearOfStudy << " at Southern Illinois University ";
cout << "I hope to achieve an " << grade << " in this course and to graduate by " << year << ". ";
return 0;
}
Output:
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.