CS504 Assignment 2 Solution and Discussion


  • Cyberian's Gold

    Assignment No. 02
    

    Semester: Fall 2019
    Software Engineering-1 (CS504)
    Total Marks: 20

    Due Date: 29th November 2019

    Instructions:
    Please read the following instructions carefully before submitting assignment:
     You should submit your assignment before or on due date on VULMS.
     Your assignment should be your own work in your own words. It should not be copied from Internet, handouts or books.
     Your Assignment must be in Microsoft Word document. Assignment in other than Microsoft Word document will not be accepted.
     Assignment sent via Email will not be replied and accepted.
     If the submitted assignment does not open or file is corrupt, it will not be marked and hence awarded zero marks.

    Objectives:

    • To improve the learning of students related to Logical System Models.
    • To have hands on experience of Maintainable design approaches with regard to Coupling and Cohesion.

    This assignment covers course contents from Lecture no. 8 to Lecture no. 15.

    For any query about the assignment, contact at [email protected]

    Total Questions : 02 Total Marks: 20

    Scenario

    These days, online shopping is very popular. Different online shopping sites offer variety of products to its customers. A customer can visit the website and purchase the desired items. Store management expands its product line time to time by adding new items. A product item in the system may go through any of five states during its life cycle.

    Store management adds new items in the system which becomes available for purchase to the customers. They can also remove or disable any item which becomes unavailable to the customers. Customers can select an item to their cart and they can also remove it from the cart to be available for purchase again. Item is purchased after confirmation of the order from the customer and it will be queued for shipment. A product item might become unavailable if it runs out of stock after a purchase. A queued item can also be cancelled by the customer before it is dispatched, which will become available for purchase again. Purchased item will be dispatched to the customer after confirming the status of the product item.

    Question No. 1: (10)
    Carefully read the above mentioned scenario and identify the five possible states of product item life cycle. Also draw the State Transition Diagram for the mentioned scenario with proper labelling of the transitions.

    Question No. 2: (10)
    Suppose you are hired as a software engineer in an XYZ organization for maintaining design of an existing educational institute system. For this purpose, you will need to apply the software design principles for a good maintainable design. All the changes in the system design should be localized, so that, it should have a minimal effect on other parts of the system. A small portion of code from the existing system is given below. This code is observed to be loosely cohesive. You are required to apply the software design principles and make the code highly cohesive.

    class course {
        private:
             string course_code;
             string course_name;
             int credit_hours;
             int enrolled_student;
             int student_id;
             string student_name;
             int studentCurrentSemster;
             float student_gpa; 
                  
       public: 
          void setCourseCode(string);
          void setCourseName(string);
          void setCreditHours(int);
          void countEnrolledStudent();
          void setStudentId(int);
         
          string getCourseCode();
          string getCourseName();
          int getCreditHours();
          int getStudentId(); 
          int getStudentCurrentSemster();
    };
    

  • Cyberian's Gold


  • Cyberian's Gold



    Recent Topics


|