Homework 3, A Mini Contest
Short Description:
Write two programs that use vectors
This assignment is worth 40 points.
Goals
When you finish this homework, you should have:
- Used vectors to solve several problems.
Formal Description
I have selected two relatively simple programming contest programs which can be solved using vectors. You should create solutions to these problems using vectors. If you wish to test your solutions on Kattis, a link is given at the bottom of each problem statement.
Please solve these two problems using vectors:
- Word Cloud
- A vector of classes.
- This is more of a reading problem than a math problem. The math is not that bad.
- Name your solution file wordcloud.C or wordcloud.cpp.
- Even though this has a higher rating, it is a simpler problem (IMHO)
- You can get into an end of file like problem (but not with input, but with a form of output).
- Fast Food Prizes
- You want a vector of structs or classes for this one.
- The struct/class should probably have a vector member.
- Handle the input then worry about the solution.
- Name your solution file fastfood.C or fastfood.cpp.
Notes
- You must use vectors in your solution.
- You may use find, sort from the standard algorithm library. (But you might not need them).
- Use the following Makefile
- You would be silly not to do a design for these programs, even though they are short.
- If you need help with an algorithm let me know.
- If you like this type of problem you might consider the programming contest team.
- On a scale from 1 to 10, where 1 is easy and 10 is hard
- Word Cloud is rated 2.3
- Fast Food Prizes is rated 2.2
Required Files
A single tar file containing the source code and makefile for this program.
Submission
Submit your tar file to the D2L folder Homework 3 by the due date.