Sale!

EEN 218 Lab 1 C++ Refresher and Objects solution

$30.00 $25.50

Category:

Description

5/5 - (9 votes)

Exercise #1
1. Design an object to represent a Person
a. Include properties such firstName, lastName,
2. Implement your Person object in C++ using a struct
3. Write a function to print out the Person
4. Test your functions to make sure they work
Exercise #2
1. Design an object to represent a Book.
a. Include properties such as title, author, language, year, rating etc.
i. The author is a Person object
b. Include a Constructor that sets the title, author, publisher, year
c. Include methods such as print, setRating, etc.
2. Implement your Book in C++ using a class making all the properties private
3. Test the methods to make sure they work
Exercise #3
1. Create an array of Books
2. Use the data from the given file to populate your array
a. Write a function to read the data from a file
3. Write a function to print out the all the books in the array
4. Write a function to reverse your array of Books
5. Write a function to write out the reversed array to a new file
6. Test your functions
7. You can test the overall correctness by reading in the reversed file, reversing
it , writing it out, and then comparing it to the original file.
Exercise #4
1. Design an object to represent a Library
a. Include properties such as name, array of books, owner
i. Owner is a Person object
b. Include a Constructor with no parameters
c. Include setter/getter methods for the properties
d. Include methods for print the library
2. Implement your Library in C++ using a class making all the properties
private
3. Load the data from the file into the Library
4. Test your methods to make sure they work

EEN 218