Computer Science CSS Paper I 2016

FEDERAL PUBLIC SERVICE COMMISSION
COMPETITIVE EXAMINATION – 2016
FOR RECRUITMENT TO POSTS IN BS 17
UNDER THE FEDERAL GOVERNMENT
COMPUTER SCIENCE PAPER I
TIME ALLOWED: THREE HOURS PART I (MCQS) MAXIMUM MARKS = 20
PART I (MCQS): MAXIMUM 30 MINUTES PART I (MCQS) MAXIMUM MARKS = 80

NOTE: (i) Part-II is to be attempted on the separate Answer Book.
(ii) Attempt ONLY FOUR questions from PART-II by selecting TWO questions from EACH SECTION.
(iii) All the parts (if any) of each Question must be attempted at one place instead of at different places.
(iv) Candidate must write Q. No. in the Answer book in accordance with Q. No. in the Q.Paper.
(v) No Page/Space be left blank he the answers. All the blank pages of Answer Book must be crossed.
(vi) Extra attempt of any question or any part of the attempted question will not be considered.

PART-II SECTION-I
Q. 2. (a) Write a program to input choice from user for temperature conversion from Fahrenheit to Celsius or Celsius to Fahrenheit. After the choice, input temperature from user and display the convened answer. Sample execution of the program is given below; (6)
1. Fahrenheit to Celsius
2. Celsius to Fahrenheit
Enter your choice: 1
Enter Temperature in Fahrenheit: 98
Same Temperature in Celsius: 36.7
Press any key to continue…
(b) Which type of computer (supercomputers. mainframe computers. minicomputers, microcomputers) will suit an individual? Justify your answer. (6)
(c) Suppose you are trying to build a Student Registration System using object oriented approach. Objective of the system is to store information of course registration of students and their course results. In C++ syntax define following classes with suitable attributes each having getdata( ) and show data( ) member functions along with suitable constructor functions; (8)
Person. Teacher, Student, Course, Section, Allocation (containing information about allocation of a course to a teacher in a semester). Registration (containing information about registration of a student in course. this class will also save course result infonnation of the student). You can add more classes which you think suitable for the system.

Q. 3. (a) Define a function named monthly-profit which will calculate the monthly profit on the given investment amount. Function will take two float arguments, percent profit rate and investment amount and return the monthly profit (float). Write function prototype, function definition and a main program to demonstrate the functionality. Sample execution of the program is given below. Note that monthly profit 4000 has been calculated by the function by doing (8/100) * 50000. User can enter any values therefore write generalized function (user variables, not given values). (6)
Enter percent profit rate: 8
Enter investment amount: 50000
Monthly profit: 4000
Press Any Key to Continue….

(b) Explain and differentiate between volatile and non-volatile memory. giving examples. (6)
(c) Suppose you are trying to build a Library Information System using object oriented approach. System should be able to keep track of books issued and returned. It should be able to calculate fine if a book is late. Currently you are required to design classes i.e. not to write C-H- code but describe which class you will define, which data members you will add. which member functions you will include in those classes. Define only suitable classes and suitable attributes (data members) in C++ ntax. Names of some classes are like. Student. Teacher. Book. Issue Book etc. You can (but not required to) extend this list of four classes if you think of some other suitable classes. (8)

Q. 4. (a) Define a structure to store records of Persons. We want to store only Name, age and address of Person. Write main program to input record of one person and display ‘Young’ if its age is less than 20 or ‘Old’ if the age is greater than 50 and ‘Middle’ if the age of person is between 21 and 49. Sample execution of the main program is given below: (6)
Enter Name = Kashif
Enter Age = 19
Enter Address = H 120, St: 08, KAR.
Person is YOUNG
Press Any Key to Continue
(b) Convert given binary numbers to Decimal, Octal and Hexadecimal. (6)
(i) 100(2) (ii) 10100(2) (iii) 1001010(2)
(c) Suppose you are designing software for a Medical Store, using object oriented techniques. Decide and define classes (like ‘Person’, ‘Customer’, ‘Salesman’, ‘Purchase’ etc.) and their attributes in C++ or Java syntax. You are not required to write any member functions and main programme. You must use inheritance where suitable. (8)

SECTION II

Q. 5. (a) Describe the followings (no description with more than three lines); (8)
i. Sibling Nodes ii. Degree of a tree iii. Leaf Node iv. Height/ Depth of a tree v. Binary Tree vi. Full Binary Tree vii. Complete Binary Tree viii. Maximum number of nodes in a Binary Tree at level L.

(b) Find the time complexity of Binary search by resolving the recurrence (given below) using iterative substitution method. (6)
T(1) =2 if n =< 1
T(n) = 4 + T(n/2) if n>1

