Docsity

different exercise and exam, Exams of Computer Programming

Partial preview of the text

Download different exercise and exam and more Exams Computer Programming in PDF only on Docsity!

The exam has 5 parts

1. Programing (25%)

2. Software Engineering (15%)

3. Data base system (25%)

4. Internet programming (15%)

5. Networking (20%)

PART 1: PROGRAMMING

  1. Write down output of the following code fragment in the space provided. (2 marks)

Code Fragment

Int n=8}

While {n>=4}{

For {int c=2}

c<n}

c++}

{

If {n%2==0}

Cout<<”x”}

Else

Cout<<”0”}

}

Cout<<endl}

n=n-1}

}

  1. A perfect number is a number whose positive divisors, aside from itself, add up to itself. Write a(c++ or java)function named perfect which takes positive integer and returns true if the number is perfect and false otherwise .(4 marks)

Identify appropriate attributes and methods for square and rectangle classes and code the inheritance hierarchy shown in the left in java. The code has to be written in such away that the object oriented concepts (Encapsulation, Data Abstraction, Procedural abstraction, polymorphism) are manifested.

Write main function to test your implementation. Referring your code (a line or a group of lines) describe succinctly the object oriented programming concepts mentioned. ( marks)

RectangleSquare

PART 2: SOFT WARE ENGINEERING

  1. Software development projects are full of risks may cause the project to lag behind a schedule or fail entirely. List at least four examples of the risks that may cripple damage software projects .(2 marks)
  2. What is the basic difference between software architecture and software design? What similarities do the two have? (4 marks)
  3. Explain the deferens between the two important concepts in software quality: validation and verification .(4 marks)
  4. The next two sub questions are based on the case study given below .(5 marks)

A super market needs to develop software to encourage regular customers. For this, the customer needs to supply his name, address, telephone number and driving license number. A customer is assigned a unique customer number by the computer. When customer makes a purchase the value of the purchase is credited against his customer number.at the end of each year. Surprise gifts to 10 customers who have made the highest purchase are given.

A. Extract and write three functional requirements from the case study. Therequirements should have all the desired characteristics of individual requirements .(3 marks)

B. Write out two most important nonfunctionalrequirements you think for system described in the case study. The requirement should have all the desired characteristics of individual requirements .(2 marks)

PART 3: DATA BASE SYSTEM

  1. Explain the three levels of database design. (3 marks)
  2. What is the difference between stored and derived attributes? Mention examples. ( marks)
  3. Define referential integrity and show its important .(4 marks)
  4. Based on the following functional dependencies, determine the normal form of the relation SCHEDULE(explain why?)and, if necessary, bring it into a set of 3NF relations. (5 marks)

Dependences

Section#, course ID, semester ID→ room No

Section#, course ID, semester ID→ Inst _ID

Section#, course ID, semester ID→ Week _day

Section#, course ID, semester ID→ Start_time

Section#, course ID, semester ID→ End_time

Course_ID→ Course Name

Room No→ Occupancy

Inst_ID→ Instr _ name

SCHEDULE

(course ID,courseName,section#,semesterID,RoomNo,Occupancy,Inst_ID,Instr_Name,week_day ,Start_time,End_time)

  1. Draw ERD for the following scenario :(5 marks)

As apart of its project management database, a company wants to store information about recourses (employees), projects and bookings.

For each employee, the following information is stored:Employee ID,first and last name,Rank,billing rate.employees are organized into solution sets (SS),each solutionset has a head of the solution set, who is the resource owner for all employees in that ss. The each solution set we record the SSID and the SS name, for scheduling purposes, we went to store information about the head of each solution set, and about assignment of employees to solution sets. An employee’s stores information about project. For each

PART 4: INTERNT PROGRAMMING

  1. Define a socket? How read and write performed using sockets ?(3 marks)
  2. What are the major components of a web browser?

Draw aneat diagram to explain them. (4 marks)

  1. What is the advantage of caching in a web browser ?(4 marks)
  2. IP specified that diagram can arrive in a different order than they sent. If fragment from one datagram arrives at a destination before all the segments from a previous datagram arrive. How does the destination know to which datagram the fragment belong ?( marks)

PART 5: NETWORKING

  1. Bahir Dar University is establishing ICT village. The village has three building: a software development building a training building and an administration building. The software development building has four stories (floors) and each floor has about three huge development rooms that contain 25 desk top computers each. The developers use desk top, ground floor has a server room and a presentation room.

The server room contains different servers: Emailserver, webserver, database server and etc. Thepresentation room contains a camera, LCD projector and one desk top computer projector to conduct discussions,seminars and presentations. The training building is a three story (floor) building that contains two training halls, two syndicate rooms and two offices in each story. Thesyndicate roomsare used to conduct a group discussionin small groups and the officers are used for trainers. Each training rooms has25 lap tops, LCD projector, camera (mounted) and the necessary equipment’s for the training. The training manager controls all the training processes using a desk top or laptop or othermobile devices (tablet, smart phone, etc.). the training building is found on the right of the software development buildings with a distance of 200 meters. The administration building is found at the back of the software development building. It has about 10 officers, alounge and one meeting hall. Eachoffice is equipped with a desktop computer. The administration building has shared printers that can be accessed by authorized uses only.

Considering the above scenario, please answer the following questions.

a. Write type of network should be deployed (installed) in the software development building and what equipment should be installed ?(3 marks)

b. What type of network connection should be used to link the building together and where and how the internet connection be made? How do guests or visitors access to the internet in the village ?(4 marks)

  1. List the TCP/IP suit protocols and discussion in short the functionalities o each layer, the protocols found in each layer and the services each layer provides .(7markes)
  2. Considering the following network. With the indicate link costs,use Dijkstra’s shortest- pathalgorithm to compute the shortest path from X to all network nodes. Display the results in a table. (4 marks)