Skip to main content

Principles of Software Engineering Final Exam - 639 Verified Questions

Page 1


Principles of Software Engineering Final Exam

Course Introduction

Principles of Software Engineering introduces students to the fundamental concepts, methodologies, and tools used in the development of high-quality software systems. The course explores the software development lifecycle, including requirements analysis, system design, implementation, testing, maintenance, and project management. Emphasis is placed on best practices such as modularity, abstraction, and documentation, as well as agile and traditional development processes. Students will also examine real-world case studies and learn about software engineering ethics, teamwork, and communication skills essential for successful software projects.

Recommended Textbook

Java Foundations 3rd Edition by John Lewis

Available Study Resources on Quizplus

16 Chapters

639 Verified Questions

639 Flashcards

Source URL: https://quizplus.com/study-set/3997

Page 2

Chapter 1: Introduction

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/80262

Sample Questions

Q1) Explain the difference between a compile-time error and a run-time error. Give an example of each.

Answer: A compile-time error will cause the compiler to exit with an error, and therefore the program will not be properly translated. A program with a run-time error will compile and be translated, but will crash or throw an exception while it is running. An example of a compile-time error is forgetting a semicolon. An example of a run-time error is dividing by zero.

Q2) Name the four basic activities that are involved in a software development process.

Answer: The four basic activities that are involved in a software development process are establishing the requirements, creating the design, implementing the design and testing.

Q3) A syntax error is a _____________________.

A) a logical error

B) a compile-time error

C) a run-time error

D) a bug

E) an exception

Answer: B

To view all questions and flashcards with answers, click on the resource link above.

3

Chapter 2: Data and Expressions

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/80257

Sample Questions

Q1) Promotion is a widening data conversion that is explicitly requested by the programmer.

A)True

B)False

Answer: False

Q2) The Scanner class must be imported using the import statement before it can be used in a program.

A)True

B)False

Answer: True

Q3) Write a short program that allows the user to enter the year that they were born (as an integer) and outputs the age that they will be at the end of this year. Declare the current year as a constant.

Answer: 11edd9d0_40e5_cc0f_84e8_112d805f3fa4_TB2841_00

Q4) Write a single println statement that prints out the following line.

"There is Thingumbob shouting!" the Bellman said, Answer: System.out.println("\"There is Thingumbob shouting!\" the Bellman said,");

To view all questions and flashcards with answers, click on the resource link above. Page 4

Chapter 3: Using Classes and Objects

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/80255

Sample Questions

Q1) The Math class is part of the java.lang package.

A)True

B)False

Answer: True

Q2) Write a short program that asks the user to input a string, and then outputs the number of characters in the string.

Answer: import java.util.Scanner; public class StringLength { public static void main(String [] args) { String inputString; Scanner input = new Scanner(System.in); System.out.print("Please enter a string: "); inputString = input.nextLine(); System.out.println("Your string has " + inputString.length() + " characters!");

}//end main }//end class

Q3) Write a single statement that creates a DecimalFormat object that formats numbers to 2 decimal places.

Answer: DecimalFormat fmt = new DecimalFormat("0.##");

To view all questions and flashcards with answers, click on the resource link above. Page 5

Chapter 4: Conditionals and Loops

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/80254

Sample Questions

Q1) The ___________________ statement causes current iteration of a loop to stop and the condition to be evaluated again, either stopping the loop or causing the next iteration.

A) stop

B) halt

C) continue

D) break

E) switch

Q2) What is wrong with the following snippet of code? Rewrite it so it produces the correct output.

if(a < b)

if(a == c)

System.out.println( a < b and a == c );

else

System.out.println( a is not less than b );

Q3) An infinite loop is a compile-time error.

A)True

B)False

Q4) Write a code fragment that determines how many times the character 'A' appears in a String object called name.

Page 6

To view all questions and flashcards with answers, click on the resource link above.

Chapter 5: Writing Classes

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/80253

Sample Questions

Q1) Write a method called countSpaces that takes in a String as a parameter and returns an integer that represents the number of space characters (' ') contained in the string, false otherwise..

Q2) In a class that has variables called height and width, methods called getHeight() and getWidth() are examples of accessor methods.

A)True

B)False

Q3) Write a method called randomInRange that takes in two numbers representing a range. Print an error message and return zero if the second parameter is less than the first. Otherwise, the method should return a randomly generated integer in that range (inclusive). You may assume that the class has a static Random object called generator already declared and instantiated.

Q4) A(n) ________________ is a step-by-step process for solving a problem.

