Classwork: PU Input and Output Standard classes
You can get the following files from edmodo.com. Add them to your workspace:
StdIn.java
StdOut.java
StdDraw.java
StdAudio.java
-
- What is an abstraction?
- What is an input/output abstraction?
- What is an abstraction describing something having no limit?
- What is an abstraction for an infinite output sequence?
- What are the components of the improved input-output abstraction?
- What is an abstraction for an infinite input sequence?
7. What is an abstraction for an infinite output sequence?
8. These are the same as System.out. Why not just use System.out?
9. Interactive input
• Prompt user to type inputs on standard input stream.
• Mix input stream with output stream.
10. Average
• Read a stream of numbers.
• Compute their average.
11. How do I specify the end of the stream?
12. What is the limit on the size of the input stream?
13. Do I always have to type in my input data and print my output?
14. What can you do if there’s no room for a huge file on my computer?
Formatted printing basics again. In its simplest form, printf() takes two arguments. The first argument, a string, contains a format that describes how the second argument is to be converted to a string for output.
15. How many spaces are printed before the digit 3 in the following line: StdOut.printf(“%8.3f”, Math.PI);?