Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(Language: C++) ... P7.7 When you read a long document, there is a good chance that many words occur multiple times. Instead of storing each

image text in transcribed(Language: C++)

... P7.7 When you read a long document, there is a good chance that many words occur multiple times. Instead of storing each word, it may be beneficial to only store unique words, and to represent the document as a vector of pointers to the unique words. Write a program that implements this strategy. Read a word at a time from cin. Keep a vector of words. If the new word is not contained in this vector, allocate memory, copy the word into it, and append a pointer to the new memory. If the word is already present, then append a pointer to the existing word. P7.8 Define a structure Student with a first name, last name, and course grade (A, B, C, D, or F). Write a program that reads input in which each line has the first and last name and course grade, separated by spaces. Upon reading the input, your program should print all students with grade A, then all students with grade B, and so on. .. 27.9 Enhance the program in Exercise P7.8 so that each student has ten quiz scores. The input contains the student names and quiz scores but no course grades. The program should compute the course grade. If the sum of the quiz scores is at least 90, the grade is an A. If the sum is at least 80, the grade is a B, and so on. Then print all students with grade A together with their individual quiz scores, followed by all students with grade B, and so on. ... P7.10 Define a structure Student with a name and a vector of enrolled students. Then define these functions: void print_student (Student* 5) that prints the name of a student and the names of all courses that the student takes. void print_course(Course c) that prints the name of a course and the names of all students in that course. void enroll(Student* s, Course* c) that enrolls the given student in the given course, updating both vectors. In your main function, define several students and courses, and enroll students in the courses. Then call print student for all students and print_course for all courses

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions