1 Sections 3.3 – 3.4 Terminal I/O and Comments Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.

Slides:



Advertisements
Similar presentations
Chapter 8 Improving the User Interface
Advertisements

C++ Basics March 10th. A C++ program //if necessary include headers //#include void main() { //variable declaration //read values input from user //computation.
Chapter 3 Syntax, Errors, and Debugging
Chapter 2 First Java Programs
Chapter 10 Introduction to Arrays
1 Chapter 2 Introduction to Java Applications Introduction Java application programming Display ____________________ Obtain information from the.
Introduction to C++ Programming. A Simple Program: Print a Line of Text // My First C++ Program #include int main( ) { cout
Fundamentals of Java Lesson 3: Syntax, Errors, and Debugging
Chapter 2: Java Fundamentals Java Program Structure.
C++ PROGRAMMING Dr. Parvis Partow CSULA Revised by Mr. Dave Clausen La Cañada High School.
Chapter 2 First Java Programs
Java Basics (continued)
Visual Basic Chapter 1 Mr. Wangler.
Introduction to Information and Computer Science Computer Programming Lecture c This material (Comp4_Unit5c), was developed by Oregon Health and Science.
1 Chapter 2 First Java Programs Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
PYTHON. Python is a high-level, interpreted, interactive and object- oriented scripting language. Python was designed to be highly readable which uses.
Chapter 2 Overview of C Part I J. H. Wang ( 王正豪 ), Ph. D. Assistant Professor Dept. Computer Science and Information Engineering National Taipei University.
Documentation and Comments. What’s a comment? A comment is a simple form of documentation. Documentation is text that you the programmer write to explain.
Chapter 3 Syntax, Errors, and Debugging Fundamentals of Java.
Computer Science 101 Introduction to Programming.
Input & Output In Java. Input & Output It is very complicated for a computer to show how information is processed. Although a computer is very good at.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 2 Chapter 2 - Introduction to C Programming.
Building java programs chapter 6
Programming with Visual C++: Concepts and Projects Chapter 2B: Reading, Processing and Displaying Data (Tutorial)
CSci 111 – computer Science I Fall 2014 Cynthia Zickos WRITING A SIMPLE PROGRAM IN JAVA.
1 Computer Science of Graphics and Games MONT 105S, Spring 2009 Session 1 Simple Python Programs Using Print, Variables, Input.
JavaScript Syntax, how to use it in a HTML document
1 Chapter 3 Syntax, Errors, and Debugging Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
Sahar Mosleh California State University San MarcosPage 1 JavaScript Basic.
Chapter 3 Syntax, Errors, and Debugging Fundamentals of Java.
Chapter 15 Strings as Character Arrays
Chapter 9: Completing the Basics. In this chapter, you will learn about: – Exception handling – Exceptions and file checking – The string class – Character.
Computer Programming 12 Mr. Jean March 5 th, 2014.
1 8/30/06CS150 Introduction to Computer Science 1 Your First C++ Program.
1 Sections 5.1 – 5.2 Digital Image Processing Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
1 Sections Java Interfaces – The Client Perspective Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
Java Basics (continued) Ms. Pack AP Computer Science A.
1 Chapter 1 Background Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
Chapter 2 First Java Programs Fundamentals of Java.
1 Sections Java Virtual Machine and Byte Code Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
1 Sections 6.4 – 6.5 Methods and Variables Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
Debugging and Testing Hussein Suleman March 2007 UCT Department of Computer Science Computer Science 1015F.
1 Section 11.4 Java Interfaces – The Implementation Perspective Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
1 Sections 7.2 – 7.7 Nested Control Statements Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
1 Sections 3.1 – 3.2a Basic Syntax and Semantics Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
1 Section 3.2b Arithmetic Operators Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
STRUCTURED PROGRAMMING Complete C++ Program. Content 2  Main Function  Preprocessor directives  User comments  Escape characters  cout statement.
Fundamentals of Programming I Overview of Programming
Sections 10.1 – 10.4 Introduction to Arrays
Fundamentals of Java: AP Computer Science Essentials, 4th Edition
Sections Inheritance and Abstract Classes
Chapter 2 More on Math More on Input
Chapter 2 Introduction to C++ Programming
Fundamentals of Java: AP Computer Science Essentials, 4th Edition
Chapter 3 Syntax, Errors, and Debugging
Sections Basic Concepts of Programming
Section 7.1 Logical Operators
Lesson 3: Syntax, Errors, and Debugging
Chapter 2 First Java Programs
Using the Stopwatch object
Section 3.2c Strings and Method Signatures
Computer Science 101 While Statement.
Something about Java Introduction to Problem Solving and Programming 1.
Introduction to C++ Programming
CSE 1020:Programming by Delegation
MSIS 655 Advanced Business Applications Programming
Mr. Dave Clausen La Cañada High School
Lecture Notes - Week 2 Lecture-1. Lecture Notes - Week 2 Lecture-1.
Chapter 2: Java Fundamentals
Hint idea 2 Split into shorter tasks like this.
Presentation transcript:

1 Sections 3.3 – 3.4 Terminal I/O and Comments Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne

Chapter Terminal I/O for Different Data Types Objects support terminal I/O. An instance of the Scanner class supports input and the object System.out supports output. System.out is an instance of the class PrintStream. – This class and others are available to Java programmers without using import statements.

Chapter Terminal I/O for Different Data Types (continued) When a program encounters an input statement, it pauses and waits for the user to press Enter, then processes the user’s input. Interaction with user (bold) looks like this:

Chapter Comments Comments are explanatory sentences inserted in a program used to clarify code and are ignored by the compiler. – End of line comments (followed by //) – Multi-line comments (opened by /* and closed by */)

Chapter Comments (continued) To make a program readable: – Begin with a statement of purpose. – Use comments to explain variables’ purposes. – Precede major segments of code with brief comments. – Include comments to explain complex or tricky code sections.

Chapter 3 6