CPSC 233 Tutorial January 21 st /22 nd, 2015. Linux Commands.

Slides:



Advertisements
Similar presentations
AP Computer Science Anthony Keen. Computer 101 What happens when you turn a computer on? –BIOS tries to start a system loader –A system loader tries to.
Advertisements

STRING AN EXAMPLE OF REFERENCE DATA TYPE. 2 Primitive Data Types  The eight Java primitive data types are:  byte  short  int  long  float  double.
IT 325 OPERATING SYSTEM C programming language. Why use C instead of Java Intermediate-level language:  Low-level features like bit operations  High-level.
Computer Programming Lab(7).
Today’s lecture Review of Chapter 1 Go over homework exercises for chapter 1.
Java Syntax Part I Comments Identifiers Primitive Data Types Assignment.
CMPUT 101 Lab # 5 October 22, :00 – 17:00.
Shlomo Hershkop1 Introduction to java Class 1 Fall 2003 Shlomo Hershkop.
Hello, world! Dissect HelloWorld.java Compile it Run it.
1 The First Step Learning objectives write Java programs that display text on the screen. distinguish between the eight built-in scalar types of Java;
Introduction to Methods. How do we use Methods in Java? Let us start by creating one which displays “hello” on Dos Prompt.
Copyright 2013 by Pearson Education Building Java Programs Chapter 1 Lecture 1-1: Introduction; Basic Java Programs reading:
Java Basics Kris Secor Mobile Application Development.
Agenda Review User input Scanner Strong type checking Other flow-control structures switch break & continue Strings Arrays 2.
Review Review Review. Concepts Comments: definition, example, different types of comments Class: definition, example Object: definition, example Data.
By Nicholas Policelli An Introduction to Java. Basic Program Structure public class ClassName { public static void main(String[] args) { program statements.
Introduction to Programming David Goldschmidt, Ph.D. Computer Science The College of Saint Rose Java Fundamentals (Comments, Variables, etc.)
CS 11 java track: lecture 1 Administrivia need a CS cluster account cgi-bin/sysadmin/account_request.cgi need to know UNIX
Java means Coffee Java Coffee Beans The name “JAVA” was taken from a cup of coffee.
CS591x A very brief introduction to Java. Java Developed by Sun Microsystems was intended a language for embedded applications became a general purpose.
Netprog: Java Intro1 Crash Course in Java. Netprog: Java Intro2 Why Java? Network Programming in Java is very different than in C/C++ –much more language.
 JAVA Compilation and Interpretation  JAVA Platform Independence  Building First JAVA Program  Escapes Sequences  Display text with printf  Data.
Data & Data Types & Simple Math Operation 1 Data and Data Type Standard I/O Simple Math operation.
Chapter 2: Java Fundamentals
Using Data Within a Program Chapter 2.  Classes  Methods  Statements  Modifiers  Identifiers.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 2: Variables & Data Types.
CECS 121 Test 1. Functions allow you to group program statements under one name C and C++ are case-sensitive so main(), MAIN(), and Main() are all different.
Conditions CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
BEGINNING PROGRAMMING.  Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such.
C++ Basics. Compilation What does compilation do? g++ hello.cpp g++ -o hello.cpp hello.
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
Overview of Java CSCI 392 Day One. Running C code vs Java code C Source Code C Compiler Object File (machine code) Library Files Linker Executable File.
Java Programming, Second Edition Chapter Two Using Data Within a Program.
Final Jeopardy Fundamen tal Java Numerical Data type Boolean Expressi on If/THEN/ WHILE Miscellan eous
Chapter 2 Input, Variables and Data Types. JAVA Input JAVA input is not straightforward and is different depending on the JAVA environment that you are.
School of Computer Science & Information Technology G6DICP - Lecture 4 Variables, data types & decision making.
Test Review. General Info. All tests will be comprehensive. You will be tested more on your understanding of code as opposed to your ability to write.
Literals A literal (sometimes called a constant) is a symbol which evaluates to itself, i.e., it is what it appears to be. Examples: 5 int literal
CPSC 233 Tutorial 5 February 9 th /10 th, Java Classes Each Java class contains a set of instance variables and methods Instance Variables: Type.
© 2007 Lawrenceville Press Slide 1 Chapter 4 Review Assignment Statement An assignment statement gives a value to a variable. Assignment can take several.
1 Lecture # 2. * Introducing Programming with an Example * Identifiers, Variables, and Constants * Primitive Data Types * Byte, short, int, long, float,
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.
Object Oriented Programming Lecture 2: BallWorld.
Copyright 2010 by Pearson Education APCS Building Java Programs Chapter 1 Lecture 1-1: Introduction; Basic Java Programs reading:
Topics introduced today (these topics would be covered in more detail in later classes) – Primitive Data types Variables Methods “for” loop “if-else” statement.
Foundations of Programming: Java
Basic concepts of C++ Presented by Prof. Satyajit De
Agenda Introduction Computer Programs Python Variables Assignment
Lecture 2 D&D Chapter 2 & Intro to Eclipse IDE Date.
Lecture Note Set 1 Thursday 12-May-05
An Introduction to Java – Part I
Starting JavaProgramming
Unit-2 Objects and Classes
Computers & Programming Languages
An Introduction to Java – Part I, language basics
Java so far Week 7.
Introduction to Primitive Data types
Algorithms Take a look at the worksheet. What do we already know, and what will we have to learn in this term?
Sridhar Narayan Java Basics Sridhar Narayan
Java Programming Review 1
Introduction to Java Brief history of Java Sample Java Program
Unit 3: Variables in Java
CS Week 2 Jim Williams, PhD.
Chapter 3 Introduction to Classes, Objects Methods and Strings
Java: Variables, Input and Arrays
IAT 800 Foundations of Computational Art and Design
Introduction to java Part I By Shenglan Zhang.
Lecture 1 Review of 1301/1321 CSE /26/2018.
Introduction to Primitive Data types
JAVA. Java is a high-level programming language originally developed by Sun Microsystems and released in Java runs on a variety of platforms, such.
Presentation transcript:

CPSC 233 Tutorial January 21 st /22 nd, 2015

Linux Commands

Primitive Types byte short int long float double boolean char

Variable Assignment int num = 5; char c = ‘a’; boolean bool = true; long longNum = 100l; float floatNum = 1.5f;

String A String represents a sequence of characters. String text = “Hello World”; String character = “a”; “a” vs. ‘a’ == vs..equals()

Printing to Console System.out.println(“Hello); String word = “Hello”; System.out.println(word); int num = 5; System.out.print(num); print vs. println

If Statements Used for Control flow. Execute a piece of code only if some condition is true

If Statements If ( ){ }

If Statements If ( ){ } else ( ){ }

If Statements If ( ){ } else if ( ){ } else if ( ){ }

If Statements If ( ){ } else if ( ){ } else if ( ){ } else { }

Scanners A Java class that allows the program to read input. Read from console Read from file

Scanner

Exercise Write a Java program that prompts the user for the course program (“CPSC”) and the course number (233) and checks if it matches this course. i.e. “CPSC” and 233. Print a message that states if the input matches or not. Compile: javac InputMatch.java Run: java InputMatch