Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This assignment is intended as a means for you to practice file IO. You will be required to have an understanding of opening a file,

This assignment is intended as a means for you to practice file IO. You will be required to have an understanding of opening a file, closing a file, reading a file a line at a time and writing to a text file a line at a time. You will also be required to do some simple parsing of information read from a text file and formatting output to be written to a text file.

This small project is geared to test your understanding of File IO.

This activity is designed to support the following Learning Objectives:

  1. Compose computer programs using a high level programming languages as a means of problem solving. This includes abstract data types, inheritance, and polymorphism
  2. Evaluate the advanced features of an object oriented programming language including arrays, pointer manipulation, recursion, and object oriented programming.

AddressBook Exception

Create an AddressBookException class that you can use to throw exceptions in your address book. Your class should have a constructor that will allow you to set the particular message that corresponds to the error.

You should use your custom exception class to throw an error in the findPerson method if the person being searched for cannot be found, in the getPerson method if the AddressBook is empty. You should also throw an error any time that the addressbook file that you are attempting to read or write from cannot be opened.

In main test your AddressBook exception class by placing a try - catch around any code that could possibly throw an error. Supply a catch block to catch the AddressBook exception and provide a catch all block just in case an exception is thrown the you may have missed.

All code needs to be documented. C++

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

What are the four kinds of employee separations?

Answered: 1 week ago

Question

b. Where did they come from?

Answered: 1 week ago