Project 4, due July 17 (Tomorrow)
- Now... modify your program to keep a SORTED list of employees, 10 employees long.
- You will accept input from a file consisting of four lines of input per employee
- a first name/last name
- an id number
- a salary
- a position
- there will also be a fifth line, which is whether to continue or not.
- yes or no, alone on a line.
Project 4 use (for now):
Adam Samson
7
22000
Programmer
yes
Jason Stover
8
24000
Administrative Assistant
yes
Tom Cadel
3
27000
Assistant Manager
yes
John Dowser
4
45000
Manager
yes
Alan Weaver
10
52000
Research Scientist
yes
CS151 -- Administration
Project 5, due July 24 (Teusday).Don't sweat it, there will be lots of in class examples... Just pay attention.
- Make a deck of cards. It must be in a file called Deck.C and Deck.h
- Each Deck will read in a set of cards, from a file. The file will be the same type used in project 4 as input to the employees.
- The deck must read in the cards, with the first thirteen entries being the first suit, the second being the second suit and so on. The name of the employee read in should be the value returned as the card number, and the suit should be the title the employee carries. (Program Manager, Programmer, Project Leader, Executive).
- The deck must return a Top card, and mark that card as read, so that it is not selected again, until the deck is re-shuffled. The card returned should be a random card from the deck. This must be:
Card getTopCard();- You must also be able to get the last card drawn. This must be:
Card lastCardDrawn();- You should be able to output all cards not yet drawn as well:
void output();- More information will be given as time allows.
Sorting
Insertion Sort
- Look at element, is it in its spot?
- yes: move on
- no: move it to its correct spot.
Project 2, 3, 4
What's the point?
Project 2, 3, 4
New requirements
Additional Features
A large program, in stages
Project 2, 3, 4
Given ONLY project 4:
- We have to accept an arbitrary set of employees...
- so accept one first, and modify it
Project 2, 3, 4
Given ONLY project 4:
- We have to accept an arbitrary set of employees...
- Now accept a few employees, and deal with them, for now, don't worry about sorting, or complex searching.
Project 2, 3, 4
Given ONLY project 4:
- We have to accept an arbitrary set of employees...
- Now accept alot of employees, and now read them from a file.
- Sort the list
- Search using a real algorithm
Project 2, 3, 4
Given ONLY project 4:
- We have to accept an arbitrary set of employees...
- Last: make the set truly arbitrary, no limits... now you have a database of employees...
Strings
C-StringsStrings
Strings
C-StringsStrings
- #include <cstring>
- #include <string>
Strings
C-StringsStrings
- array
- class
Strings
C-StringsStrings
- char []
- string
Strings
C-StringsStrings
- have an ending char ('\0')
- simply are of arbitrary length
Strings
C-StringsStrings
- unsafe
- safe
Strings
Strings
- internally, are arrays, but with more
Back to Functions, classes, and blocks.
Ways to think about them
- Venn Diagrams