Programming Fundamentals I Java Programming Spring 2009 XuanTung Hoang Lab 01.

Slides:



Advertisements
Similar presentations
Foundations of Programming and Problem Solving Introduction.
Advertisements

Computer Programming Lab(7).
L2:CSC © Dr. Basheer M. Nasef Lecture #2 By Dr. Basheer M. Nasef.
1 Chapter 2 Introduction to Java Applications Introduction Java application programming Display ____________________ Obtain information from the.
Java Intro. A First Java Program //The Hello, World! program in Java public class Hello { public static void main(String[] args) { System.out.println("Hello,
Datalogi A 1: 8/9. Book: Cay Horstmann: Big Java or Java Consepts.
Introduction to Java ISYS 350. A Brief History Sun Microsystems released this language in 1996 – Versions: 1.0 – 1.6 Java Development Kit, JDK – Standard.
Slide 1 of 40. Lecture A The Java Programming Language Invented 1995 by James Gosling at Sun Microsystems. Based on previous languages: C, C++, Objective-C,
Tutorial 1 Introduction to Java Programming Bo Chen Department of Computer Science.
Computer Science A 1: 3/2. Course plan Introduction to programming Basic concepts of typical programming languages. Tools: compiler, editor, integrated.
Intro to Java Programming  A computer follows the instruction precisely and exactly.  Anything has to be declared and defined before it can be used.
CSC3170 Introduction to Database Systems
Introduction to Information and Computer Science Computer Programming Lecture c This material (Comp4_Unit5c), was developed by Oregon Health and Science.
From BlueJ to NetBeans SWC 2.semester.
Ali Shahrokni Application Components Activities Services Content providers Broadcast receivers.
Welcome to the Lecture Series on “Introduction to Programming With Java”
1 Introduction to Java Brief history of Java Sample Java Program Compiling & Executing Reading: => Section 1.1.
CSI 1390: Introduction to Computers TA: Tapu Kumar Ghose Office: STE 5014
Session One Introduction. Personal Introduction Role of programmers Robot Examination HUD & HID Uploading Code.
Введение в JAVA. Java Java – язык программирования: объектно-ориентированный кроссплатформенный строго-типизированный.
OOP (Java): Simple/ OOP (Java) Objectives – –give some simple examples of Java applications and one applet 2. Simple Java Programs Semester.
Introduction to Java Applications Part II. In this chapter you will learn:  Different data types( Primitive data types).  How to declare variables?
CSCB07 TUT3 TA: Andrey Dyblenko Website:
1 ITI 1120 Lab # 1 An Introduction to the Lab Environment Contributors: G. Arbez, M. Eid, D. Inkpen, A. Williams, D. Amyot.
CSc2010 Lab Fall 2015 Bing Li. Contact  Name : Bing Li   Website : cs.gsu.edu/~bli6  Office : Suntrust.
Java and C# [this is a bonus – it is not a required lesson] ACO101: Introduction to Computer Science.
© 2012 Pearson Education, Inc. All rights reserved. 1-1 Why Java? Needed program portability – Program written in a language that would run on various.
POS 406 Java Technology And Beginning Java Code
Programming Concept Chapter I Introduction to Java Programming.
Clement Allen, PhD Florida A&M University SUMMER 2006.
COP 3330 Notes 1/12. Today's topics Downloading Java and Eclipse Hello World Basic control structures Basic I/O Strings.
How to Run a Java Program CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
Spring 09- ICE0124 Programming Fundamentals I Java Programming XuanTung Hoang Lecture No. 2.
How to Run a Java Program CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
 Pearson Education, Inc. All rights reserved Introduction to Java Applications.
