Computers & Programming Languages

Slides:



Advertisements
Similar presentations
CS107 Introduction to Computer Science Lecture 3, 4 An Introduction to Algorithms: Loops.
Advertisements

1 Chapter 2 Introduction to Java Applications Introduction Java application programming Display ____________________ Obtain information from the.
CS107 Introduction to Computer Science Loops. Instructions Pseudocode Assign values to variables using basic arithmetic operations x = 3 y = x/10 z =
Chapter 2: Java Fundamentals Input and Output statements.
1 TCSS 143, Autumn 2004 Lecture Notes Review. 2 Computer programming computers manipulate data data is often categorized into types numbers (integers,
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Console Input Using the Scanner Class Starting with version 5.0, Java includes a class for doing.
Programming is instructing a computer to perform a task for you with the help of a programming language.
Using Java's Math & Scanner class. Java's Mathematical functions (methods) (1)
Week 2 - Friday.  What did we talk about last time?  Data representation  Binary numbers  Types  int  boolean  double  char  String.
Chapter 2 Section 2.2 Console Input Using The Scanner CLASS Slides prepared by Rose Williams, Binghamton University Kenrick Mock, University of Alaska.
Expressions, Data Conversion, and Input
Java Fundamentals 3 Input and Output statements. Standard Output Window Using System.out, we can output multiple lines of text to the standard output.
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.
Week 2 - Wednesday.  What did we talk about last time?  Data representation  Binary numbers  Types  int  boolean  double  char  String.
Math class services (functions) Primitive vs reference data types Scanner class Math class services (functions) Primitive vs reference data types Scanner.
Input/Output in Java. Output To output to the command line, we use either System.out.print () or System.out.println() or System.out.printf() Examples.
Advanced Computer Science Lesson 4: Reviewing Loops and Arrays Reading User Input.
Counter-Controlled Loops CSIS 1595: Fundamentals of Programming and Problem Solving 1.
Introduction to Programming
Outline Character Strings Variables and Assignment Primitive Data Types Expressions Data Conversion Interactive Programs Graphics Applets Drawing Shapes.
CHAPTER 5 GC 101 Input & Output 1. INTERACTIVE PROGRAMS  We have written programs that print console output, but it is also possible to read input from.
Using the while-statement to process data files. General procedure to access a data file General procedure in computer programming to read data from a.
CS 115 QUIZ # 2 INFORMATION 1. When TUESDAY 11/10 Worth: 8 points 2.
CS 240 – Computer Programming I Lab Kalpa Gunaratna –
CSC 1051 – Algorithms and Data Structures I Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website:
Programming Fundamentals I Java Programming Spring 2009 Instructor: Xuan Tung Hoang TA: Tran Minh Trung Lab 03.
Reading input from the console input. Java's console input The console is the terminal window that is running the Java program I.e., that's the terminal.
Problem of the Day Divide:.
Java – Variables and Constants By: Dan Lunney. Declaring Variables All variables must be declared before they can be used A declaration takes the form:
Martin T. Press.  Main Method and Class Name  Printing To Screen  Scanner.
Chapter 2 Console Input and Output Copyright © 2010 Pearson Addison-Wesley. All rights reserved.
Copyright © Curt Hill Simple I/O Input and Output using the System and Scanner Objects.
import java.util.Scanner; class myCode { public static void main(String[] args) { Scanner input= new Scanner(System.in); int num1; System.out.println(“Enter.
Computer Programming 12 Mr. Jean March 5 th, 2014.
Interactive Programs Programs that get input from the user 1 In PowerPoint, click on the speaker icon then click the "Play" button to hear the narration.
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
Introduction to programming in java
CSC 1051 – Data Structures and Algorithms I Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website:
CSC111 Quick Revision.
String Comparison, Scanner
Input/Output.
Chapter 2 More on Math More on Input
CSC1401 Input and Output (and we’ll do a bit more on class creation)
Nahla Abuel-ola / WIT.
CSC 1051 – Data Structures and Algorithms I
Maha AlSaif Maryam AlQattan
Data Conversion & Scanner Class
Some problems for your consideration
Unit 2 Smarter Programming.
Data types, Expressions and assignment, Input from User
TK1114 Computer Programming
Something about Java Introduction to Problem Solving and Programming 1.
INPUT STATEMENTS GC 201.
BIT115: Introduction to Programming
Computers & Programming Languages
Introduction to Classes and Methods
A+ Computer Science INPUT.
Computers & Programming Languages
Unit 1: Intro Lesson 3: Input.
Graphing Nonlinear Functions Pages 694 – 697
Please write the following notes into your composition book.
Algebra 2 Ch.3 Notes Page 15 P Solving Systems Algebraically.
Chapter 2: Java Fundamentals
A+ Computer Science INPUT.
Lecture Notes - Week 2 Lecture-1. Lecture Notes - Week 2 Lecture-1.
Module 3 Selection Structures 4/5/2019 CSE 1321 Module 3.
Do it now activity Log onto the computer.
Math class services (functions)
Reading Input and Scanner Class
Presentation transcript:

Computers & Programming Languages

Lesson1- Objectives Understand input statements Use input statements to solve problems

Think .. Guess .. Discuss

Program 1 Program 2

Program 1 Program 2

Import the scanner class from the library import java.util.Scanner; Steps for reading input from users Import the scanner class from the library import java.util.Scanner; Assign variable for the Scanner to read from the keyboard Scanner c1 = new Scanner (System.in); Read the input from keyboard h = c1 . nextInt(); w= c1.nextDouble();

Program Algorithm Start Read h,w Area = h * w Print area End

Activity in your book P-190

Book Activity Page 190 Create a java program that reads an integer number from the user then prints the square of this number?

Activity in your book P-191 Homework .. Please