Course: CPS 161: An Intro to Programming with Java - DL MM MASTER

Q: what  color is the sky
- hazel
- blue
- red
- green
A: blue

Q: Who was our first president
- G Washington
- Abe Lincoln
- Fred Flintstone
- Barney Fife
A: G Washington

Q: What is the output from the BeerSong.java program
- There are 99 bottles of beer on the wall
- There are 909 bottles of beer on the wall.
- Nothing. This line of code is ambiguous and will not compile
A: There are 909 bottles of beer on the wall.

Q: What is the output from the Divide1.java program
- 3.33333333333
- 3.3
- 3
- 0
A: 3

Q: What is the output from running the Divide2.java program:
- 3.0
- 3.33333333333
- 3.3
- 0.0
A: 3.0

Q: What is the result of running the Divide3.java program:
- The output will be: 4.1
- The output will be 4 because y will receive the value 12 and lose the fractional part
- A compile error will happen at line number 4 because a double can't be stored into an int
- A compile error will happen at line number 5 because you can't do the integer divide of 12.3/3
A: A compile error will happen at line number 4 because a double can't be stored into an int

Q: What is the result of running IfGrade.java program:
- The output will be AC
- The output will be BC
- A compile error will happen at line number 8
- The output will be  ABC
A: The output will be  ABC

Q: What is the output from the IfElseIfGrade.java program:
- The output will be A
- The output will be ABC
- A compile error will happen at line number 8
- The output will C
- The output will B
A: The output will be A

Q: Click on Switch1.java.

What is the output from Switch1.java if the user enters in 5
- No output
- even
- greater than 7
- odd
A: odd

Q: Click on Switch1.java.

What is the output from Switch1.java if the user enters in 9
- even
- odd
- greater than 7
- No Output
A: greater than 7

Q: Click on Switch1.java.

What is the output from Switch1.java if the user enters in 4
- odd
- even
- No Output
- greater than 7
A: even

Q: What is the output from the ForLoop1.java program
- 4710
- 7
- 47
- 4
- Compile error: "Illegal static void main error"
A: 47

Q: What is the output from the WhileLoop1.java program
- 10 30
- 10 30 50
- 10 30 50 70
- 10, 30
A: 10 30 50

Q: What is the output from the DoWhile1.java program
- 55 35 15
- 35 15
- 55 35 15 -5
- 35, 15
A: 55 35 15

Q: Click on PrintSomething.java.

What is the output from the CallPrintSomething1.java program
- Compile error: "Ambiguous print call in PrintSomething.java"
- double int int
- boolean
- int int int
- 10 20 30
A: int int int

Q: Click on PrintSomething.java.

What is the output from the CallPrintSomething2.java program
- 10.0 20 30
- int int int
- Compile error: "Ambiguous print call in PrintSomething.java"
- double int int
- boolean
A: double int int

Q: Click on PrintSomething.java.

What is the output from the CallPrintSomething4 program
- double int int
- long int int
- 10 20 30
- Compile error: "Ambiguous print call in PrintSomething.java"
- int int int
A: double int int

Q: Click on PrintSomething.java.

What is the output from the CallPrintSomething3.java program
- false
- double int int
- int int int
- Compile error: "Ambiguous print call in PrintSomething.java"
- boolean
A: boolean

Q: Click on MyClass.java.

What happens when CallMyClass1.java is executed
- A compile error occurs because a constructor with no parameters is not available.
- The program runs with an output of "doit"
- You will get a null pointer exception
- A compile error happens because the doit method is not public
A: The program runs with an output of "doit"

Q: Click on MyClass.java.

What happens when CallMyClass2.java is executed
- A compile error occurs at line 9
- A compile error occurs at line 10
- A compile error occurs at line 6
- The program compiles and generates the output "doit"
- The program compiles and gets a runtime error at line 6 because mc1 was not constructed
A: The program compiles and gets a runtime error at line 6 because mc1 was not constructed

Q: Click on MyClass.java.

What happens when the CallMyClass3.java program is executed
- A compile error occurs at line 12
- A compile error occurs at line 6
- A compile error occurs at line 7
- The program compiles and generates the output "doit3"
- The program compiles and gets a runtime error at line 7 because mc2 was not constructed
A: The program compiles and generates the output "doit3"

Q: Click on MyClass.java.

