Final Exam - Intro To Computer Science
What languages belong to the functional language?
LISP (car, cdr) , FORTRAN
<li>
List Items
If HAPPINESS_AFTER < HAPPINESS_BEFORE, then the act is said to be "bad."
(Utilitarian) False
69. According to a utilitarian, the act in question is "good" if HAPPINESS_AFTER > HAPPINESS_BEFORE.
(Utilitarian) True
List Alan Turing's three contributions in computer science
-Devised the Turing Machine -Broke the Enigma Code -Founder of Artificial Intelligence
7 reasons to construct a simulator?
-Existence -Physical Realization -Safety -Speed of Construction -Time Scale -Ethical Behavior -Ease of Modification
What are the 3 stages of the graphics pipeline?
-Object Modeling -Object Motion -Rendering & Display
What are the 3 types of motion?
-Translation -Rotation & Point -Reflection
The Von Neumann architecture is based on the following three characteristics:
1) Memory, ALU & I/O 2) The Stored Program Concept 3) Sequential Execution Instruction
What are the four compilation phases?
1) Scanner 2) Parser 3) Code Generator 4) Optimizer
What is the port number for FTP:
21
What is the port number for TELNET:
23
What is the port number SMTP:
25
What is the port number for HTTP:
80
Create a BNF that describes US telephone numbers such as (770) 432-0781
<us telephone number> ::= (<d><d><d>) <d><d><d>-<d><d><d><d> <d> ::= 1|2|3|4|5|6|7|8|9|0
What is a Tuple?
A Row of the table containing data about one instance of this entity
What is the Primary key?
An Attribute that uniquely identifies a tuple
45. One more exercise on Turning machine. Given the following instructions: (1, 1, 0, 1, R) (1, 0, 1, 1, R) (2, 1, 1, 1, R) What is its output when it is run on the following input tape? b 0 1 0 b
Answer is b 1 0 1 b
Write a code to input an integer and display the consecutive integers between the entered number and 0, exclusively. A sample run will be: Enter x: 5 4 3 2 1
Answer: int x; cout << "Enter x:"; cin >> x; --x; while(x > 1) { --x; cout << x; }
What is output of the following assembly code in binary? .begin load x add y subtract z store x out x halt x: .DATA 2 y: .DATA 2 z: .DATA 1 end
Answer: 011
What is the output from the following section of FORTRAN code? ISUM = 0; I = 1 20 IF (I .GT. 4) GO TO 30 ISUM = ISUM + I I = I + 1 GO TO 20 30 WRITE(*, *) ISUM
Answer: 10
What is the output of the following C++ code? int x = 3 --x; while(x > 0) { cout << x; --x; }
Answer: 2, 1
c. What is the output of the following C++ code? int x = 3 --x; while(x > 0) { cout << x; --x; } cout << x;
Answer: 2, 1, 0
Read a C++ code. a. What is the output of the following C++ code? int x = 5, y =10, z=20; if(x > z) { cout << x+y; } else { cout << x + z; }
Answer: 25
What is the value of RESULT after execution of the following COBOL code? Assume that INITIAL has the value 100 MOVE INITIAL TO INDEX ADD 1 TO INDEX ADD INITIAL TO INDEX ADD INITIAL TO INDEX GIVING RESULT
Answer: 301
Best and worst case time efficiency for Selection sort:
Best: Θ(n^2) Worst: Θ(n^2)
<body>
Body of html document
<b>
Bold
COBOL was designed to serve __what kind of___ needs
Business
What languages belong to the procedural language?
C, C++, C#, Fortran, Ada, Java, and Python
Worm
Can send copies of itself w/o being carried by a host computer
Botnet
Collection of machines called a zombie army, acting like robots under someone else's control
Virus
Computer program that infects a host computer & spreads (Has to be placed on computer via host)
What is rendering?
Converting a mathematical model, into a 3 dimensional figure
Assembler
Converts a program written in assembly language into machine code
Compiler
Converts high level languages into low level source code
<h1>
Create heading (bold with largest font size)
Network layer protocols?
Deliver's a message from the site where it was created to its ultimate destination (Assign IP addresses)
What is an attribute?
Each category of information (column)
(T/F) The cashier(s) will be busy 100% based on the following given data: Number of waiters: 2 Customer service time: 2 min Customer arrival time: every 1 min
False
Which port application accesses the Web page?
HTTP
Transport layer protocols?
Handles the ports of the computer
What is AGILE Software Development?
Having a quick, resourceful and adaptable character. ...FLEXIBLE AND ADAPTABLE THROUGH ENTIRE LIFE CYCLE.
What is Church-Turing Thesis?
If there is an algorithm to do the symbol manipulation task, then the Turing machine can do the task
What is garbage in garbage out?
If you give the computer bad Input, the computer will give you a bad output
<img>
Image file (' img src ' gives source location)
Linker
Inserts requested object code into object from code libraries
Write a code to input a width and length of a rectangle and output the area of the rectangle
Look @ Project
What is discrete event simulation?
Modeling the behavior of a system at an explicit and finite set of times
Which layer creates the IP address?
Network Layer
What is BNF?
Notation representing syntax of a language
Which layer creates the bit pipe?
Physical Layer
What is one of the main features of Java?
Portability
<i>
Italics
<a href>
Provides hyperlink address
Loader
Read Instructions from object file and store them in memory for execution
What is one of the major reasons that make C a popular language besides its relationship with Unix
Speed and Efficiency
if you write a code like this: x = x * 2, then the compiler will change it to x = x + x. This is called...
Strength Reduction
What is WATERFALL Software Development
Suggests that software development is a sequential process, and that one step has to be completed, never to be re-visited before moving to the next step
<p>
Text in a paragraph
What is deliberative strategy?
The Robot must have an internal representation of its environment; its actions are based off of this
What is one of the major reasons that make C a popular language besides its speed?
The close relationship between C and Unix.
What is utilitarianism
The doctrine that an action is right in so far as it promotes the greater happiness
What is tessellation?
The image is subdivided into a set of plane figures covering the surface
What is a Semantic Net
The mathematical sense of a graph with nodes and connecting arcs
Application layer protocols?
The rules for implementing the end user services provided by a network. (Built on top of the 4 layers in previous sections)
What is local optimization?
To improve the efficiency of local code block without caring about before or after.
Data Link layer protocols?
To make sure messages get delivered
What is a router?
Transmits messages between two distinct networks
(T/F) The cashier(s) will be busy 100% based on the following given data: Number of waiters: 1 Customer service time: 2 min Customer arrival time: every 1 min
True
<ul>
Unordered List (bulleted list)
What is a transformation matrix?
When a vector containing the (x, y, z) coordinates of a vertex point is multiplied by a matrix, the result gives a new vector translated, rotated, or reflected (x′, y′, z′)
What is wireframe modeling?
When exterior is represented by triangles or rectangles.
What is global optimization?
When the compiler code optimizes a loop (While loop) to affect the end result
What is reactive strategy?
When the robot gets stimuli from its environment using heuristic algorithms w/o filtering through reasoning via it's understanding of the environment
What is SSL?
When you secure transfer of information on the Web
What is Ceazer Cipher encryption?
When you shift characters right x many times
<html>
Whole html document
Computers do better than Humans on computational tasks. Is that true?
Yes computers do better than humans
Humans do better than Computers on reasoning tasks. Is that true?
Yes humans do better than computers
Humans do better than Computers on recognition task. Is that true?
Yes humans do better than computers
Given turing machine (1, 1, 0, 2, R) (1, 0, 1, 2, R) (2, 1, 0, 1, R) (2, 0, 1, 1, R) (0, 1, 1, 1, R) (1, b, 1, 2, R) input: b 1 1 b b b What is the output?
answer: b001bb
Given turing machine (1, 1, 0, 2, R) (1, 0, 1, 2, R) (2, 1, 0, 1, R) (2, 0, 1, 1, R) (0, 1, 1, 1, R) input: b 0 1 0 1 b What is the output?
answer: b1010b
Given turing machine (1, 1, 0, 1, R) (1, 0, 1, 0, R) (2, 1, 0, 1, R) (2, 0, 1, 1, R) (0, 1, 1, 1, R)00 input: b0101b What is the output?
answer: b1111b
Given the following facts and rules male(x) female(y) student(z) :- female(z) What is the result of the following queries? ?-female(w)
answer: no
Given the following facts and rules male(x) female(y) student(z) :- female(z) What is the result of the following queries? ?-student(x)
answer: no
Given the following facts and rules male(x) female(y) student(z) :- female(z) What is the result of the following queries? ?-male(x)
answer: yes
Given the following facts and rules male(x) female(y) student(z) :- female(z) What is the result of the following queries? ?-student(y)
answer: yes