Professional Documents
Culture Documents
Objectives
1. Refresh C++ programming skills necessary for data structures course.
2. Review important C++ concepts.
Setup
1. This is a pair-assignment, that is to be solved by students in groups of two. Every pair are
required to provide evidence for their cooperation, e.g., a photo of them working together, an audio
recording of their conversations, a video of their group work, or anything else.
2. Every pair of students should register their names with their lab TAs.
3. The assignment consists of two problems and a bonus part.
4. You need to start working yesterday. If you wait till tomorrow, it might be late to finish
and submit.
5. Read the assignment very carefully so you do not miss any details or requirements.
6. Students work submitted for marking should be original. It is not permitted to submit a
solution taken from the net, from a book, from other students or any other source. It is not permitted to
give your work to other students to submit. Violations of academic honesty will be severely punished.
7. Students who are carrying CS214 from previous years, who studied it in Java, can solve the
assignment in Java.
Assignment Description
In this assignment, you will develop an application for performing calculations on fractions.
1. First, develop a class Fraction that represents a fraction by one integer divided by another,
e.g., 1/3 or 3/7.
• This class defines adding, subtracting, multiplying, dividing and comparing (<, >, ==, <=
and >=) fractions by overloading the standard operators for these operations.
• It should also contain a function for reducing fractions. For example 2/6 is reduced after calling
the function to 1/3, etc.
• You also need to overload I/O operators to be able to input and output fractions naturally.
2. Separate class specifications from implementation by creating Fraction.h for specs and
Fraction.cpp for implementation.
3. Second, develop a class FractionCalculator that utilizes the class Fraction and
allows the user to input a fraction and perform calculations by adding, subtracting, etc. another
fraction and then keeping the result as a fraction for further calculations. The calculator always keeps
1
CS 214 – Data Structures – 2nd Semester 10/11 – Assignment 1
the most recent result and allows performing operations on it, including comparing it with a new
fraction.
Bonus (1 mark)
Students can obtain one extra mark by implementing a graphical user interface for their applications
using Qt or any other graphical user interface library.
Coding Instructions
1- Students can use any C++ IDE they like but they must write their programs in standard C++,
unless they are using Qt for graphical user interface.
2- Students must write enough comments in the program to explain its functionality.
3- Students must user proper C++ coding style and naming convensions.
Submission Instructions
1- Each student will submit their solution in one zip file, named TA-A1-ID1-ID2.zip, where TA is
the abbreviation of the name of the TA teaching you as comes below and ID1 and ID2 are the IDs of
the students in FCI. It should include a report with the following items:
2
CS 214 – Data Structures – 2nd Semester 10/11 – Assignment 1
Discussion Instructions
1- Your TA will determine your discussion time within one week from submission.
2- Both group members must attend to get the mark.
3- Bring a printed copy of the report with you to the discussion meeting, and preferably, a laptop with
your code up and running.
Assessment Criterion
The weight of this assignment is 3 marks + 1 bonus mark, divided according to the following:
1- 1.5 mark for Fractions Calculator
2- 1.5 for Matrix Calculator
3- 1 mark bonus for GUI
4- - 0.3 mark for lack of good programming style and comments.
5- - 0.3 mark for lack of softcopy or hardcopy of the report or report content or cover page.
6- - 0.3 mark for improper file naming
7- - 0.3 mark for not providing evidences of working together and cooperation.
8- - 0.3 for not using templates in problem 2.
9- - 3 marks for cheating.