What happens when the CallMyClass4.java program is executed
- A compile error occurs at line 12
- A compile error occurs at line 6 because a constructor with zero parameters does not exist.
- A compile error occurs at line 7
- The program compiles and generates the output "doit1"
- The program compiles and gets a runtime error at line 7 because mc2 was not constructed
A: A compile error occurs at line 6 because a constructor with zero parameters does not exist.

Q: What is the output of the IndexOfSubstring.java program.
- 01
- 01234
- 012
- 4
- 3
A: 012

Q: What is the output of the IndexOfSubstring2.java program.
- 0123456789
- -1
- 012
- 234
A: 0123456789

Q: What is the output of the StringTokenizer1.java program:
- Brave new world
- Brave
- *Brave*new*world
- Brave*new*world*
A: Brave*new*world*

Q: The output of StringEqualityTest1.java is: true
- True
- False
A: False

Q: The output of StringEqualityTest2.java is:  true
- True
- False
A: True

Q: The output from running ForLoop2.java is:
- 10 8 6 4 2 0
- 2 4 6 8 10
- 10, 8, 6, 4, 2
- 10 8 6 4 2
A: 10 8 6 4 2

Q: The output from running WhileLoop2.java is:
- 2 3 4 5
- 1 2 3 4
- 1, 2, 3, 4
- 2 3 4
A: 1 2 3 4

Q: The output from running the PrimitiveParameterPassing1.java program is:
- 237
- 100237
- 0 because the variable "inv" is passed as "Call by Value"
A: 237

Q: For which of the following looping constructs, is the code guaranteed to execute at least once?
- while
- do-while
- for
- None of the other answers.
A: do-while

Q: What is the output for ForLoop3.java:
- I is 0
I is 1
Out of for loop
- I is 0
Out of for loop
- I is 0
I is 1
I is 1
Out of for loop
- Out of for loop
A: I is 0
I is 1
Out of for loop

Q: The output from running ForLoop4.java is:
- :1:4:7:10
- :1:4:7
- 1 4 7 10
- 1, 4, 7
A: :1:4:7

Q: Click on Person.java

The output from running CallPerson2.java is:
- true for ==
false for equals
- false for ==
false for equals
- true for ==
true for equals
- false for ==
true for equals
A: false for ==
true for equals

Q: Click on Person.java

The output from running CallPerson3.java is:
- Joe : 50
- Jane 25
- Jane : 25
- Joe 50
A: Jane : 25

Q: The output from running ParameterPassing2.java is:
- 1 16
- 2 16
- 2 15
- 1 15
A: 1 16

Q: What is the output from running ParameterPassing3.java:
- Nick is good Sam is good
- Nick is good Sam
- Nick Sam
- Nick Sam is good
A: Nick Sam is good

Q: What is the output of running ForLoop5.java:
- pear orange apple pear
- apple orange pear pear
- apple orange pear apple
- Compile error: default can't be the first statement in a switch
A: apple orange pear apple

Q: What is the output from running Function1.java:
- 2 6 8
- 2 3 4
- 2 6 12
- 2 6 24
A: 2 6 24

Q: What is the output of running Function2.java:
- 1 3
- 3 5
- 1 2
- 1 3
A: 1 2

Q: What is the output from running ReferenceEquality1.java:
- a and b are the same
- a and b are not the same
- A compile error, because of a problem on line number 11.
- A compile error, because of a problem on line number 13.
A: a and b are the same

Q: The output from running ReferenceEquality2.java is:
- a and b are the same
- a and b are not the same
- Nothing. This code will not compile due to line 5.
A: a and b are not the same

Q: The output of IndexOf1.java is:
- index is negative
- index is greater than len
- index is less than len
- index is equal to len
A: index is less than len

Q: Click on StringUtils.java

What is the output from CallStringUtils2.java
- A compile error occurs on line 8
- 4
- 5
- 6
A: 6

Q: Click on Person.java

What is the output from running CallPerson1.java:
- Joe : 50
- Joe 50
- Jane : 25
- Joe 50 Jane 25
A: Joe : 50

Q: Click on StringUtils.java

What is the output from CallStringUtils1.java
- 5
- 4
- 6
- A compile error will occur on the statement in lines 5 and 6.
A: 5

Q: What is the output of the following:

System.out.print(3 + 3*(7/2));
- 12
- 13
- 21
- 18
A: 12

Q: What is the output of the following:

System.out.print(3 + 3*7/2);
- 12
- 13
- 21
- 18
A: 13

Q: What is the output of the following:

System.out.print((3 + 3)*7/2);
- 12
- 13
- 21
- 18
A: 21

Q: What is the output of the following:

System.out.print((3 + 3)*(7/2));
- 12
- 13
- 21
- 18
A: 18

Q: What is the output of the following:

System.out.printf("**%6.1f**", 1.234567);
- **1.234567**
- ** 1.234567**
- 1.2
- **   1.2**
A: **   1.2**

Q: What is the output of the following:

System.out.printf("%s = %f", "xyz", 1.234567);
- %s = %f xyz 1.234567
- s = 1.2
- xyz = 1.2
- xyz = 1.234567
A: xyz = 1.234567

Q: According to the syllabus/class policy, check all of the following that are good ways to watch the videos
- Watch the video while taking notes
- Watch the video while watching TV
- Trying to create the program described in the video while watching
- Watch the videos while sending text messages.
A: Watch the video while taking notes; Trying to create the program described in the video while watching

Q: According to the syllabus/class policy, which statements are true about late assignments. (Check all that apply)
- No assignment can be turned in after the due date.
- All assignments should be turned in after the due date.
- Assignments turned in after the due date will have a lateness deduction.
- There are 3 "free passes" which can be used to wipe out lateness deductions
A: Assignments turned in after the due date will have a lateness deduction.

Q: According to the syllabus/class policy, which statements are true about late assignments. (Check all that apply)
- If an assignment is late 1 day the lateness penalty is 25%
- If an assignment is late 2 days the lateness penalty is 27%
- If an assignment is late 2 days the lateness penalty is 25%
- If an assignment is late 7 days the lateness penalty is 40%
- If an assignment is late 25 days the lateness penalty is 40%
- If an assignment is late 35 days the lateness penalty is 50%
A: If an assignment is late 1 day the lateness penalty is 25%; If an assignment is late 2 days the lateness penalty is 25%; If an assignment is late 7 days the lateness penalty is 40%; If an assignment is late 25 days the lateness penalty is 40%

Q: If something bad happens such that I am late on an assignment, which of the following actions can be taken?
- Ask to use of of my "Free Passes" to waive the lateness penalty.
- Get a an appropriate note (such as a note from the doctor) to document the problem and bring it to the instructor.
- Enter into the assignment comments a description of the problem and turn in the assignment once it is completed. Get caught up as soon as possible. Come see the instructor on the last day of classes.
- Request an extension of the deadline. The instructor can usually give out one extension.
A: Enter into the assignment comments a description of the problem and turn in the assignment once it is completed. Get caught up as soon as possible. Come see the instructor on the last day of classes.

Q: According to the "Getting Help" button in blackboard, what are the good options available for getting help. (Check all that apply)
- Come to one of the MM sections or any available office hours
- Come to one of the "On Campus Group Study Sessions"
- Post a question on a class discussion board and hope to get an answer from a fellow student.
- Looking for a completed solution posted on the discussion board.
A: Come to one of the MM sections or any available office hours; Come to one of the "On Campus Group Study Sessions"; Post a question on a class discussion board and hope to get an answer from a fellow student.

Q: Which of the following are true about email. (Check all that apply)
- Class emails will automatically come to your Student email address, so it is good to monitor this on a regular basis.
- Blackboard knows your personal non-student email addresses and that is where you will receive class emails
- Sending an email to the teacher is the best way to get help. This should be done immediately whenever I am stuck on anything.
- It is a good idea to send an email to the teacher when I want to schedule a Go-to Meeting.
A: Class emails will automatically come to your Student email address, so it is good to monitor this on a regular basis.; It is a good idea to send an email to the teacher when I want to schedule a Go-to Meeting.

Q: Check all of the possible times to have a "Go-to Meeting"
- During any available office hour. Calling the posted "office phone number" will allow me to request the "go-to meeting".
- During an on Campus Group study session
- In the morning when Clem plays Raquetball
- During an MM section meeting.
- Anytime, because clicking on the provided link will alert the teacher to your need.
A: During any available office hour. Calling the posted "office phone number" will allow me to request the "go-to meeting".; During an MM section meeting.