(c) Draw the given array in the form of binary tree. Then apply ‘Build-Heap’ Algorithm to convert the given tree in the form of Max-Heap (i.e. draw final Max-heap in the form of tree and array). Finally show execution of ‘Heap-sore algorithm by rewriting the Heap array after each iteration of the algorithm. (6)
A = {8, 14, 2, 26, 10, 12, 16, 28, 20, 7}

Q. 6. (a) Write Abstract Data Types (ADT) of Stack and Queue. Include the specifications of Add, Delete, IsEmpty, IsFull functions along with their respective functions. (8)

(b) For step count expressions n2 + 10 and 2n / 4 find breakeven point i.e. for which value of n (starting from 1,2…) second expression will become greater than value of first expression. (6)

(c) In AVL tree balance factor of every node is -1 or 0 or +1. We can calculate the balance factor as Height left-sub-tree – Height right-sub-tree. Construct AVL tree from the given data; (6)
A = {8, 14, 2, 26, 10, 12, 16, 28, 20, 7}

Q. 7. (a) Draw a diagram that illustrates the process of translating a C++ source file into an executable file. Give example of each phase depicted in your diagram of compilation process. (5)
(b) Compare and contrast among compiler, interpreter and assembler. (5)
(c) Describe Software Development Life Cycle (SDLC). Explain your answer with the help of depicting and describing different phases of pure waterfall software life cycle. (5)
(d) What is the difference between SRS document and design document? What are the contents we should contain in the SRS document and design document. (5)

Q. 8. (a) What are the purposes of Data Flow diagrams, Entity-Relationship diagrams? Give an example diagram of each. (5)
(b) Explain five properties of language using the example of English. Explain why a software language like MiniJava meets these properties as well. (5)
(c) Lexical analysis: Consider the following regular expression
r1= (A | …. |Z) * (0| …. I 9)*
Describe the language defined by r1 in English. Turn r1 into an equivalent finite automaton. Remove E-moves from the finite automation. (5)
(d) What do you mean by Context Free Grammar (CFG)? Illustrate your answer with examples. (5)

890 Views

