Question Bank

Rows per page: 1025100

Showing 201–219

Programming Languages and Software Engineering Python Language #6

Which statements is/are true about "assertion" (in Python):

✓

Best way to test precondition violation

✓

Can be disabled in production environments

✓

An example of good defensive programming

○

Are used for debugging in production environments

○

Assertions and exceptions are used to provide feedback to the client

Programming Languages and Software Engineering Python Language #7

Which is the output of the following code?

python
class A: 
  def __init__(self): 
    self.calcI(30) 
  def calcI(self, i): 
    self.i = 2 * i; 
class B(A): 
  def __init__(self): 
    super().__init__() 
    print("i from B is", self.i) 
  def calcI(self, i):  
    self.i = 3 * i; 

b = B()
○

Just the __init__ method of class B gets invoked.

○

The __init__ method of class A gets invoked and it displays “i from B is 0”.

○

The __init__ method of class A gets invoked and it displays “i from B is 60”.

✓

The __init__ method of class A gets invoked and it displays “i from B is 90”.

Programming Languages and Software Engineering Python Language #8

Which of the following statements are true regarding the opening modes of a file?

✓

When you open a file for reading, if the file does not exist, an error occurs.

○

When you open a file for writing, if the file does not exist, an error occurs.

○

When you open a file for reading, if the file does not exist, the program will open an empty file.

✓

When you open a file for writing, if the file does not exist, a new file is created.

✓

When you open a file for writing, if the file exists, the existing file is overwritten with the new content.

Programming Languages and Software Engineering Python Language #9

Which of the following statements are true about the following code?

python
s=0 
try: 
  f = open("test.txt",encoding = ’utf-8’) 
  for i in f: 
    s += len(i) 
finally: 
  f.close() 

print(s)

(This question was not marked as wrong but the commision has not been announced)

✓

the program will print the size of an existing “test.txt” file, in bytes (this should not be correct as we can have the letter â and this is represented as 2 bytes)

○

the program will crash because i is an integer

✓

the program will crash if the file does not exist

○

the program will print 0 if the file does not exist

Programming Languages and Software Engineering Software Applications Design #1

Software verification can imply

✓

automatic static analysis

○

assesing usefulness and usability of the software in operational situations.

○

debugging

✓

software inspections

✓

testing to prove error existence

○

verify that software meets user requirements

Programming Languages and Software Engineering Software Applications Design #2

State machine diagram shows

○

system functions.

✓

system response to internal events.

✓

system response to external events.

○

interactions between objects in the system.

○

data structures.

○

interactions between actors and the system.

○

data flow in the system.

Programming Languages and Software Engineering Software Applications Design #3

Agile methods in software development imply

✓

Incremental delivery

✓

Customer involvement during development process

○

Establishing normative processes for team working

✓

Periodic activities to eliminate complexity from the system

○

Modeling the whole software before writting the code

Programming Languages and Software Engineering Software Applications Design #4

Select the cases in which only concepts are reused:

○

Software services

✓

Design patterns

○

Program libraries

✓

Architectural patterns

Programming Languages and Software Engineering Software Applications Design #5

Consider the following class diagram. Check the true statements?

✓

An object of type ComputeScience contains a collection of objects of type Student.

○

Class Questionnaire has a public attribute of type String.

✓

Class ComputerScience has a public operation addStudent(s:Student).

○

Class ComputerScience has a private operation setSchedule(s:String).

✓

Class Tutor is superclass for the class Masterand.

✓

Class ComputerScience defines a composition of objects of type Questionnaire.

○

A unidirectional association exists between class ComputerScience and class Tutor.

○

Class ComputerScience inherits interface Specialization.

○

Class Tutor defines an aggregate of objects of type Masterand.

Programming Languages and Software Engineering Software Applications Design #6

Consider the following class diagram.

Which sequence of Java code correctly and completely describes the relations of class Proiect?

○
java
class Project extends Student {
  private Collection <UMLDiagram> diagrams = new LinkedList<>();
  private SourceCode code;
  ...}
✓
java
class Project {
  private Collection <Student> students;
  private Collection <UMLDiagram> diagrams = new LinkedList<>();
  private SourceCode code;
  ...}
○
java
class Project {
  private Student student;
  private UMLDiagram diagram;
  private SourceCode code;
  ...}
○
java
class Project {
  private Collection <Student> students = new LinkedList<>();
  private Collection <UMLDiagram> diagrams;
  private SourceCode code;
  ...}
Programming Languages and Software Engineering Software Applications Design #7

Consider the following class diagram.

Which sequence of Java code correctly and completely describes the relations of class Journal?

○
java
class Journal extends OnlineJurnal implements Product {
  private Collection <Article> articles;
  ...}
