Assignment #1, Jan. 17, due Tue. Jan. 30 @ 9:45 pm

test name

header file

you submit

model solution

RATS test

a1_perfect

perfect.h

perfect.h/cpp, findpn.cpp

perfect.cpp

rats.script

!! **READ THE PROBLEM IN THE TEXTBOOK, NOT ONLY HERE** !!

a1_perfect: Deitel #3.29 (p. 232). In addition, you must throw an exception BadInput if perfect() is called with a zero or negative input. Start by copying the header file above into your own file "perfect.h".

You also need to submit a demo main program findpn.cpp that uses perfect() to find and print all the perfect numbers between 1 and 1000 (inclusive) along with their factors.

1. Start by printing your name.

2. Then print each perfect number found, from low to high, and its factors on their own line, like this:

3. Finally, call perfect(-1) and print an error message in your exception handling code to prove that you caught the exception.

For more info on perfect numbers, try this link.