Programming Fundamentals 2: Simple/ F II Objectives – –give some simple examples of Java applications and one applet 2. Simple Java.
The 1 st and 2 nd tutoring session of CSc2310 Fall, 2012 Haidong Xue.
Mixing integer and floating point numbers in an arithmetic operation.
Pre-Sessional Java Programming Lecture 1a Reyer Zwiggelaar
Download and Install: 1.Java Development Kit (JDK) bin/INTERSHOP.enfinity/WFS/CDS- CDS_Developer-Site/en_US/- /USD/ViewProductDetail-Start?ProductRef=jdk-
DOS and the Command Line CS 21a: Introduction to Computing I First Semester,
Programming Fundamentals I Java Programming Spring 2009 Instructor: Xuan Tung Hoang TA: Tran Minh Trung Lab guide #5.
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.
CS7 Recitation Cem Akkaya. Outline  Homework-0 in detail  Useful links and tools  Setting up your java environment.
The assignment expressions. The assignment operator in an assignment statement We have seen the assignment statement: Effect: var = expr; Stores the value.
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.
Introduction to Java Applications Part II. In this chapter you will learn:  Different data types( Primitive data types).  How to declare variables?
Spring 2009 Programming Fundamentals I Java Programming XuanTung Hoang Lecture No. 8.
1 Project 2: Using Variables and Expressions. 222 Project 2 Overview For this project you will work with three programs Circle Paint Ideal_Weight What.
Martin T. Press.  Main Method and Class Name  Printing To Screen  Scanner.
Computer Science A 1. Course plan Introduction to programming Basic concepts of typical programming languages. Tools: compiler, editor, integrated editor,
1 Project 5: Leap Years. 222 Leap Years Write a program that reads an integer value from the user representing a year and determines if the year is a.
Execution ways of program References: www. en.wikipedia.org/wiki/Integrated_development_environment  You can execute or run a simple java program with.
Computer Science I Lab 1 ISMAIL ABUMUHFOUZ | CS 180.
CS 201 Lecture 1 (b) Using an IDE Tarik Booker CS 201: Introduction to Programming California State University, Los Angeles.
CPSC 233 Tutorial January 21 st /22 nd, Linux Commands.
1 Project 12: Cars from File. This is an extension of Project 11, Car Class You may use the posted solution for Project 11 as a starting point for this.
Foundations of Programming: Java
Compiling and Running a Java Program
Lecture Note Set 1 Thursday 12-May-05
CompSci 230 Software Construction
Intro to Java.
Administrative things
How to Run a Java Program
An Introduction to Java – Part I, language basics
Java Intro.
How to Run a Java Program
Introduction to Java Brief history of Java Sample Java Program
F II 2. Simple Java Programs Objectives
Presentation transcript:

Programming Fundamentals I Java Programming Spring 2009 XuanTung Hoang Lab 01

XuanTung Hoang 2 Content Programming Environment Installation Lab Assignments:  Number Splitting  Circle’s Area and Circumference

XuanTung Hoang 3 Installation Install JDK  Download and install Java SE - JDK 6 from Faster link:   Updating PATH so that you can invoke javac and java from co mmand line Add ; C:\Program Files\Java\jdk1.6.0_12\bin to PATH environmental variable Install editor  Crimson Editor Download:  Vim Editor Download:  Update PATH so that you can start your editor from command line You are not allowed to use IDE (e.g.: NetBean, Eclipse,…) to writ e your program during this course

XuanTung Hoang 4 Open command line (Start – Run – type “cmd” – Enter) Edit Hello.java (assume that you use Crimson Editor)  cedt Hello.java  Type/copy the following code public class Hello { public static void main( String[] args ) { System.out.println("Hello world\n"); }  Save the file Compile and run the sample application  Compile: javac Hello.java  Run: java Hello Testing Installation

XuanTung Hoang 5 I. Number Splitting Objectives:  Input/output with Scanner object  Modulus (%) operation for integers Requirements:  Create a class name NumberSplitting that has only main method (the pr ogram entry.)  In the main method, do the followings: Create an object of Scanner class Read a 5-digit integer from user (using nextInt() method of the created Scanner object) Split the 5-digit number into digits and print those digits to screen.  Refer to Addition.java in Lecture 2 as an example A sample output of the program execution… C> java NumberSplitting Enter 5-digit integer: Digits in are C>

XuanTung Hoang 6 II. Circle’s area and circumference Objectives:  Input/output with Scanner object  Arithmetic operations (floating point numbers) Requirements:  Create a class that has only main method (the program entry)  In the main method, do the followings: Read the radius of a circle from user using nextDouble() of Scanner class  Remember to create Scanner object and store the input radius into a variable of appropriat e type  The usage of nextDouble() method is similar to nextInt() method Print out the corresponding diameter, area, and circumference of the circle A sample output of the program execution… Enter radius: 3.6 Diameter: 7.2 Area: Circumference: C>

XuanTung Hoang 7 Submission and Report Due: 4 th March, mid-night Compress your source/class files into a ZIP file Name the zip file according with the following template:  StudentID_labNumber.zip Example: _lab1.zip Submit the file to TA  address:  Subject: “StudentID_ICE0124_lab1” Example: _ICE0124_lab1