Chapter 2 - Input and output Flashcards

1
Q

println

A

ends the line of output

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

print

A

next output goes on the same line

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

printf

A

doesnt advance to next line
used to format
can have any number of arguments all of which are printed to the screen except the first - which is the formatting

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

formatitng with printf

A

(“%(-/+)(number of spaces)”.float spaces)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what is legaacy code

A

code that is old fashioned but too expensive to replace - printf is also in C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

input

A
import java.util.Scanner
Scanner scanner = new Scanner(System.in);
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

getting the info/user input using scanner

A

int numberofitems = scanner.nextInt()

String myword = scanner.nextLine()

read through pitfalls

How well did you know this?
1
Not at all
2
3
4
5
Perfectly