Question
Write down five lines of code that are missing in the following C++ main program. Here is the sample output: Enter the number of courses:
Write down five lines of code that are missing in the following C++ main program. Here is the sample output:
Enter the number of courses: 2
Enter a course code: OOP244NAA
Enter course credits: 3
Enter a course code: MGMT12345XYZ
Enter course credits: 5 Here is the C++ program:
const int LEN = 20;
struct Course {
char* courseCode;
int credits;
};
int main(){
Course* courses;
char code[LEN+1];
cout << "Enter the number of courses: " << endl;
cin >> numberOfCourses;
// TO-DO: Write the 5 lines of code that are missing
___________________________________ // (1)DMA for courses
___________________________________ { // (2)loop
cout << Enter a course code: ;
cin >> code;
________________________________________ // (3)DMA for coursecode
________________________________________ // (4)seting the coursecode
cout << Enter course credits: ;
__________________________________________ // (5)getting the course credit
} // end of an iteration
return 0;
}
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