Q: Which of the following is true about Class Participation (Check all that apply).
- For each assignment, I must make a post of 1 question AND 1 answer AND 1 discovery AND 1 set of lecture notes
- Just posting 1 question on the discussion board will satisfy my Class participation requirement.
- Just posting 1 answer on the discussion board will satisfy my Class participation requirement.
- Just posting 1 Discovery on the discussion board will satisfy my Class participation requirement.
- Just posting 1 set of lecture notes on the discussion board will satisfy my Class participation requirement.
- Just posting a copy of my completed assignment on the discussion board will satisfy my Class participation requirement.
A: Just posting 1 question on the discussion board will satisfy my Class participation requirement.; Just posting 1 answer on the discussion board will satisfy my Class participation requirement.; Just posting 1 Discovery on the discussion board will satisfy my Class participation requirement.; Just posting 1 set of lecture notes on the discussion board will satisfy my Class participation requirement.

Q: According to the syllabus/class policy, it is OK to team up with another student and turn in the same code for an assignment as long as we indicate this in the Student comments section.
- True
- False
A: False

Q: According to the syllabus/class policy, if I am stuck on an assignment, I can ONLY get help from the Group study facilitator or the teacher.

Another student can't help me with my problem.
- True
- False
A: False

Q: Good reasons to show up to a Mixed Mode class session. Check all that apply.
- I can watch video lectures with "Ear buds" and ask questions whenever something needs clarification.
- I can work on assignments and get timely help when I am stuck
- I can use the WCC computers to do my Facebook
- I will improve my grade because of the "Practice bribe formula"
- Programming requires consistent practice. Coming to an MM class section gives me an opportunity to practice my programming skills by working on my assignments.
A: I can watch video lectures with "Ear buds" and ask questions whenever something needs clarification.; I can work on assignments and get timely help when I am stuck; I will improve my grade because of the "Practice bribe formula"; Programming requires consistent practice. Coming to an MM class section gives me an opportunity to practice my programming skills by working on my assignments.

Q: When I take a test and I am allowed to access the web, then this means that I can do the following: (Check all that apply)
- I can access the Class web site(Course Content), and any links found in the class web site
- I can post a question on "Stack-Overflow" to get assistance
- I can post my completed solution on a "Web Test Bank"
- I can post my completed solution on the Discussion board associated with the class
A: I can access the Class web site(Course Content), and any links found in the class web site

Q: Which of the following is true about Mixed Mode (MM) and Distance Learning(DL) (Check all that apply)
- A DL student is not allowed in an MM section.
- A DL student can attend any MM section listed in the "Getting Help" button in Blackboard.
- MM students can show up in any MM section listed in the "Getting Help" button in Blackboard .... including the MM sections related to other classes. i.e. a cps161 student can attend an MM cps261 class.
- If an MM student gets 80% on all of his work and fails to show up to some of his MM sections, his grade will be lower than 80%.
- An MM or DL student who gets 80% on all his work will get a higher grade by attending some of the MM sections.
A: A DL student can attend any MM section listed in the "Getting Help" button in Blackboard.; MM students can show up in any MM section listed in the "Getting Help" button in Blackboard .... including the MM sections related to other classes. i.e. a cps161 student can attend an MM cps261 class.; An MM or DL student who gets 80% on all his work will get a higher grade by attending some of the MM sections.

Q: Good reasons for attending MM class meetings (Check all that apply)
- You will get answers to the tests and to hear the extra lectures that are not online.
- Provide a regular class time to make progress for those students who would otherwise procrastinate and put things off to the last minute.
- Find a job in the industry
- To do your facebook
- To allow you to pair up with another student and do the work as a group project.
- To earn "Practice Points" for doing extra Practice Problems and to have an opportunity to ask questions as needed
A: Provide a regular class time to make progress for those students who would otherwise procrastinate and put things off to the last minute.; To earn "Practice Points" for doing extra Practice Problems and to have an opportunity to ask questions as needed

Q: Class Participation: (check all that apply)
- To get credit for class participation, you will need to post a Question AND an Answer AND a sharing.
- A single question will give you your credit for Class Participation
- You can get credit for Class Participation by posting on the "Questions for the Instructor" discussion board.
- The Sharing discussion board can be used for sharing your phone number and address so you can meet new friends. This will count as "Class Participation".
- You can get emails when some one answers your question if you use the blackboard subscribe feature.
- You don't have to worry about the subject line because the default blackboard subject line provides the information we need.
A: A single question will give you your credit for Class Participation; You can get emails when some one answers your question if you use the blackboard subscribe feature.

