Download - DS11-Assignment1

Transcript
  • 8/7/2019 DS11-Assignment1

    1/3

    CS 214 Data Structures 2nd Semester 10/11 Assignment 1

    Cairo University, Faculty of Computers and Information

    CS 214 Data Structures

    Assignment 1 (3+1 %) 2nd Semester 10/11 Dr. M. El-Ramly

    Start Date: 25 March 2011 Due Date 5 April 2011 Marking

    Between 5 15 April

    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 arerequired to provide evidence for their cooperation, e.g., a photo of them working together, an audiorecording 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 finishand 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 asolution taken from the net, from a book, from other students or any other source. It is not permitted togive 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 theassignment in Java.

    Assignment Description

    Problem 1: Fractions Calculator

    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 (, ==, =) 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 callingthe 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 andFraction.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. anotherfraction and then keeping the result as a fraction for further calculations. The calculator always keeps

    1

  • 8/7/2019 DS11-Assignment1

    2/3

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

    Problem 2: Matrix Calculator

    In this assignment, you will develop an application for matrix calculations.

    1. It is required to design and implement a generic class Matrix, in the form of a class templatethat accepts a type parameter. This way, when the class Matrix is instantiated, we decide if itshould accept float, int ordouble, etc.

    2. Matrix class is able to hold a matrix of any size and allocate the required memory as needed.

    3. Matrix class should have a destructor that frees used memory at the end of lifetime of eachMatrix objects.

    4. Matrix class specifications should be in a separate header .h file.

    5. It should have a pointer to pointer attribute that points to the matrix content. It should have

    suitable constructors and methods for allocating the required memory space based on thedimensions decided by the user.

    6. Overload standard operators and I/O operators to enable Matrix class with addition,subtraction and multiplication and suitable input and output capabilities. Add a method for matrixtranspose.

    7. The develop aMatrixCalculator class which offers the user a menu of operations toperform on int matrices as follows. Each of these options should be able to accept matrices ofvarying dimensions, which the user inputs. For multiplication, the calculator should check that twomatrices are of dimensions nxm and mxp.

    Welcome to (Your Name) Matrix Calculator----------------------------------------

    1- Perform Matrix Addition

    2- Perform Matrix Subtraction

    3- Perform Matrix Multiplication

    4- Matrix Transpose

    Bonus (1 mark)

    Students can obtain one extra mark by implementing a graphical user interface for their applicationsusing 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 isthe abbreviation of the name of the TA teaching you as comes below and ID1 and ID2 are the IDs ofthe students in FCI. It should include a report with the following items:

    2

  • 8/7/2019 DS11-Assignment1

    3/3

    CS 214 Data Structures 2nd Semester 10/11 Assignment 1

    a) A cover sheet that includes:

    Course code, course name, academic year, semester, instructor, assignment #, students names, IDs andemails, etc.

    b) The header files ofFraction and Matrix classes.

    c) Evidence that the students worked together.

    2- The zip file should also include two directories with your programs, one for fractions calculatorand one for matrix calculator.

    3- Both students should create rcampus accounts to be able to receive their marks.

    4- One student only need to upload the assignment in rcampus before deadline.

    5- TA Abbreviations: Walid Fouad (WF), Marwa Nabil (MN), Sara Madaawy (SM), Sara Hassan(SH), Nouran Hesham (NH), Mona Elkalamawy (ME), Desouki Abdelkawy (DA), Aya Albeely (AA),Islam Yousri (IY), Basheer Abdelfattah (BA), Elsyed Hassan (EH).

    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 withyour 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 Calculator3- 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.

    Policy on Plagiarism ) ) :

    ..1

    2..

    3. .

    4..

    5..

    6. .

    ..7

    3


Top Related