A) UML diagram

B) aggregate object

C) class

D) algorithm

E) none of the above

Q5) Explain why a static method cannot refer to an instance variable.

To view all questions and flashcards with answers, click on the resource link above. Page 7

Chapter 6: Graphical User Interfaces

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/80252

Sample Questions

Q1) A mnemonic is a short line of text that will appear when the cursor is rested momentarily on top of the component.

A)True

B)False

Q2) The keyHit event is called when a key is pressed.

A)True

B)False

Q3) Which of the following components can be toggled on or off using the mouse, indicating that a particular boolean condition is set or unset?

A) check box

B) radio button

C) slider

D) dialog box

E) none of the above

Q4) Explain the difference between check boxes and radio buttons.

Q5) Describe the areas of a border layout.

Q6) Write a short class that represents a panel with a single radio button that has the option "Yes" and the option "No." By default, the Yes button should be checked.

To view all questions and flashcards with answers, click on the resource link above. Page 8

Chapter 7: Arrays

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/80251

Sample Questions

Q1) Which of the following lines of code accesses the second element of the first array in a two-dimensional array of integers, numbers, and stores the result in a variable called num?

A) num = numbers[1][2];

B) num = numbers[0][1];

C) num = numbers.getElement(1, 2);

D) num = numbers.getElement(0, 1);

E) none of the above are correct

Q2) Write a loop that cycles through an array of String objects called names and prints them out, one per line. Your loop should not use a foreach loop.

Q3) Write the declaration for an array of doubles called averages that is initialized with an initializer list.

Q4) Every Java array is a(n) _________________, so it is possible to use a foreach loop to process each element in the array.

A) object

B) iterator

C) class

D) operator

E) none of the above

To view all questions and flashcards with answers, click on the resource link above. Page 9

Chapter 8: Inheritance

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/80250

Sample Questions

Q1) Can a class be a parent of more than one subclass? Can a class be a child of more than one parent? Explain.

Q2) The process of inheritance should establish a(n) ___________________ relationship.

A) is-a B) has-a C) static

D) not-a E) none of the above

Q3) Consider an software system that will implement the following classes: Student, Professor, StaffMember, ContractWorker. List some common attributes of these classes. What would be a good abstract class from which these classes may be extended via inheritance?

Q4) Methods and variables declared as private in a parent class cannot be accessed in a child class.

A)True

B)False

Q5) Draw a hierarchy of Animals. The hierarchy should include the following entities: Animal, Reptile, Mammal, Bear, Human, Iguana, and Dolphin.

To view all questions and flashcards with answers, click on the resource link above. Page 10

Chapter 9: Polymorphism

Available Study Resources on Quizplus for this Chatper

39 Verified Questions

39 Flashcards

Source URL: https://quizplus.com/quiz/80249

Sample Questions

Q1) Let Animal be an interface. Then it is possible to create an object by instantiating the Animal interface.

A)True

B)False

Q2) How do interfaces relate to multiple inheritance?

Q3) Describe the Iterator interface.

Q4) What is an interface?

Q5) Suppose you are implementing the comparable interface in a class representing a Person, where the ordering is based on the age of the person. Write a compareTo method for this class. You may assume that there is an instance variable called age and a method called getAge.

Q6) A single class may implement multiple interfaces.

A)True

B)False

Q7) What is polymorphism?

Q8) The next method of the Iterator interface returns a reference to the next element in a collection and removes it.

A)True

B)False

To view all questions and flashcards with answers, click on the resource link above. Page 11

Chapter 11: Recursion

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/80260

Sample Questions

Q1) The Fibonacci sequence is defined as the sum of the two previous elements of the sequence, with the first and second numbers in the sequence being 0 and 1 respectively. Write a recursive mathematical definition of the Fibonacci numbers.

Q2) Recursive solutions to problems should be used whenever possible.

A)True

B)False

Q3) The Towers of Hanoi puzzle cannot be solved iteratively.

A)True

B)False

Q4) Describe a recursive solution to the Towers of Hanoi puzzle with N disks.

Q5) In the Towers of Hanoi puzzle there are __________________ disks of different diameters.

A) 2

B) 3

C) 4

D) 5

E) The Towers of Hanoi puzzle can include any number of disks of different diameters.

Q6) Describe the Towers of Hanoi puzzle.

To view all questions and flashcards with answers, click on the resource link above. Page 12

Chapter 10: Exceptions

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/80261

Sample Questions