Q: Group Study questions: (check all that apply)
- The instructor will be present at group study
- A trained facilitator will be present at a group study
- Group study is scheduled in class rooms that have computers.
- You can do "goto meetings" with the instructor during group study sessions
A: A trained facilitator will be present at a group study; Group study is scheduled in class rooms that have computers.

Q: Goto-meeting questions: (check all that apply)
- You can have a goto meeting anytime
- If a student calls the instructor on his office phone number during office hours, he can usually do an on the spot goto-meeting.
- Using "goto meeting", a  student can be at home and show the problem on his computer with an instructor who happens to be on campus.
- To schedule a goto meeting, a student should send an email request to the instructor for the goto meeting.
A: If a student calls the instructor on his office phone number during office hours, he can usually do an on the spot goto-meeting.; Using "goto meeting", a  student can be at home and show the problem on his computer with an instructor who happens to be on campus.; To schedule a goto meeting, a student should send an email request to the instructor for the goto meeting.

Q: Some of the course lectures are only available by attending the Mixed Mode section
- True
- False
A: False

Q: This class is the easiest class at Washtenaw Community College.
- True
- False
A: False

Q: If you are having trouble getting your program to work, the class policy recommends doing which of the following:

(check all that apply)
- Sending an email to the instructor as soon as you are stuck.
- Coming to one of the instructor's office hours.
- Calling the instructor on his office phone during an office hour.  Often it is possible to remotely debug the problem using "goto meeting".
- Coming to any of the Mixed Mode (MM) sections that the instructor has scheduled even if the meeting is for a different class than the class the student is signed up for.  Distance Learning (DL) students can also take this approach.
- Coming to a Group study session and getting help from a trained facilitator or another student in group study.
- Requesting  a "goto meeting" with the instructor during one of the  Mixed Mode (MM) sessions.  The request is done by sending an email to the instructor early enough such that the instructor sees the request before the scheduled class.
- Posting a question on one of the "Class Participation" discussion boards and hoping to get an answer from a fellow student.  It would be helpful to subscribe to the question so you will know when someone might be answering the question.
A: Coming to one of the instructor's office hours.; Calling the instructor on his office phone during an office hour.  Often it is possible to remotely debug the problem using "goto meeting".; Coming to any of the Mixed Mode (MM) sections that the instructor has scheduled even if the meeting is for a different class than the class the student is signed up for.  Distance Learning (DL) students can also take this approach.; Coming to a Group study session and getting help from a trained facilitator or another student in group study.; Requesting  a "goto meeting" with the instructor during one of the  Mixed Mode (MM) sessions.  The request is done by sending an email to the instructor early enough such that the instructor sees the request before the scheduled class.; Posting a question on one of the "Class Participation" discussion boards and hoping to get an answer from a fellow student.  It would be helpful to subscribe to the question so you will know when someone might be answering the question.

Q: Given:

String str = "123";
int x;

Which of the following statements will convert str to an integer value?
- Can't be done without writing a small conversion routine.
- x = Integer.parseInt(str);
- x = Convert.toInteger(str);
- x = atol(str);
A: x = Integer.parseInt(str);

Q: For the following program:

Which statement is correct?
- The program will compile correctly and execute correctly.
- This program will compile, but it will throw an exception due to an invalid try clause when the program is executed
- The program will not compile because there is no catch clause and/or finally clause after line 5.
- The program will compile, but an exception is thrown when the run time system discovers that there is no catch clause it tries to exit the try clause.
A: The program will not compile because there is no catch clause and/or finally clause after line 5.

Q: For the following program:

What will happen when you compile and run this program?
- The code will not compile
- The code will compile and run, and display long
- The code will compile and run, and display int
- The code will compile, but throw a runtime exception when executed
A: The code will compile and run, and display int

Q: When 2 or more methods in the same class have the same name, they are said to be what?
- Overloaded
- Overridden
- An interface
- An implementation detail
A: Overloaded

Q: Consider the following code:

String mystr ="World";

Which the following methods will actually change the contents of the hunk of memory referenced by mystr.
- trim()
- insert()
- append()
- None of the other answers
A: None of the other answers

Q: Given:

String a="Java is great.";
System.out.println(a.charAt(a.length()));

When this fragment of code is executed, what will be the output?
- "."
- "t"
- "J"
- The code will generate an exception
A: The code will generate an exception

