Sponsored Links


Results 1 to 3 of 3

Thread: Software Engineering-1 (CS504) Assignment 2 fall 2010 solution

  1. #1
    Administrator Xpert's Avatar
    Join Date
    May 2010
    Location
    Jhelum
    Posts
    6,251

    Icon14 Software Engineering-1 (CS504) Assignment 2 fall 2010 solution

    Sponsored Links


    Please carefully read the following instructions before attempting the assignment.

    Rules for Marking
    It should be clear that your assignment would not get any credit if:


    • The assignment is submitted after due date.
    • The submitted assignment does not open or file is corrupt.
    • The assignment is copied. Note that strict action would be taken if the submitted assignment is copied from any other student. Both students will be punished severely.


    1) You should concern recommended books to clarify your concepts as handouts are not sufficient.
    2) You are supposed to submit your assignment in .doc format. Any other formats like scan images, PDF, Zip, rar, bmp, docx etc will not be accepted
    3) You are advised to upload your assignment at least two days before Due date.
    4) This assignment file comprises of Two (2) pages.
    Important Note:

    Assignment comprises of 20 Marks. Note that no assignment will be accepted after due date via email in any case (whether it is the case of load shedding or emergency electric failure or internet malfunctioning etc.). Hence, refrain from uploading assignment in the last hour of the deadline, and try to upload Solutions at least 02 days before the deadline to avoid inconvenience later on.

    For any query please contact: CS504@vu.edu.pk

    Q1 [Marks 5+5]

    Differentiate the following
    1) Coupling and Cohesion
    2) Object-Oriented and Function-Oriented design

    Your solution should be in following format:

    Coupling
    Cohesion





    Object-Oriented Design
    Function-Oriented Design






    Q2 [4+2+4]


    1) Write down any custom built C++ Class which you think is not cohesive (or low cohesive).

    2) Write down the reason why this class (developed in Step-1) is not cohesive or low cohesive

    3) Break this class (developed in Step-1) into two (or more) separate classes that are more cohesive or (highly cohesive)

    NOTE:

    1) The example class should not be the one, given in handouts, instead write your own class.
    2) Do not send any .CPP file; instead write down the class in same solution file (i.e. MS Word file).


    Sponsored Links

  2. #2
    Junior Member
    Join Date
    Nov 2010
    Posts
    14
    where iz solution????????????

  3. #3
    Junior Member
    Join Date
    Nov 2010
    Posts
    25

    Icon14

    First question solution can be found in attachment.
    Code:
    1)	Write down any custom built C++ Class which you think is not cohesive (or low cohesive).
    
    Public I Enumerable<Employee> GetEmployeesFromDb_LowCohesion()
    
    {
        // instantiate the links
        using(SqlConnection connection = newSqlConnection(ConfigurationManager.ConnectionStrings[CONNECTION_STRING_KEY].ConnectionString))
        using(SqlCommand command = new SqlCommand("spGetEmployee", connection)) // instantiate the command
        
    {
            command.CommandType = CommandType.StoredProcedure;
    
            // try to open the links
            try
            {
                connection.Open();
            }
            catch (InvalidOperationException ex)
            {
                // log exemption
                throw;
            }
            catch (SqlException ex)
            {
                // log exemption
                throw;
            }
            catch (Exception ex)
            {
                // log exception
                throw;
            }
    
            // perform the reader & read the results
            using(SqlDataReader reader = command.ExecuteReader())
            {
                Int32 m_NameOrdinal, m_DeptOrdinal;
    
                // obtain the ordinals
                try
                {
                    m_NameOrdinal = reader.GetOrdinal(NAME);
                    m_DeptOrdinal = reader.GetOrdinal(DEPARTMENT);
                }
                catch(System.IndexOutOfRangeException ex)
                {
                    // log exemption
                    throw;
                }
    
                Collection<Employee> result = new Collection<Employee>();
    
                // interpret the results
                while(reader.Read())
                {
                    try
                   {
                        Employee emp = new Employee();
                        emp.Name = reader.IsDBNull(m_NameOrdinal) ? String.Empty: reader.GetString (m_NameOrdinal);
                        emp.Department = reader.IsDBNull (m_NameOrdinal) ? String.Empty : reader.GetString(m_DeptOrdinal);
                        result.Add(emp);
                    }
                    catch (IndexOutOfRangeException ex)
                    {
                        // Log the exemption
                        throw; // rethrow or handle gracefully here
                    }
                    catch (Exception ex)
                    {
                        // Log the universal exemption
                        throw; // rethrow or handle gracefully here
                    }
                }
    
                return result;
            }
        }
    }
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Software Engineering I CS504 Solution of Assignment No. 02 Semester Fall 2013
    By vuassignments in forum Assignments & Solutions
    Replies: 1
    Last Post: 11-30-2013, 10:22 PM
  2. Replies: 2
    Last Post: 02-04-2011, 05:00 AM
  3. Replies: 2
    Last Post: 01-21-2011, 03:58 AM
  4. Replies: 5
    Last Post: 01-11-2011, 10:40 PM
  5. CS504 Software Engineering 1 first assignment date extended fall 2010
    By Xpert in forum Virtual University Announcenments
    Replies: 0
    Last Post: 11-09-2010, 04:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
-: Vuhelp Disclaimer :-
None of the files shown here are hosted or transmitted by this server. The links are provided solely by this site's users. The administrator's or staff of Vuhelp.net cannot be held responsible for what its users post, or any other actions of its users. You may not use this site to distribute or download any material when you do not have the legal rights to do so. It is your own responsibility to adhere to these terms. If you have any doubts about legality of content or you have any suspicions, feel free to contact us.
Online Education | JhelumSoft