- Type
- Final term past paper
- Course
- CS101 Introduction to Computing
- Size
- PDF 1.7 MB
- Updated
- 23 Oct 2026
You get 3 free files a day on the website. Add the Chrome extensionSign in with the extension for 30 a day.
Preview text
Text from pages 1, 2, 3 of 88. Download the file for all 88 pages.
CS101 All Past Papers Subjective Solved Questions
By WAJID MALIK WAJID4ME
Q27. What is Deterministic Algorithm? Deterministic Algorithm (1) An algorithm whose behavior can be completely predicted from the inputs That is, each time a certain set of input is presented, the algorithm gives the same results as any other time the set of input is presented. Greedy Algorithm An algorithm that always takes the best immediate, or local solution while finding an Answer Greedy algorithms may find the overall or globally optimal solution for some optimization problems, but may find less-than-optimal solutions for some instances of other problems KEY ADVANTAGE: Greedy algorithms are usually faster, since they don't consider the details of possible alternatives Greedy Algorithm: Counter Example During one of the international cricket tournaments, one of the teams intentionally lost a match, so that they could qualify for the next round If they had won that particular match, some other team would have qualified This is an example of a non-greedy algorithm Greedy Algorithm: Example A skier skiing downhill on a mountain wants to get to the bottom as quickly as possible What sort of an algorithm should the skier be using? The greedy-algorithm approach will be to always have the skies pointed towards the largest downhill slope (dy/dx), at all times What is the problem with that approach? In what situations that will be the best algorithm? In which situations would it perform poorly? 16.7 Deterministic Algorithm (1) An algorithm whose behavior can be completely predicted from the inputs That is, each time a certain set of input is presented, the algorithm gives the same results as any other time the set of input is presented. 16.8 Randomized Algorithm (1) Any algorithm whose behavior is not only determined by the input, but also values produced by a random number generator These algorithms are often simpler and more efficient than deterministic algorithms for the same problem Simpler algorithms have the advantages of being easier to analyze and implement. 16.9 Randomized Algorithm (2) These algorithm work for all practical purposes but have a theoretical chance of being wrong: Either in the form of incorrect results Or in the form of impractically long running time Example: Monte Carlo algorithms. 16.10 Deterministic Algorithm (2) There can be degrees of deterministic behavior: an algorithm that also uses a random number generator might not be considered deterministic However, if the "random numbers" come from a pseudo-random number generator, the behavior may be deterministic Most computing environments offer a “pseudo random number generators,” therefore, most randomized algorithms, in practice, behave deterministically! Question No: 28 ( Marks: 2 ) What is internet? Internet Enables users located at far-way locations to easily share information with others located all over the world Enables users to easily and inexpensively communicate with others located all over the world Enables the users to operate and run programs on computers located all over the world The Internet is unlike any previous human invention. It is a world-wide resource accessible to all of the humankind. Question No: 29 ( Marks: 2 ) In JavaScript, what is event handling? What are the two types of events? Special-purpose functions that come predefined with JavaScript They are unusual in the sense that they are mostly called from the HTML part of a Web page and not the <SCRIPT> … </SCRIPT> part What is Event Handling? Capturing events and responding to them The system sends events to the program and the program responds to them as they arrive Events can include things a user does - like clicking the mouse - or things that the system itself does - like updating the clock. Today we will exclusively focus on user-events on Focus & on Blur Question No: 30 ( Marks: 2 ) What is the error in the following JavaScript statement? student=new (2 marks)
array(10); Question No: 31 ( Marks: 3 ) Briefly mention any three problems in old modes of presentation development 1. Difficult to present 2. Difficult o modify prepared presentation 3. No electronically sharing at all 4. Multimedia files were not included
Q32. Differentiate between on Focus and on Blur. on Focus & on Blur: on Focus executes the specified JavaScript code when a window receives focus or when a form element receives input focus on Blur executes the specified JavaScript code when a window loses focus or a form element loses focus Question No: 33 ( Marks: 3 ) How many types of errors can be found during a program developement? List them. (3 marks)
Q34. any five issues of Data Management. Issues in Data Management: Data entry Data updates Data integrity Data security Data accessibility Data Entry: New titles are added every day New customers are being added every day Some of the above may require manual entry of new data into the computer systems That new data needs to be added accurately That can be achieved, for one, by user-interfaces that prevent the input of invalid data Data Updates : Old titles are deleted on a regular basis Inventory changes every instant Book prices change Shipping costs change Customers’ personal data change Various discount schemes are always commencing and concluding All those actions require updates to existing data Those changes need to be entered accurately That can also be achieved by user-interfaces that prevent the input of invalid data Data Security : All the data that BholiBooks has in its computer systems is quite critical to its operation The security of the customers’ personal data is of utmost importance. Hackers are always looking for that type of data, especially for credit card numbers Enough leaks of that type, and customers will stop doing business with BholiBooks access to authorized persons/computers only Security can also be improved through: Encryption Private or virtual-private networks Firewalls Intrusion detectors Virus detectors Data Integrity: Integrity refers to maintaining the correctness and consistency of the data Correctness: Free from errors Consistency: No conflict among related data items Integrity can be compromised in many ways: Typing errors Transmission errors Hardware malfunctions Program bugs Viruses Fire, flood, etc. Ensuring Data Integrity: Type Integrity is implemented by specifying the type of a data item: Example: A credit card number consists of 12 digits. An update attempting to assign a value with more or fewer digits or one including a non-numeral should be rejected Limit Integrity is enforced by limiting the values of data items to specified ranges to prevent illegal values Example: Age of person should not be negative Referential Integrity requires that an item referenced by the data for some other item must itself exist in the database Example: If an airline reservation is requested for a particular flight, then the corresponding flight number must actually exist Physical Integrity is ensured through hardware redundancy, backups, etc Data Accessibility: If the transaction and inventory data is placed in a disorganized fashion on a hard disk, it becomes very difficult to later search for a stored data item What is required is that: Data be stored in an organized manner Additional info about the data be storedso that the data access times are minimized What if two customers check on the aavailability of a certain title simultaneously? On seeing its availability, they both order the title – for which, unfortunately, only a single copy is available Same is the case when two airline customers try booking the only available seat A solution to this concurrency control problem: Lock access to data while someone is using it We can write our own SW that can take care of all the issues that we just discussed OR We can save ourselves lots of time, cost, and effort by buying ourselves a Database Management System (DBMS) that takes care of most, if not all, of the issues Question No: 35 ( Marks: 5 ) Define Information Technology. What are the important components of Information Technology? (2+3) The group of technologies concerned with the capture, processing and transmission of information in the digital- (5 marks)
electronic form Telecom Engineering Computer Engineering Computer Science Software Engineering Question No: 36 ( Marks: 5 ) Explain function arguments with the help of an example? Question No: 27 ( Marks: 2 ) What is output of the following JavaScript code ? Str=”Virtual University of Pakistan”; document.write(str.substring(5,str.length)) ; Virtual University of Pakistan Question No: 28 ( Marks: 2 ) Write HTML format to include gif and jpg images in a web page. <IMG src=URL, alt=text height=pixels width=pixels align="bottom|middle|top"> Question No: 29 ( Marks: 2 ) What is Harvard Mark 1? Havard mark one is the name of computer,used by us navy and it is control by pre punch paper tape and its all output was displayed on a electronic type writer
Q30. Why we need arrays in JavaScript? Question No: (2 marks)
31 ( Marks: 3 ) Who is a Computing Professional? A computer professional is a person who involved in the maintenance and development of computer software and hardware. it can be computer engineer, telecom engineer or software engineer Question No: 32 ( Marks: 3 ) Differentiate between on Load and on Unload In onload when a new document is load into a window On load execute the specified JavaScript code on the other hand in on unload when user exit the document On unload executes the specified JavaScript code
Q33. Diffentiate Local and Global Variables. Local Variables Declaring variables (using (3 marks)
the var keyword) within a function, makes them local•They are available only within the function and hold no meaning outside of it Global Variables All other variables used in a Web page (or window) are global They can be manipulated from the main code as well as from any of the functions They include: –All variables declared in the main code –All variables used but not declared in the main code –All variables used but not declared in any of the functions defined on the Web page (or window) Global variable and Local variableA) Global variables once declared they can be used any where in the program i.e. even in many functions. If possible u can use the global variables in the different user defined header files as like in packages in java. On the other hand global variables values can be changed programmatically local variables are local to a functional and cant be used beyond that function.
- Static variable and Global variable ? Static variables once declared they remain the same in the entireprogram. and those values cant be changed programatically. global variables: check above description.
1. Write a note on other virus like programs (10)
Other Virus-Like Programs
- There are other computer programs that are similar to viruses in some ways but different
in some others
- Three types:
- Logic- or time-bombs
- Worms
Related CS101 files
All CS101 files →- CS101 Final Term Current Paper Solution 2023 by Student Info 5 Final term PDF 742 KB
- CS101 Final Term MCQs 2010 by Moaaz Final term PDF 22.6 MB
- CS101 Final Term Quizzes July 2023 by Sana Sheikh Final term PDF 596 KB
- CS101 Final Term Current Paper 2020 by VUBuddy Final term PDF 486 KB
- CS101 Handouts Lectures 1-81 by Nimma Malik Handout PDF 7.7 MB
- CS101 Short Notes Lectures 1-22 Quiz DOC 374 KB
Get more out of VUBuddy, for free
- Unlimited downloads
- The explanation behind every MCQ answer
- Study offline on slow data
- 30 downloads a day instead of 3
- Sign in and buy Pro Semester here
One Pro Semester membership works in both the extension and the app.