Q: This question is based on the Colorable_Shape code.

In line 1, Shape implements Colorable. This means ______________.
- The Shape class is written with a style that is fashionable.
- The Shape class contains all of the methods in the Interface Colorable
- This won't compile, because the Shape class does not override the Colorable class.
- The Shape class is derived(i.e. extends) from Colorable.
A: The Shape class contains all of the methods in the Interface Colorable

Q: This question is based on the Colorable_Shape code.

What is true about the following line of code:

Shape s = new Shape("Red");
- The compiler will allocate a variable "s" which points to a Shape object
- The variable "s" can be cast into a Circle class, with code like:
Circle c = (Circle)s;
- This won't compile, because the Shape class is an abstract class
- The parameter "Red" is not allowed for this Shape constructor
A: This won't compile, because the Shape class is an abstract class

Q: This question is based on the Colorable_Shape code.

What is true about the following line of code:

Shape s = new Circle("Red", 1);
- The compiler will allocate a variable "s" which points to a Shape object
- The compiler will allocate a variable "s" which points to a Circle Object.
- This won't compile, because the Shape class is an abstract class
- This won't work because the Shape class does not have a constructor that takes 2 parameters
A: The compiler will allocate a variable "s" which points to a Circle Object.

Q: This question is based on the Colorable_Shape code.

What is true about the following line of code:

Shape s = new Circle("Red", 1);
- Only the Circle constructor will be called.
- Only the Shape constructor will be called.
- The Shape constructor will complete, and then the Circle constructor will complete.
- The Circle constructor will complete, and then the Shape constructor will complete.
A: The Shape constructor will complete, and then the Circle constructor will complete.

Q: This question is based on the Colorable_Shape code.

What is true about the following code:

Shape s = new Circle("Red", 1);
System.out.println (s.getAPRatio());
- This will call getAPRatio in the Shape class which then tries to call getArea and getPerimeter.
However, a run time error occurs, because the Shape class has no getArea or getPerimeter methods.
- This will call getAPRatio in the Shape class which then tries to call getArea and getPerimeter.
Because getArea and getPerimeter are abstract, the run time system calls the System default routines.
- This will not work as coded. However, if you cast "s" to a Circle class then it works (i.e.)
System.out.println ((Circle)s.getAPRatio());
- This will call getAPRatio in the Shape class which then calls getArea and getPerimeter in the Circle class.
A: This will call getAPRatio in the Shape class which then calls getArea and getPerimeter in the Circle class.

Q: This question is based on the Colorable_Shape code.

What is output from the following code:

Shape s = new Circle("Red", 1);
System.out.println (s);
- Shape color=Red
- Shape color=Red Circle with radius 1
- Circle with radius 1 Shape color=Red
- This will generate an exception, because s is an abstract class
A: Shape color=Red Circle with radius 1

Q: This question is based on the Colorable_Shape code.

Note that every time a Shape is constructed in the "Colorable Shape code", the variable "totalShapes" is incremented.
Consider the following program

We want to replace the "xxxxx" with some code which will print out the total number of Shapes constructed.

Select all of the ways(there are 2 correct ones) to print out the total number of Shapes constructed:
- System.out.println(s.totalShapes);
- System.out.println(Shape.getCount());
- System.out.println(totalShapes);
- System.out.println(s.getCount());
A: System.out.println(Shape.getCount());; System.out.println(s.getCount());

Q: This question is based on the FixedExample code.

Which catch clause will be hit with the following user input at the command line:

100 10
- line 9
- line 33
- line 38
- No catch clauses will be executed.
A: line 38

Q: This question is based on the FixedExample code.

Which catch clause will be hit with the following user input at the command line:

100
- line 9
- line 33
- line 38
- No catch clauses will be executed.
A: line 38

Q: This question is based on the FixedExample code.

Which catch clause will be hit with the following user input at the command line:

xxxx 10
- line 9
- line 33
- line 38
- No catch clauses will be executed.
A: line 33

Q: This question is based on the FixedExample code.

Which catch clause will be hit with the following user input at the command line:

5 0
- line 9
- line 33
- line 38
- No catch clauses will be executed.
A: line 9

Q: This question is based on the FixedExample code.

Which catch clause will be hit with the following user input at the command line:

5 2
- line 9
- line 33
- line 38
- No catch clauses will be executed.
A: No catch clauses will be executed.