Starting from:
$30

$24

Lab #1 C++ Refresher and Objects Solution

Exercise #1




Design an object to represent a Person



a. Include properties such firstName, lastName,




Implement your Person object in C++ using a struct
Write a function to print out the Person



Test your functions to make sure they work



Exercise #2




Design an object to represent a Book.



Include properties such as title, author, language, year, rating etc. i. The author is a Person object



Include a Constructor that sets the title, author, publisher, year



Include methods such as print, setRating, etc.



Implement your Book in C++ using a class making all the properties private
Test the methods to make sure they work



Exercise #3




Create an array of Books



Use the data from the given file to populate your array a. Write a function to read the data from a file



Write a function to print out the all the books in the array
Write a function to reverse your array of Books



Write a function to write out the reversed array to a new file
Test your functions



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




Design an object to represent a Library



Include properties such as name, array of books, owner i. Owner is a Person object



Include a Constructor with no parameters



Include setter/getter methods for the properties
Include methods for print the library



Implement your Library in C++ using a class making all the properties private



Load the data from the file into the Library



Test your methods to make sure they work

More products