Has to be written in C++, the program si visual studio. Please notice: - the nam
ID: 2085690 • Letter: H
Question
Has to be written in C++, the program si visual studio.Please notice: - the name stored as string varibale. - The current role is stored as string variable and called " yearofstudy". - What you hope to achieve as graed is stored as characther called grade. Normal No S 1. (Upload as Source File) 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 vearOfStudy 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 year Note: please use variables rather than literals
Explanation / Answer
#include<iostream>
using namespace std;
int main(){
//This variable is to store your name
char name[50] = "Kang Chen";
//This variable is to store your current role
char yearOfStudy[50] = "freshmen";
//This variable is to store your grade
char grade = 'A';
//This variable is to store in which year you expect to graduate
int year = 2020;
//This line is to print the first statement
cout << "My name is " << name << " and I am a " << yearOfStudy << " at Southern IIIinois University." << endl;
//This line is to print the second statement
cout << "I hope to achieve an " << grade << " in this course and to graduate by " << year << "." << endl;
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.