CSCE 2004 - Homework 6
Due Date - Nov 24, 2014 at 11:59 PM

10% off if handed in by Nov 25, 2014 at 11:59 PM
20% off if handed in by Nov 26, 2014 at 11:59 PM
30% off if handed in by Dec 1, 2014 at 11:59 PM
No credit if handed in after Dec 1, 2014

1. Problem Statement:

The primary goal of this programming assignment is to give students experience implementing and using C++ classes. To do this we will be implementing a "LinearEquation" class that stores and processes linear equations of the form "Ax + By + C = 0".

To complete this project, you must create a class with three private variables A, B, C and the following public methods:

Your main program should create several LinearEquation objects and then make a series of method calls to verify that all of the methods are implemented correctly. You do not need to create a menu-based interface to allow users to create lines or call methods.

Students are allowed to use any combination of C++ features we have discussed in class or lab. You are not required o look ahead to more advanced C++ features like operator overloading.

2. Design:

Your first step is to define the LinearEquation class by listing the private variables and the public methods in the class. To do this you will need to figure out what the parameters the methods need and what return types they will have.

Your next step is to create "skeleton" implementations of all of the class methods. Typically skeletons are empty or contain a single cout statement that prints the name of the method. You will also need to return a dummy value to get rid of compiler warning messages.

Next you should create a simple main program that creates several LinearEquation objects and calls the methods above. Your goal should be to call each method above at least two times. When you compile and run the code with skeleton methods, you will simply get a series of cout messages.

Once you have the mechanics of calling methods debugged, you can start filling in the real contents of each of the methods above. Here it is a good idea to type/debug/test each method one at a time. This way, you always have a working program you can hand in on the due date even if it is incomplete.

As you think about the implementation of the LinearEquation methods, you will realize that there are several situations where it is impossible to perform the desired operation. Your code should test for these impossible operations and print out error messages if they are detected.

Finally, you can see that the last four methods listed above are significantly more difficult than the first nine methods. You may need to spend some time reviewing your math books or wikipedia to figure out these equations.

3. Implementation:

Since you are starting with a "blank piece of paper" to implement this project, it is very important to develop your code incrementally writing comments, adding code, compiling, debugging, a little bit at a time. This way, you always have a program that "does something" even if it is not complete.

Remember to use good programming style when creating your program -- good names for variables and constants, proper indenting for loops and conditionals, clear comments, etc. Also, be sure to save backup copies of your program somewhere safe. Otherwise, you may end up retyping your whole program if something goes wrong.

4. Testing:

Test your program to check that it operates correctly for all of the requirements listed above. Also check for the error handling capabilities of the code. Try your program with several input values, and save your testing output in text files for inclusion in your project report.

5. Documentation:

When you have completed your C++ program, write a short report using the project report template describing what the objectives were, what you did, and the status of the program. Does it work properly for all test cases? Are there any known problems? Save this report to be submitted electronically.

6. Project Submission:

In this class, we will be using electronic project submission to make sure that all students hand their programming projects and labs on time, and to perform automatic analysis of all programs that are submitted.

Rename your program and documentation files 123456789.hw6.cpp and 123456789.hw6.docx using your UAID number in place of 123456789, and go the Blackboard site for this class and submit these two files.

The dates on your electronic submission will be used to verify that you met the due date above. All late projects will receive reduced credit:

You will receive partial credit for all programs that compile even if they do not meet all program requirements, so handing projects in on time is highly recommended.

7. Academic Honesty Statement:

  • Students are expected to submit their own work on all programming projects, unless group projects have been explicitly assigned.
  • Students are NOT allowed to distribute code to each other, or copy code from another individual or website.
  • Students ARE allowed to use any materials on the class website, or in the textbook, or ask the instructor and/or GTAs for assistance.
  • This course will be using highly effective program comparison software to calculate the similarity of all programs to each other, and to homework assignments from previous semesters. Please do not be tempted to plagiarize from another student.

    Violations of the policies above will be reported to the Provost's office and may result in a ZERO on the programming project, an F in the class, or suspension from the university, depending on the severity of the violation and any history of prior violations.