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:
- The Grand Adventure
- You might want to use the vector as a stack.
- push_back is a lot like push
- pop_back is a lot like pop
- back is a lot like top.
- name your solution file grand.C or grand.cpp.
- Fast Food Prizes
- You probably want a vector of structs or classes for this one.
- 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
- The Grand Adventure is rated 2.0
- Fast Food Prizes is rated 2.2
Required Files
A single tar file containing the source code and makefile for this program.
Submission
Email your tar file as an attachment to dbennett@edinboro.edu. Make sure that the title indicates that this is homework 3 and that your name and section are included in the body of the message.