Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Which of the following is NOT a valid variable in Prolog. Select one: a. _XYZ b. xyz c. XYZ d. My_X 2, The output

1. Which of the following is NOT a valid variable in Prolog.

Select one:

a. _XYZ

b. xyz

c. XYZ

d. My_X

2,

The output of compilation is code generation which typically translates a language construct into assembly language and from there into machine executable code. What language construct was the following segment of assembler code generated from?

compute R1,expression jump.eq R1,L1 statement-1 jump L2 L1: statement-2 L2:

Select one:

a. while statement

b. for loop statement

c. case statement

d. if statement

3. Which statement about abstract classes and interfaces is false?

Select one:

a. An interface cannot implement any methods, whereas an abstract class can.

b. A class can implement many interfaces but can only have one superclass.

c. An unlimited number of unrelated classes can implement the same interface.

d. It is not possible to construct either an abstract class object or an interface object.

e. All of the methods in both an abstract class and an interface are public.

4. Which of the following is NOT a valid atom in Prolog.

Select one:

a. elephant

b. ==/==

c. XYZabc

d. abcXYZ

5.

Which statement about parameters in object oriented languages (assume Java) is false?

Select one:

a. The scope of parameters is the method in whcih they are defined.

b. Two overloaded methods in the same class must have parameters with different names.

c. All parameters in java are passed by value.

d. Two different constructors in a given class can have the same number of parameters.

6.

Consider these Java class declarations: public class Person { ... } public class Teacher extends Person { ... } Which is a true statement? I Teacher inherits the constructors of Person. II Teacher can add new methods and private instance variables III Teacher can override existing private methods of Person.

Select one:

a. I only

b. II only

c. III only

d. I and II only

e. II and III only

7.

Given the following input string. aabcdde And the following regular expression. (.)\1

What will the output be?

Select one:

a. a b c d e

b. aa

c. aa dd

d. None of these answers

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals Design And Implementation

Authors: David M. Kroenke

5th Edition

B000CSIH5A, 978-0023668814

More Books

Students also viewed these Databases questions