Q1) Write a short snippet of code that converts the first element of the String[] args array to an integer. It should catch an exception and print out a message if the first element cannot be converted to an integer.

Q2) What is exception prorogation, and how does it work in Java?

Q3) A(n) _____________________ is an object that defines an erroneous situation from which the program usually cannot recover.

A) error

B) exception

C) interface

D) try block

E) catch block

Q4) Give two examples of methods in the Exception class that can be used to output information about the Exception.

Q5) A throw statement is used to begin exception propagation.

A)True

B)False

Q6) A finally clause is always required in a try-catch block.

A)True

B)False

Page 13

To view all questions and flashcards with answers, click on the resource link above.

Chapter 12: Searching and Sorting

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/80259

Sample Questions

Q1) Quick sort works by separating a list into two lists, and recursively sorting the two lists using quick sort.

A)True

B)False

Q2) A __________________ search looks through the search pool one element at a time.

A) binary

B) clever

C) insertion

D) selection

E) linear

Q3) _____________________ is the process of finding a designated target element within a group of items.

A) Sorting

B) Searching

C) Recursing

D) Helping

E) none of the above

Q4) Explain how quick sort works.

Q5) Write a method that accepts an integer array as a parameter and sorts it using the bubble sort algorithm.

To view all questions and flashcards with answers, click on the resource link above. Page 14

Chapter 13: Trees

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/80258

Sample Questions

Q1) Which of the following tree traversals traverses the subtrees from left to right and then visits the root?

A) Preorder

B) Inorder

C) Postorder

D) Level-order

E) none of the above

Q2) A _________________ can be used as the basis for an expert system.

A) queue

B) stack

C) ternary tree

D) 4-ary tree

E) decision tree

Q3) There are four basic ways to traverse a tree, and they are all implemented recursively.

A)True

B)False

Q4) Explain the implementation of an postorder traversal.

Q5) What are the leaves of a tree?

Q6) What is the root of a tree?

Page 15

To view all questions and flashcards with answers, click on the resource link above.

Chapter 14: Introduction to Collections and Stacks

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/80248

Sample Questions

Q1) Which of the following methods inserts an element into a stack data structure?

A) enqueue

B) dequeue

C) push

D) pop

E) peek

Q2) A radix sort is a comparison-based sorting algorithm.

A)True

B)False

Q3) In a linked implementation of a stack, a pushed element should be added to the end of the list.

A)True

B)False

Q4) The peek operation on a stack returns a reference to the element at the bottom of the stack.

A)True

B)False

Q5) A queue is a FIFO structure.

A)True

B)False

Page 16

To view all questions and flashcards with answers, click on the resource link above.

Chapter 15: Heaps and Priority Queues

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/80247

Sample Questions

Q1) Does the find and add operations on a binary search tree always require at most O(log<sub>2</sub> n) comparisons? If so, why? If not, why not?

Q2) What is special about the order in which the nodes are visited in an inorder traversal of a binary search tree.

Q3) The most efficient binary search trees are balanced. A)True

B)False

Q4) If a binary search tree becomes unbalanced after an element is added, it is sometimes possible to efficiently rebalance the tree by ___________________ .

A) using left and right rotations

B) selecting a leaf node to use as a new root

C) reconstructing the tree from scratch

D) all of the above

E) it is impossible to rebalance a tree efficiently

Q5) Explain the process of removing an element from a binary search tree.

Q6) Explain how to add an element to a binary search tree.

Q7) Describe how to find an element in a binary search tree. You may use English sentences or pseudocode.

Page 17

To view all questions and flashcards with answers, click on the resource link above.

Chapter 16: Graphs

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/80256

Sample Questions

Q1) In a(n) _____________________ graph, an edge from node labeled A to a node labeled B is the same as having an edge from B to A.

A) directed

B) undirected

C) sparse

D) tree-like

E) none of the above

Q2) Write out all of the edges in a complete graph on 4 vertices.

Q3) What is the maximum number of edges in a directed graph on n vertices? Explain how you arrived at your solution.

Q4) An adjacency matrix is one approach to implementing a graph that uses a two-dimensional array.

A)True

B)False

Q5) What data structure is used to support a depth-first traversal of a graph?

Q6) Can an edge be part of more than one cycle in a graph? Explain.

Q7) A complete graph on n vertices has n(n-1)/2 edges.

A)True

B)False

Page 18

To view all questions and flashcards with answers, click on the resource link above.

Turn static files into dynamic content formats.

Create a flipbook
Principles of Software Engineering Final Exam - 639 Verified Questions by Quizplus - Issuu