50 thoughts on “Computer Science CSS Paper I 2016

  • July 28, 2022 at 9:41 am
    Permalink

    471266 885132Depending on yourself to make the decisions can truly be upsetting and frustrating. It takes years to build confidence. Frankly it takes much more than just happening to happen. 302712

  • August 3, 2022 at 1:53 am
    Permalink

    696291 664917We are a group of volunteers and opening a new system in our community. Your web web site given us with valuable info to work on. Youve done an impressive job and our entire community will likely be grateful to you. 562147

  • August 31, 2022 at 8:04 pm
    Permalink

    828833 167707I truly enjoy looking through on this web internet site , it holds superb content material . 168839

  • September 3, 2022 at 6:17 pm
    Permalink

    That is a great tip especially to those fresh to the blogosphere. Short but very precise information… Appreciate your sharing this one. A must read post!

  • October 21, 2023 at 12:06 pm
    Permalink

    Howdy very cool web site!! Man .. Excellent .. Superb .. I will bookmark your site and take the feeds additionally?I’m glad to find numerous useful information here within the publish, we’d like develop extra techniques on this regard, thank you for sharing. . . . . .

  • October 22, 2023 at 12:17 am
    Permalink

    Excellent blog here! Also your site loads up very fast! What host are you using? Can I get your affiliate link to your host? I wish my web site loaded up as fast as yours lol

  • October 23, 2023 at 4:19 pm
    Permalink

    I found your blog site on google and test a number of of your early posts. Continue to maintain up the very good operate. I just extra up your RSS feed to my MSN Information Reader. Looking for forward to reading extra from you later on!?

  • October 24, 2023 at 3:46 am
    Permalink

    Hey! This is kind of off topic but I need some help from an established blog. Is it difficult to set up your own blog? I’m not very techincal but I can figure things out pretty quick. I’m thinking about setting up my own but I’m not sure where to begin. Do you have any tips or suggestions? Many thanks

  • October 25, 2023 at 6:15 am
    Permalink

    Throughout this grand design of things you actually secure a B+ just for effort. Where you actually lost us was first on all the specifics. You know, they say, the devil is in the details… And it could not be much more accurate right here. Having said that, let me inform you what did work. The authoring can be extremely convincing and that is most likely why I am taking the effort in order to comment. I do not make it a regular habit of doing that. 2nd, while I can certainly notice a leaps in logic you make, I am definitely not convinced of just how you seem to connect your points which inturn make the actual conclusion. For right now I will yield to your issue however hope in the future you link the facts much better.

  • October 26, 2023 at 5:38 am
    Permalink

    Out of my investigation, shopping for electronic products online can for sure be expensive, but there are some tips that you can use to help you get the best products. There are often ways to come across discount deals that could help to make one to have the best technology products at the cheapest prices. Good blog post.

  • October 27, 2023 at 8:19 am
    Permalink

    The things i have continually told men and women is that when looking for a good internet electronics retail store, there are a few issues that you have to think about. First and foremost, you should make sure to discover a reputable as well as reliable retail store that has picked up great reviews and classification from other customers and industry analysts. This will make sure that you are getting through with a well-known store to provide good assistance and help to their patrons. Thank you for sharing your ideas on this web site.

  • October 28, 2023 at 6:24 pm
    Permalink

    There may be noticeably a bundle to learn about this. I assume you made sure nice factors in options also.

  • October 29, 2023 at 11:50 pm
    Permalink

    Another thing I have really noticed is for many people, a bad credit score is the result of circumstances over and above their control. As an example they may happen to be saddled with an illness so they have excessive bills for collections. It would be due to a employment loss or perhaps the inability to work. Sometimes divorce can really send the budget in a downward direction. Thanks for sharing your thinking on this blog.

  • October 31, 2023 at 9:22 pm
    Permalink

    Useful info. Fortunate me I discovered your website by chance, and I’m shocked why this coincidence did not came about earlier! I bookmarked it.

  • November 1, 2023 at 4:44 am
    Permalink

    Thank you, I’ve just been looking for information about this topic for ages and yours is the best I’ve discovered till now. But, what about the conclusion? Are you sure about the source?

  • November 2, 2023 at 3:26 am
    Permalink

    Great work! This is the type of information that should be shared around the internet. Shame on the search engines for not positioning this post higher! Come on over and visit my web site . Thanks =)

  • November 2, 2023 at 8:01 am
    Permalink

    I do not even know how I ended up here, but I thought this post was great. I don’t know who you are but certainly you’re going to a famous blogger if you are not already ;) Cheers!

  • November 3, 2023 at 7:05 am
    Permalink

    you are really a good webmaster. The website loading speed is amazing. It seems that you are doing any unique trick. In addition, The contents are masterpiece. you have done a excellent job on this topic!

  • November 3, 2023 at 4:27 pm
    Permalink

    I think other web-site proprietors should take this website as an model, very clean and fantastic user genial style and design, as well as the content. You’re an expert in this topic!

  • November 4, 2023 at 5:39 am
    Permalink

    It?s really a cool and useful piece of info. I?m happy that you just shared this helpful info with us. Please keep us informed like this. Thank you for sharing.

  • November 5, 2023 at 12:58 am
    Permalink

    Howdy! This is kind of off topic but I need some guidance from an established blog. Is it very hard to set up your own blog? I’m not very techincal but I can figure things out pretty fast. I’m thinking about setting up my own but I’m not sure where to begin. Do you have any tips or suggestions? Thanks

  • November 5, 2023 at 9:57 am
    Permalink

    412479 807664Very man or woman speeches need to have to seat giving observe into couples. Brand new sound system just before unnecessary folks need to always be mindful of usually senior general rule from public speaking, which is to be the mini. very best man speaches 708618

  • November 6, 2023 at 4:54 am
    Permalink

    Very nice post. I just stumbled upon your weblog and wanted to say that I have really enjoyed browsing your blog posts. In any case I will be subscribing to your rss feed and I hope you write again soon!

  • November 7, 2023 at 11:33 am
    Permalink

    I have really noticed that credit restoration activity should be conducted with tactics. If not, you will probably find yourself damaging your rating. In order to be successful in fixing your credit rating you have to confirm that from this instant you pay all of your monthly costs promptly in advance of their planned date. It’s really significant given that by not accomplishing so, all other activities that you will choose to use to improve your credit position will not be helpful. Thanks for sharing your tips.

  • November 7, 2023 at 3:53 pm
    Permalink

    474362 672623Hello there, just became alert to your blog via Google, and identified that its actually informative. Im gonna watch out for brussels. Ill be grateful if you continue this in future. Several men and women will be benefited from your writing. Cheers! 548813

  • November 8, 2023 at 10:30 pm
    Permalink

    Thanks for your submission. I would like to say that the very first thing you will need to complete is determine if you really need fixing credit. To do that you will need to get your hands on a copy of your credit file. That should never be difficult, since government makes it necessary that you are allowed to have one cost-free copy of your credit report every year. You just have to inquire the right persons. You can either browse the website for your Federal Trade Commission and also contact one of the leading credit agencies immediately.

  • November 8, 2023 at 10:50 pm
    Permalink

    Hi, i think that i saw you visited my blog so i got here to ?go back the prefer?.I am trying to to find issues to enhance my web site!I suppose its good enough to make use of some of your ideas!!

  • November 9, 2023 at 9:32 am
    Permalink

    Hello! Do you know if they make any plugins to assist with Search Engine Optimization? I’m trying to get my blog to rank for some targeted keywords but I’m not seeing very good results. If you know of any please share. Thanks!

  • November 11, 2023 at 6:30 am
    Permalink

    I am really impressed with your writing skills as well as with the layout on your blog. Is this a paid theme or did you modify it yourself? Either way keep up the nice quality writing, it?s rare to see a nice blog like this one these days..

  • November 11, 2023 at 6:39 am
    Permalink

    bookdecorfactory.com is a Global Trusted Online Fake Books Decor Store. We sell high quality budget price fake books decoration, Faux Books Decor. We offer FREE shipping across US, UK, AUS, NZ, Russia, Europe, Asia and deliver 100+ countries. Our delivery takes around 12 to 20 Days. We started our online business journey in Sydney, Australia and have been selling all sorts of home decor and art styles since 2008.

  • November 12, 2023 at 7:57 pm
    Permalink

    hello!,I like your writing very much! proportion we be in contact more about your article on AOL? I require an expert on this area to resolve my problem. May be that is you! Taking a look forward to peer you.

  • November 14, 2023 at 6:25 am
    Permalink

    I have not checked in here for a while because I thought it was getting boring, but the last few posts are good quality so I guess I will add you back to my daily bloglist. You deserve it my friend :)

  • November 15, 2023 at 1:32 pm
    Permalink

    Its like you read my mind! You appear to know so much about this, like you wrote the book in it or something. I think that you could do with some pics to drive the message home a bit, but other than that, this is excellent blog. An excellent read. I will definitely be back.

  • November 18, 2023 at 5:07 am
    Permalink

    830186 86044Respect to post author, some fantastic information . 940105

  • November 18, 2023 at 7:22 am
    Permalink

    One thing I’d like to say is always that car insurance canceling is a horrible experience and if you are doing the suitable things as being a driver you may not get one. Some people do obtain the notice that they have been officially dropped by the insurance company and several have to fight to get further insurance following a cancellation. Low cost auto insurance rates are generally hard to get after the cancellation. Understanding the main reasons concerning the auto insurance cancellation can help people prevent getting rid of in one of the most critical privileges available. Thanks for the thoughts shared by your blog.

  • November 20, 2023 at 7:49 pm
    Permalink

    Would you be occupied with exchanging hyperlinks?

  • November 22, 2023 at 10:57 am
    Permalink

    Thank you a bunch for sharing this with all of us you actually recognise what you’re talking about! Bookmarked. Please also talk over with my site =). We can have a link change arrangement among us!

  • November 23, 2023 at 3:39 am
    Permalink

    I was curious if you ever considered changing the page layout of your site? Its very well written; I love what youve got to say. But maybe you could a little more in the way of content so people could connect with it better. Youve got an awful lot of text for only having 1 or 2 images. Maybe you could space it out better?

  • November 24, 2023 at 3:01 am
    Permalink

    Something else is that when searching for a good internet electronics store, look for online stores that are regularly updated, maintaining up-to-date with the newest products, the best deals, plus helpful information on services and products. This will make certain you are dealing with a shop that really stays over the competition and offers you what you should need to make intelligent, well-informed electronics purchases. Thanks for the critical tips I’ve learned from the blog.

  • November 26, 2023 at 5:47 am
    Permalink

    Magnificent web site. Lots of useful info here. I am sending it to several buddies ans also sharing in delicious. And obviously, thank you to your effort!

  • November 26, 2023 at 8:06 pm
    Permalink

    Thanks for the unique tips discussed on this site. I have observed that many insurers offer shoppers generous reductions if they prefer to insure more and more cars together. A significant amount of households currently have several vehicles these days, particularly people with elderly teenage young children still living at home, and the savings upon policies might soon begin. So it makes sense to look for a great deal.

  • November 28, 2023 at 5:52 am
    Permalink

    Have you ever considered writing an e-book or guest authoring on other blogs? I have a blog based on the same ideas you discuss and would love to have you share some stories/information. I know my readers would value your work. If you are even remotely interested, feel free to shoot me an e-mail.

  • November 30, 2023 at 12:25 am
    Permalink

    Thanks for sharing excellent informations. Your site is very cool. I am impressed by the details that you?ve on this website. It reveals how nicely you understand this subject. Bookmarked this web page, will come back for extra articles. You, my pal, ROCK! I found just the information I already searched everywhere and just couldn’t come across. What a perfect site.

  • December 1, 2023 at 8:27 am
    Permalink

    Hmm is anyone else encountering problems with the images on this blog loading? I’m trying to figure out if its a problem on my end or if it’s the blog. Any suggestions would be greatly appreciated.

  • December 2, 2023 at 4:32 am
    Permalink

    I have been browsing online greater than 3 hours as of late, yet I by no means found any attention-grabbing article like yours. It?s beautiful value sufficient for me. In my opinion, if all web owners and bloggers made just right content material as you did, the web will probably be much more helpful than ever before.

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: