

![]()


Programming Fundamentals introduces students to the core concepts of computer programming, focusing on structured problem-solving and the design of efficient algorithms. Through hands-on experience, students learn the syntax, semantics, and logic of a programming language, typically including variables, data types, control structures, functions, and basic input/output operations. The course emphasizes developing computational thinking skills and debugging techniques, preparing students for more advanced studies in computer science and software development.
Recommended Textbook
Java Software Solutions Foundations of Program Design 7th Edition by John Lewis
Available Study Resources on Quizplus
13 Chapters
820 Verified Questions
820 Flashcards
Source URL: https://quizplus.com/study-set/1550
Available Study Resources on Quizplus for this Chatper
65 Verified Questions
65 Flashcards
Source URL: https://quizplus.com/quiz/30660
Sample Questions
Q1) What is wrong with the following class definition? public class Program1
{ public static void main(String[ ] args)
{ System.out.println("My first Java program")

Answer: The one executable statement in the main method is missing a ";" at the end of the line. Executable statements end with ";".
Q2) Java is similar in syntax to what other high level language?
A) Pascal
B) Ada
C) C++
D) FORTRAN
E) BASIC
Answer: C
To view all questions and flashcards with answers, click on the resource link above.
Page 3

Available Study Resources on Quizplus for this Chatper
77 Verified Questions
77 Flashcards
Source URL: https://quizplus.com/quiz/30661
Sample Questions
Q1) If x is the String "Hi There", then x.toUpperCase( ).toLowerCase( ); will return the original version of x.
A)True
B)False
Answer: False
Q2) Which of the following is True regarding the mod operator, %?
A) It can only be performed on int values and its result is a double
B) It can only be performed on int values and its result is an int
C) It can only be performed on float or double values and its result is an int
D) It can only be performed on float or double values and its result is a double
E) It can be performed on any numeric values, and the result always is numeric
Answer: E
Q3) You specify the shape of an oval in a Java applet by defining the oval's
A) arc locations
B) center and radius
C) bounding box
D) foci
E) none of the above, it is not possible to draw an oval in a Java applet
Answer: C
To view all questions and flashcards with answers, click on the resource link above.
Page 4

Available Study Resources on Quizplus for this Chatper
58 Verified Questions
58 Flashcards
Source URL: https://quizplus.com/quiz/30662
Sample Questions
Q1) Layout managers are associated with
A) objects
B) interfaces
C) classes
D) containers
E) none of the above
Answer: D
Q2) Write a statement using a method to guarantee that the initial will be a capital letter.
Answer: firstInitial = firstInitial.toUpperCase( );
Q3) The String class' compareTo method
A) compares two string in a case-independent manner
B) yields True or false
C) yields 0 if the two strings are identical
D) returns 1 if the first string comes lexically before the second string
E) none of the above
Answer: C
Q4) Write a statement using a Scanner method to get the first name interactively. Answer: firstName = scan.nextLine( );
To view all questions and flashcards with answers, click on the resource link above. Page 5

Available Study Resources on Quizplus for this Chatper
56 Verified Questions
56 Flashcards
Source URL: https://quizplus.com/quiz/30663
Sample Questions
Q1) A variable whose scope is restricted to the method where it was declared is known as a(n)
A) parameter
B) global variable
C) local variable
D) public instance data
E) private instance data
Q2) Assume method0 calls method1 and method2, method1 calls method3 which calls method4 and method5. Explain the chain of method calls (what order methods are called and from which method).
Q3) Every class definition must include a constructor.
A)True
B)False
Q4) An object should be encapsulated in order to guard its data and methods from inappropriate access.
A)True
B)False
Q5) Listener objects "wait" for an event to occur.
A)True
B)False
To view all questions and flashcards with answers, click on the resource link above. Page 6

Available Study Resources on Quizplus for this Chatper
37 Verified Questions
37 Flashcards
Source URL: https://quizplus.com/quiz/30664
Sample Questions
Q1) The expression (done | | s.compareTo(t) < 0) is True.
A)True
B)False
Q2) The break statement does which of the following?
A) ends the program
B) transfers control out of the current control structure such as a loop or switch statement
C) ends the current line of output, returning the cursor
D) denotes the ending of a switch statement
E) indicates the end of line when using System.out.print
Q3) Which of the following are True statements about check boxes?
A) they may be checked or unchecked
B) radio buttons are a special kind of check boxes
C) they are Java components
D) you can control whether or not they will be visible
E) all of the above
Q4) The expression (!done && x <= y) is True.
A)True
B)False
To view all questions and flashcards with answers, click on the resource link above. Page 7

Available Study Resources on Quizplus for this Chatper
36 Verified Questions
36 Flashcards
Source URL: https://quizplus.com/quiz/30665
Sample Questions
Q1) The following loop is syntactically valid. for (int j = 0; j < 1000; j++) j--; A)True B)False
Q2) Rewrite the following nested if-else statement as an equivalent switch statement. if (letter == 'A' | | letter == 'a') System.out.println("Excellent"); else if (letter == 'B' | | letter == 'b') System.out.println("You can do better"); else if (letter == 'C' | | letter == 'c') System.out.println("Try harder"); else if (letter == 'D' | | letter == 'd') System.out.println("Try much harder"); else System.out.println("Try another major! ");
Q3) Describe a situation where you should use a do loop and a situation where you should use a while loop.
Q4) Write a "query-controlled" loop that will continue to input int values from the user, adding each to the int value sum, and then ask if the user has another value to input, until the user says that there are no more values. Assume that cs1.Keyboard has been imported.
Q5) Rewrite the following if-else statement using a conditional operator. if (x > y) z = x; else z = y;
To view all questions and flashcards with answers, click on the resource link above. Page 8

Available Study Resources on Quizplus for this Chatper
76 Verified Questions
76 Flashcards
Source URL: https://quizplus.com/quiz/30666
Sample Questions
Q1) Interface classes cannot be extended but classes that implement interfaces can be extended.
A)True
B)False
Q2) An object that refers to part of itself within its own methods can use which of the following reserved words to denote this relationship?
A) inner
B) i
C) private
D) this
E) static
Q3) Provide a reason why an instance data would be declared static.
Q4) Write a static method that is passed two ChessPieces and determines if the two pieces are owned by the same player. It should return True or false.
Q5) Provide a reason why a method would be declared static.
Q6) Write code to create a JPanel with 4 JCheckBox GUI components and two JLabels for output, one that says "Current cost is" and the other that outputs the computed cost based on which of the food items has been selected.
To view all questions and flashcards with answers, click on the resource link above. Page 9

Available Study Resources on Quizplus for this Chatper
70 Verified Questions
70 Flashcards
Source URL: https://quizplus.com/quiz/30667
Sample Questions
Q1) Write a method public static int[ ][ ] matMult(int[ ][ ] x, int[ ][ ] y) which accepts two matrices, x and y, and yields their product x * y as its result. Use the normal rules for matrix multiplication. Be certain to test to see that x and y are compatible before beginning to compute the matrix product.
Q2) A Polygon object in Java can be A) built up by using a sequence of addPoint method calls B) defined by an array of x-y coordinates C) defined by a polyline
D) A, B, and C all are True E) only A and B are True
Q3) Arrays have a built in toString method that returns all of the elements in the array as one String with "\n" inserted between each element.
A)True
B)False
Q4) In Java, an array can only store one type of data. For instance, you cannot create an array that stores both double and String values.
A)True
B)False
To view all questions and flashcards with answers, click on the resource link above.
Page 10

Available Study Resources on Quizplus for this Chatper
71 Verified Questions
71 Flashcards
Source URL: https://quizplus.com/quiz/30668
Sample Questions
Q1) A mouse event is generated by
A) moving the mouse
B) clicking the mouse button
C) double clicking the mouse button
D) dragging the mouse
E) all of the above
Q2) As described in the Software Failure, the cause of the 2004 LA Air Traffic Control incident was
A) human error
B) the fact that the system had not been rebooted within 50 days
C) the fact that it takes just under 50 days for the countdown timer to count down four billion milliseconds and the subsystem shuts down when it reaches zero
D) there was no software patch to automatically reset the countdown timer without human intervention
E) all of the above
Q3) Clicking the mouse button generates three mouse events, mousePressed, mouseClicked, and mouseReleased.
A)True
B)False
To view all questions and flashcards with answers, click on the resource link above.
Page 11

Available Study Resources on Quizplus for this Chatper
70 Verified Questions
70 Flashcards
Source URL: https://quizplus.com/quiz/30669
Sample Questions
Q1) To swap the 3 and 4 elements in the int array values, you would do: values[3] = values[4]; values[4] = values[3];
A)True
B)False
Q2) What is early binding? What is late binding?
Q3) Choosers-like file choosers and color choosers-provide a mechanism for a user to make a selection among numerous alternatives, and these mechanisms are provided within the Java packages.
A)True
B)False
Q4) Comparing the amount of memory required by selection sort and insertion sort, what can one say?
A) Selection sort requires more additional memory than insertion sort
B) Insertion sort requires more additional memory than selection sort
C) Both methods require about as much additional memory as the data they are sorting
D) Neither method requires additional memory
E) None of the above
To view all questions and flashcards with answers, click on the resource link above. Page 12
Available Study Resources on Quizplus for this Chatper
68 Verified Questions
68 Flashcards
Source URL: https://quizplus.com/quiz/30670
Q1) Programmers can define their own Exceptions by extending the Exception class or one of the descendants of the Exception class.
A)True
B)False
Q2) The Timer object should be used to support which of the following types of applications?
A) animation
B) GUI input from the mouse
C) any applet application
D) input from and output to text files
E) any application that waits for user input via the keyboard
Q3) A disabled component is
A) one that is grayed out
B) one that no longer is active
C) one that is still visually apparent, but no longer functions if clicked
D) provides an indication of functionality that is not currently available
E) all of the above
Q4) A JTextArea can be used to display text, but not to edit text by the user.
A)True
B)False

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

Available Study Resources on Quizplus for this Chatper
68 Verified Questions
68 Flashcards
Source URL: https://quizplus.com/quiz/30671
Q1) If the statement a.substring(1, a.length( ) - 1) were changed to be (a.substring(1, a.length( )), then the method would
A) have infinite recursion unless the String were null
B) always return True
C) always return false
D) return True only if all characters of the String were the same
E) return True only the String had only two characters and they were the same
Q2) What does the following recursive method determine?
Public boolean question16(int[ ]a, int[ ] b, int j)
{
If (j = = a.length) return false; Else if (j = = b.length) return True; Else return question16(a, b, j+1);
}
A) returns True if a and b are equal in size, false otherwise
B) returns True if a is larger than b, false otherwise
C) returns True if b is larger than a, false otherwise
D) returns True if a and b have no elements
E) returns the length of array a + length of array b
Q3) Explain what a "base case" is in a recursive method.
To view all questions and flashcards with answers, click on the resource link above. Page 14

68 Verified Questions
68 Flashcards
Source URL: https://quizplus.com/quiz/30672
Sample Questions
Q1) The linked list is superior to the array in all ways when it comes to implementing a list.
A)True
B)False
Q2) What value is returned by the last dequeue operation (denoted above with a d3 in comments)?
A) 3
B) 5
C) 9
D) 2
E) 4
Q3) The push and enqueue operations are essentially the same operations, push is used for Stacks and enqueue is used for Queues.
A)True
B)False
Q4) The only difference between a stack and a queue is that stacks operate using FIFO and queues operate using LIFO.
A)True
B)False
To view all questions and flashcards with answers, click on the resource link above.
Page 15