100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

AMCAT Automata programming Questions And Answers

Rating
-
Sold
-
Pages
23
Grade
A+
Uploaded on
12-12-2021
Written in
2021/2022

Exam (elaborations) AMCAT Automata programming Questions And Answers AMCAT Automata Programming Questions And Answers 1) I have a problem to solve which takes as input a number n. The problem has a property that given the solution for (n-1), I can easily solve the problem for n. Which programming technique will I use to solve such a problem? a) Iteration b) Decision-making c) Object Oriented Programming d) Recursion Ans: d Recursion means calling again and again. Therefore problem n can be solved with the solution n-1, by repeatedly calling it. 2) The memory space needed by an algorithm has a fixed part independent of the problem instance solved and a variable part which changes according to the problem instance solved. In general, which of these two is of prime concern to an algorithm designer? a) Fixed part b) Variable Part c) Product of fixed part and variable part d) None of these Ans: b AMCAT Automata programming Questions And Answers AMCAT Automata Programming Questions And Answers Variable part, since it changes according to the problem instance solved. 3) Pankaj and Mythili were both asked to write the code to evaluate the following expression: a – b + c/(a-b) + (a-b)^2 Pankaj writes the following code statements (Code A): print (a-b) + c/(a-b) + (a-b)*(a-b) Mythili writes the following code statements (Code B): d = (a-b) print d + c/d + d*d If the time taken to load a value in a variable, for addition, multiplication or division between two operands is same, which of the following is true? a) Code A uses lesser memory and is slower than Code B b) Code A uses lesser memory and is faster than Code B c) Code A uses more memory and is faster than Code B d) Code A uses more memory and is slower than Code B Ans: a AMCAT Automata Programming Questions And Answers Code A uses lesser memory and it is slower than code B. Since code B uses another variable d it needs to have more memory than code A. But code B will execute faster. 4) A queue is implemented as a singly-linked-list for easy addition and deletion of elements. Each node has an element and a pointer to another node. Which node will point to empty/no location? a) Rear b) Front c) Both d) None Ans: a The new node will always be added at the rear end, so the new/empty location will be pointed by Rear end. 5) Q is an empty queue. The following operations are done on it: ADD 5 ADD 7 ADD 46 DELETE ADD 13 AMCAT Automata Programming Questions And Answers DELETE DELETE ADD 10 What will be the content of Q after these operations? Front is marked by (F) and Rear is marked by (R). a) 10(R) 13(F) b) 5(R) 10(F) c) 13(R) 10(F) d) 10(R) 5(F) Ans: a Queue follows FIFO principle, so performing the FIFO operation the Front will be pointing to 13 and Rear will be pointing to 10. 6) A is an empty stack. The following operations are done on it. PUSH(1) PUSH(2) POP AMCAT Automata Programming Questions And Answers PUSH(5) PUSH(6) POP What will the stack contain after these operations? a) 5 6 b) 1 6 c) 5 6 d) 1 5 Ans: d To an Empty Stack A, PUSH(1): 1 PUSH(2): 1 2 POP: 1 PUSH(5): 1 5 PUSH(6): 1 5 6 POP: 1 5 AMCAT Automata Programming Questions And Answers By the end of all the operation, the elements remaining are 1 5. 7) What is implied by the argument of a function? a) The variables passed to it when it is called b) The value it returns on execution c) The execution code inside it d) Its return type Ans: a The variables that are passed as inputs to a function in a function call are called arguments. 8) In a sequential programming language, code statements are executed in which order? a) All are executed simultaneously b) From top to bottom c) From bottom to top d) None of these Ans: b AMCAT Automata Programming Questions And Answers In a sequential programming language code statements are executed from top to bottom. 9) A pseudo-code is used. Assume that when two data-types are processed through an operator, the answer maintains the same data-type as the input data-types. Assume that all data-types have enough range to accommodate any number. If two different data-types are operated on, the result assumes the more expressive data-type. What will be the output of the following pseudo-code statements? Integer a = 456, b, c, d =10 b = a/d c = a – b print c a) 410 b) 410.4 c) 411.4 d) 411 Ans: d a/d = 456/10 = 45.6 =45 ( input data type and the output must be same) c = 456 – 45 = 411 AMCAT Automata Programming Questions And Answers 10) Geeta takes as input 2 integer numbers, a and b, whose value can be between 0 and 31. She stores them as 5 bit numbers. She writes the following code

Show more Read less










Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
December 12, 2021
Number of pages
23
Written in
2021/2022
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

AMCAT Automata programming
Questions And Answers

AMCAT Automata Programming Questions And
Answers
1) I have a problem to solve which takes as input a number n. The problem has a
property that given the solution for (n-1), I can easily solve the problem for n. Which
programming technique will I use to solve such a problem?

a) Iteration

b) Decision-making

c) Object Oriented Programming

d) Recursion

Ans: d

Recursion means calling again and again. Therefore problem n can be solved with the
solution n-1, by repeatedly calling it.

2) The memory space needed by an algorithm has a fixed part independent of the
problem instance solved and a variable part which changes according to the problem
instance solved. In general, which of these two is of prime concern to an algorithm
designer?

a) Fixed part

b) Variable Part

c) Product of fixed part and variable part

d) None of these

Ans: b

, AMCAT Automata Programming Questions And
Answers
Variable part, since it changes according to the problem instance solved.

3) Pankaj and Mythili were both asked to write the code to evaluate the following
expression:

a – b + c/(a-b) + (a-b)^2

Pankaj writes the following code statements (Code A):

print (a-b) + c/(a-b) + (a-b)*(a-b)

Mythili writes the following code statements (Code B):

d = (a-b)

print d + c/d + d*d

If the time taken to load a value in a variable, for addition, multiplication or division
between two operands is same, which of the following is true?

a) Code A uses lesser memory and is slower than Code B

b) Code A uses lesser memory and is faster than Code B

c) Code A uses more memory and is faster than Code B

d) Code A uses more memory and is slower than Code B

Ans: a

, AMCAT Automata Programming Questions And
Answers
Code A uses lesser memory and it is slower than code B. Since code B uses another
variable d it needs to have more memory than code A. But code B will execute faster.

4) A queue is implemented as a singly-linked-list for easy addition and deletion of
elements. Each node has an element and a pointer to another node. Which node will
point to empty/no location?

a) Rear

b) Front

c) Both

d) None

Ans: a

The new node will always be added at the rear end, so the new/empty location will be
pointed by Rear end.

5) Q is an empty queue. The following operations are done on it:

ADD 5

ADD 7

ADD 46

DELETE

ADD 13

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Expert001 Chamberlain School Of Nursing
View profile
Follow You need to be logged in order to follow users or courses
Sold
797
Member since
4 year
Number of followers
566
Documents
1190
Last sold
5 days ago
Expert001

High quality, well written Test Banks, Guides, Solution Manuals and Exams to enhance your learning potential and take your grades to new heights. Kindly leave a review and suggestions. We do take pride in our high-quality services and we are always ready to support all clients.

4.2

159 reviews

5
104
4
18
3
14
2
7
1
16

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions