Lab #1 C++ Refresher and Objects Solution

$30.00

Description

Exercise #1

  1. Design an object to represent a Person

a. Include properties such firstName, lastName,

  1. Implement your Person object in C++ using a struct

  2. Write a function to print out the Person

  1. Test your functions to make sure they work

Exercise #2

  1. Design an object to represent a Book.

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

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

    1. Include methods such as print, setRating, etc.

  1. Implement your Book in C++ using a class making all the properties private

  2. Test the methods to make sure they work

Exercise #3

  1. Create an array of Books

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

  1. Write a function to print out the all the books in the array

  2. Write a function to reverse your array of Books

  1. Write a function to write out the reversed array to a new file

  2. Test your functions

  1. 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

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

    1. Include a Constructor with no parameters

    1. Include setter/getter methods for the properties

    2. Include methods for print the library

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

  1. Load the data from the file into the Library

  1. Test your methods to make sure they work


error: Content is protected !!