Question: (Exercise 2) Create - courselnfo.cpp In this exercise you will expand your timeInput.cpp, which only deals with lecture times, so that you can have more

 (Exercise 2) Create - courselnfo.cpp In this exercise you will expandyour timeInput.cpp, which only deals with lecture times, so that you can

(Exercise 2) Create - courselnfo.cpp In this exercise you will expand your timeInput.cpp, which only deals with lecture times, so that you can have more information about each lecture, and print a schedule to the student. More specifically, you should keep your Time structure from timeInput.cpp and create a new Course structure consisted of the following variables: 1. name, type string, which stores the name of the course 2. credits, type int, which stores the number of credits for the course 3. major Requirement, type bool, which tells if the course is a requirement for your major 4. avgGrade, type double, which gives the average grade (in percentage) that past students received in the course 5. days, type string, which stores the days that lectures are held 6. startTime, type Time (from exercise 1), which is the start time of the lecture 7. endTime, type Time (from exercise 1), which is the end time of the lecture Your program should read the course information from a text file called "in.txt". This file should contain the following pieces of information on the lines specified below: Line 1: Course number: How many courses the user wants to sign up for. Line 2: Name of the course Line 3: Credits Line 4: Is the course a major requirement? (1=yes, 0=no) Line 5: Average grade for the course Line 6: Lecture days Line 7: Start time of the lecture Line 8: End time of the lecture Line 9-15: Repeat same information for additional course, if it exists. Note: In order to receive full credit for this part of the lab, you MUST create the two structures, Time and Course, consisted of the proper variables. In order to read the avgGrade, you will need to convert from strings to floats. The function you can use to do so is atof, which takes in an array of characters as a parameter (again, NOT a string). To convert a string to an array of characters, use the function c_str(). Example 2: in.txt: 3 cse 20 2 0 75 Mondays 16:30:00 17:20:00 cse 30 4 1 78 Mondays and Wednesdays 16:30:00 17:45:00 math5 3 0 98 Tuesdays 09:00:00 09:50:00 Your output should be: SCHEDULE OF STUDENT COURSE 1: cse20 Note: this course is not a major requirement... Number of Credits: 2 Days of Lectures: Mondays Lecture Time: 4:30:00pm -5:20:00pm Stat: on average students get 75% in this course. COURSE 2: cse30 Note: this course is a major requirement! Number of Credits: 4 Days of Lectures: Mondays and Wednesdays Lecture Time: 4:30:00pm -5:45:00pm Stat: on average students get 78% in this course. COURSE 3: math5 Note: this course is not a major requirement... Number of Credits: 3 Days of Lectures: Tuesdays Lecture Time: 9:00:00am -9:50:00am Stat: on average students get 98% in this course

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!