Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

a) Using the input file students.txt, build a C++ map (or unordered_map) that has a vector of all students in every course as the

 


a) Using the input file students.txt, build a C++ map (or unordered_map) that has a vector of all students in every course as the value with the course name as the key. Your code must work for any size file and any other courses that may exist, CSC382 for example. You may assume each line in the input file two string. The first is the course identified followed by a first name. Make your code general enough so any number of students can be listed in any course. students.txt Math 141 Joe CSC335 Chris Math141 Chris CSC335 Kim Eng101 Kim CSC335 Devon Eng101 Devon b) Also, write the C++ code to generate the following output with the given small file above. Output the key, followed by a colon ":", followed by the first names in the vector separated by blank spaces. CSC335: Chris Kim Devon Eng101: Kim Devon Math 141: Joe Chris

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Programming questions

Question

Inverse of 1 x l n ( 2 e x + 3 )

Answered: 1 week ago

Question

What is memory?

Answered: 1 week ago