Java Programming Daily review / 1 PT. each.

Slides:



Advertisements
Similar presentations
Your First Java Program: HelloWorld.java
Advertisements

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,
BASIC JAVA. Hello World n // Hello world program public class MyFirstJavaProgram { public static void main(String args[]) { char c = 'H'; String s =
Java An introduction. Example 1 public class Example1 { public static void main (String [] args) { System.out.println (“This is the first example”); int.
 To be able to write larger programs ◦ By breaking them down into smaller parts and passing data between the parts.  To understand the concepts of Methods.
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;
Copyright 2013 by Pearson Education Building Java Programs Chapter 1 Lecture 1-1: Introduction; Basic Java Programs reading:
Copyright 2008 by Pearson Education Building Java Programs Chapter 1 Lecture 1-1: Introduction; Basic Java Programs reading: self-check: #1-14.
Unit 2: Java Introduction to Programming 2.1 Initial Example.
“Introduction to Programming With Java”
Hello AP Computer Science!. What are some of the things that you have used computers for?
Introduction to Programming Prof. Rommel Anthony Palomino Department of Computer Science and Information Technology Spring 2011.
Laboratory Study October, The very first example, traditional "Hello World!" program: public class first { public static void main (String[ ]
Arrays (Part 1) Computer Science Erwin High School Fall 2014.
Welcome to the Lecture Series on “Introduction to Programming With Java”
Introduction to Java Thanks to Dan Lunney (SHS). Java Basics File names The “main” method Output to screen Escape Sequence – Special Characters format()
Session One Introduction. Personal Introduction Role of programmers Robot Examination HUD & HID Uploading Code.
The string data type String. String (in general) A string is a sequence of characters enclosed between the double quotes "..." Example: Each character.
Java means Coffee Java Coffee Beans The name “JAVA” was taken from a cup of coffee.
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.
ARRAYS 1 TOPIC 8 l Array Basics l Arrays and Methods l Programming with Arrays Arrays.
The scope of local variables. Murphy's Law The famous Murphy's Law says: Anything that can possibly go wrong, does. (Wikipedia page on Murphy's Law:
FIRST JAVA PROGRAM. JAVA PROGRAMS Every program may consist of 1 or more classes. Syntax of a class: Each class can contain 1 or more methods. public.
BUILDING JAVA PROGRAMS CHAPTER 1 ERRORS. 22 OBJECTIVES Recognize different errors that Java uses and how to fix them.
Working with arrays (we will use an array of double as example)
First Programs CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
Programming Fundamentals 2: Simple/ F II Objectives – –give some simple examples of Java applications and one applet 2. Simple Java.
Copyright 2008 by Pearson Education 1 Building Java Programs Chapter 2 Lecture 2-1: Expressions and Variables reading:
1 BUILDING JAVA PROGRAMS CHAPTER 2 PRIMITIVE DATA AND DEFINITE LOOPS.
Mixing integer and floating point numbers in an arithmetic operation.
College Board A.P. Computer Science A Topics Program Design - Read and understand a problem's description, purpose, and goals. Procedural Constructs -
CSC1030 HANDS-ON INTRODUCTION TO JAVA Introductory Lab.
Week 1 basic Python programs, defining functions Special thanks to Scott Shawcroft, Ryan Tucker, and Paul Beck for their work on these slides. Except where.
Indentation & Readability. What does this program do? public class Hello { public static void main ( String[] args ) { //display initial message System.out.println(
1 WELCOME TO CIS 1068! Instructor: Alexander Yates.
Hello Computer Science!. Below is an example of a Hello World program in JAVA. While it is only three lines of code, there are many things that are happening.
Introduction to Computing Concepts Note Set 15. JOptionPane.showMessageDialog Message Dialog Allows you to give a brief message to the user Can be used.
The assignment expressions. The assignment operator in an assignment statement We have seen the assignment statement: Effect: var = expr; Stores the value.
Copyright 2010 by Pearson Education 1 Building Java Programs Chapter 2 Lecture 2-1: Expressions and Variables reading:
How do you do the following? Find the number of scores within 3 points of the average of 10 scores? What kind of a tool do you need? Today’s notes: Include.
Java Programming Daily review / 1 PT. each. September 28/29: Lesson 1 - a 1. Create the “skeleton” of a program Public class Tester { Public static void.
Computer Science A 1. Course plan Introduction to programming Basic concepts of typical programming languages. Tools: compiler, editor, integrated editor,
1 Lecture # 2. * Introducing Programming with an Example * Identifiers, Variables, and Constants * Primitive Data Types * Byte, short, int, long, float,
UFCFY5-30-1Multimedia Studio Coding for Interactive Media Fundamental Concepts.
CLASSES IN JAVA Primitive Types Example of a Class Allocating Objects of a Class Protecting Class data Constructors Static data and Static Methods.
Introduction to Computer Science What is Computer Science? Getting Started Programming.
Introduction to programming in java
Computer Programming Your First Java Program: HelloWorld.java.
John Woodward A Simple Program – Hello world
Crash course in the Java Programming Language
Exercise Java programming
using System; namespace Demo01 { class Program
USING ECLIPSE TO CREATE HELLO WORLD
Lecture Note Set 1 Thursday 12-May-05
Introduction to Programming in Java
Writing Methods.
Computing Adjusted Quiz Total Score
March 29th Odds & Ends CS 239.
An Introduction to Java – Part I, language basics
Tonga Institute of Higher Education
Java Tutotrial for [NLP-AI] 2
Java Intro.
CS110D Programming Language I
class PrintOnetoTen { public static void main(String args[]) {
A Java Application public class Hello { public static void main(String [] args) { System.out.println("Hello, World!"); } } public class.
A Java Application public class Hello { public static void main(String [] args) { System.out.println("Hello, World!"); } } public class.
Arrays in Java.
F II 2. Simple Java Programs Objectives
More on iterations using
Presentation transcript:

Java Programming Daily review / 1 PT. each

September 28/29: Lesson 1 - a 1. Create the “skeleton” of a program Public class Tester { Public static void main(string voids[]) } 2. Write a line of code that will cause the word Hello to be printed. System.out.println(“Hello”); 3. Define the following words: A. Rem: comment or remark B. skeleton: beginning format that must be typed to begin coding C. code: piece of text in Java

September 30/October 1: Lesson 1 - b 1. Consider the following code: System.out.print(“Fire”); System.out.println(“Ants”); What does the above print? Fire Ants 2. What is the syntax for indicating that line of text is not Java code; rather it is a rem? // How do you create a rem? 3. How do you create a block rem? /* How do you create a block rem */ 4. Define the following words: Compile: Assembling or transforming source code written in a programming language. B. Container: Brackets that enclose coding C. Java: one of the many programming languages

Oct. 2/5: Lesson 1 - c Supply code in the place of the below, that will produce the following printout: From: your name Address: Baldwin Middle Senior High School To: Margaret Winter Message: I love java programming! public class Tester { public static void main(String args[]) System.out.println("From: Student Name"); System.out.println("Address: Baldwin Middle Senior High School"); System.out.println(""); System.out.println(“To: Margaret Winter"); System.out.println("Message: I love java programming"); }

October 8/9: Lesson 3 1. What is output by the following code? String s = “Mona Lisa”; System.out.println(s.length( )); 2. What is the output of System.out.println( p.toUpperCase( ) ); if p = “Groovy Dude”? 3. What is output by the following code? String girl = “Heather Jones”; System.out.println(girl.substring(8)); 4. What is output by the following code? System.out.println(girl.substring(8,11));

October 12/13: Lesson 3 1. What is the index of the ‘L’ in the String “Abraham Lincoln” 2. What is output by the following code? String s = “Beaver Cleaver”; System.out.println(s.toUpperCase( )); 3. Write code in which a String variable s contains “The number of rabbits is”. An integer variable argh has a value of 129. Concatenate these variables into a String called report. Then print report. The printout should yield: The number of rabbits is 129. Note that we want a period to print after the 9.

October 14/15: Lesson 3 1. Write code that will assign the value of “Computer Science is for nerds” to the String variable g. Then have it print this String with nothing but “small” letters. 2. What will be the value of c? String c; String m = “The Gettysburg Address”; c = m.substring(4); 3. What will be the value c? String b = “Four score and seven years ago,”; String c = b.substring(7, 12); 4. What is the value of count? int count; String s = “Surface tension”; count = s.length(