ShmoopTube
Where Monty Python meets your 10th grade teacher.
Search Thousands of Shmoop Videos
Computer Science Videos 112 videos
AP Computer Science: Classes and Objects Drill 1, Problem 1. Which of the following is a correct {/* Implementation */} for the isInsect method?
AP Computer Science 1.2 GridWorld Case Study and APIs. What is the direction of the actor?
AP Computer Science 1.3 Classes and Objects. Which of the following should be declared as a static variable?
AP Computer Science 2.2 Program Development 7 Views
Share It!
Description:
AP Computer Science 2.2 Program Development. Which is a correct { /* Implementation */ }for the print() method?
Transcript
- 00:04
And here's your shmoop du jour brought to you by Penguins that [Penguins on an ice block]
- 00:07
avoid England they're afraid of whale alright the print method is intended to
- 00:14
print the label penguin name followed by the name of the penguin and return the
- 00:18
cursor on a new line for example for a penguin named Albert the method should
- 00:23
display the following on the console that's right here alright which is a
Full Transcript
- 00:28
correct implementation for the print method well we can eliminate a few [Potential answers appear]
- 00:38
answers right off the bat whenever connecting different strings in
- 00:43
a print command we must use a plus sign so choice diesel ended because penguin
- 00:48
name must be in quotation mark otherwise the computer will interpret it as a [Man hitting laptop]
- 00:53
command instead of a string ID now let's take a look between choices see an e [Girl looking at flowers through magnifying glass]
- 00:59
well choice C uses a print line but also puts a new line command in the statement
- 01:04
this will make the cursor jump down a line twice printing a full extra blank
- 01:09
line we wanted to be on the line immediately under the penguin name the
- 01:13
choice E does this nicely by using a friend which won't make the cursor jump
- 01:17
a line and then using the new line command to make it jump one line below
- 01:21
the next time we'll hear about carriage back out of the snow running competition
- 01:24
he got cold feet [Penguin standing on block of ice]
Related Videos
AP Computer Science 1.2 GridWorld Case Study and APIs. What is the direction of the actor?
AP Computer Science 1.4 Standard Algorithms. How many times will mystery be called for mystery(n) for n > 1?
AP Computer Science 2.3 Classes and Objects. Which of the following is correct implementation of the Country class?
AP Computer Science 3.4 Inheritance, Abstraction, and Polymorphism. Which of the following will satisfy the conditional if statement for boo, str,...
AP Computer Science 4.2 Standard Algorithms. What kind of algorithm is the following?