Starting from:

$28

Project 2 C++ class


For this project, you will create a C++ class for your data set and use logic from your previous
project to read the data from a file into 1000+ objects. Your class should have at least 5 fields
where at least one is a numerical type and at least one is a string type. You should have
constructors, getters, setters, and other methods as appropriate. You also need to create a
function that will go through your data and perform some kind of calculation on it.
Design
Consider the following questions:
- What should I name the class?
- What fields do I need? What are their types? What names make sense?
- Which fields and methods need comments to clarify their meaning?
- How will I store the 1000+ objects?
- What function makes the most sense to calculate on my data?
Example functions include:
- The sum, average, min, and/or max of a column
- The shortest/longest word in a column
- The number of times a specific value appears in a column
Requirements
It is recommended that you use the data and program from Project 1 as a starting point.
You must write a C++ class according to the specifications above.
You must read the data from a file and store it in 1000 objects using a C++ program.
You must create a function for reading data from a file and storing it in a vector of 1000+
objects. Pass the address of the vector to the function.
You must write a function that performs a calculation on the data and demonstrate that it works.
You must write about the decisions you made in this project: which fields and methods you
chose, how you know they work correctly, what calculation function you chose to implement,
why you chose it, the complexity of your methods and function, etc.
You must submit your .cpp file(s), your data file(s), and your writeup. Please submit your writeup
in PDF format.
Test
Make sure your program successfully stores all 1000+ objects from your data set, and that all
the methods of your class and your functions work as intended. When appropriate, use output
manipulations for easy readability.
Grading
The project is out of 50 points.
5 pts Program compiles and runs.
5 pts Code style. Readable, naming style is consistent, comments where appropriate.
10 pts Class satisfies requirements.
5 pts File input works correctly and is located in a function.
5 pts Data is stored in a vector of 1000+ objects.
5 pts Function to perform calculation satisfies requirements.
5 pts Methods and function are tested fully.
10 pts Writeup satisfies requirements, is easily readable, and is professional.

More products