○
java
class Journal implements Product {
  private Collection <Article> articles = new ArrayList<>();
  private OnlineJurnal jurnal;
  ...}
✓
java
class Journal implements Product {
  private Collection <Article> articles = new ArrayList<>();
  ...}
○
java
class Journal extends OnlineJurnal {
  private Collection <Article> articles = new ArrayList<>();
  private Product product;
  ...}
Programming Languages and Software Engineering Software Applications Design #8

Consider the following class diagram.

Check the complete and correct description of the relations represented on the diagram:

○

Bidirectional association between classes Project and SourceCode;
composition between classes Project(composite) and UMLDiagram(component);
aggregation between classes Project(aggregate) and Student (component);
generalization between interface IStudent(implemented) and class Student(implements);
realization between classes Student(superclass) and class ScholarshipStudent(subclass).

✓

Bidirectional association between classes Project and SourceCode;
composition between classes Project(composite) and UMLDiagram(component);
aggregation between classes Project(aggregate) and Student(component);
realization between interface IStudent(implemented) and class Student(implements);
generalization between classes Student(superclass) and class ScholarshipStudent(subclass).

○

Bidirectional association between classes Project and SourceCode;
aggregation between classes Project(aggregate) and UMLDiagram(component);
composition between classes Project(composite) and Student(component);
generalization between interface IStudent(implemented) and class Student(implements);
realization between classes Student(superclass) and class ScholarshipStudent(subclass).

○

Bidirectional association between classes Project and SourceCode;
composition between classes UMLDiagram(composite) and Project(component);
aggregation between classes Student(aggregate) and Project(component);
realization between interface IStudent(implemented) and class Student (implements);
generalization between classes Student(superclass) and class ScholarshipStudent(subclass).

Programming Languages and Software Engineering Software Applications Design #9

Consider the following class diagram.

Which sequence of Java code correctly describes the relationship between classes Student and
Project?

○
java
class Student extends Project{...}
class Project{...}
○
java
class Project extends Student{...}
class Student{...}
✓
java
class Project {
  private Collection <Student> ...}
class Student{...}
○
java
class Project {
  private Collection <Student> ...}
class Student {
  private Project project;
  ...}
○
java
class Project {
  private Collection <Student> ...}
class Student {
  private Collection<Project> projects;
  ...}
Programming Languages and Software Engineering Software Applications Design #10

Consider the following sequence diagram.

Which operations of class RegistrationControler result from it?

✓

getCourses()

○

display(offeredCourses)

✓

register(student, selectedCourses)

○

new Schedule(selectedCourses)

○

addSchedule(theSchedule)

○

displayMsg(”OK”)

Programming Languages and Software Engineering Software Applications Design #11

Consider the following sequence diagram.

Check the classes from which the objects in the previously depicted interactions are instantiated:

✓

RegistrationForm

✓

RegistrtationControler

○

selectedCourses

○

current

✓

Student

✓

Schedule

○

theSchedule

Programming Languages and Software Engineering Software Applications Design #12

Consider the following robustness diagram.

Which statements are true?

✓

Home page is a boundary object.

○

GetBooksList can be a persistent object.

○

DisplayLinks is an object for interfacing with the system.

✓

GetBooksList could be implemented as a method of an entity class.

✓

Catalog is an entity object.

Programming Languages and Software Engineering Software Applications Design #13

Select the pair of terms to be filled in the spaces of the next statement: “In Essence ‘Checkpoint construction’ game, a checkpoint is a set of ____ to be achieved at a specific point in time in a software engineering endeavor AND is expressed in terms of ____ .”

○

criteria / activities

○

components / roles

○

alphas / activity spaces

✓

criteria / alpha states

○

alpha states / criteria

Programming Languages and Software Engineering Software Applications Design #14

Realize the correct mapping between the concept and its definition:

✓

a – 5, b – 1, c – 4, d – 3, e – 2

○

a – 5, b – 3, c – 4, d – 1, e – 2

○

a – 2, b – 1, c – 3, d – 4, e – 5

○

a – 1, b – 2, c – 3, d – 4, e – 5

○

a – 3, b – 2, c – 4, d – 5, e – 1

Programming Languages and Software Engineering Software Applications Design #15

Check the methods to avoid introducing faults into the program developing process.

✓

Every class should have a single responsibility

○

Use regular expressions to validate input values

✓

Avoid deeply nested conditional statements

○

Logging the interactions of the users with the program.

✓

Replace the body of a method with a more clear algorithm that returns the same result.

✓

Minimize the depth of inheritance hierarchies

○

Automatically save the user’s data at set intervals.

✓

Identify the aspects of the application that vary and separate them from what stays the same.

○

Check input values against the range defined by input rules.

○

Using assertions to check results from an external service.

← Prev