Announcements: Handouts (3) To Pick Up
Announcements: Handouts (3) To Pick Up
Announcements: Handouts (3) To Pick Up
1.00 Lecture 1
Course Overview
Introduction to Java
1
Academic honesty
• You may collaborate on understanding lectures, labs,
text, tutorials, homework problem statements.
• You may discuss the design of your homework
program: options for algorithms, classes, methods…
• You must then write your homework Java code
yourself.
• You may get help from students while writing your
homework programs only by:
– Asking them to point out an error, but not to fix it for you.
– Explaining Java syntax to you. Use a different example
than the program you’re writing if an example is needed.
• We strongly prefer that you get help from TAs,
instructors when writing your homework programs
• You may collaborate on in-class exercises except :
– You must do them yourself if you don’t do them in class
• Quizzes and final exams are individual work
Course goals
• Core concepts of software development
– Software program structure and introduction to design
– Software development and debugging/testing
• Programming in an interactive, object oriented
environment:
– Classes, objects, inheritance, composition, events…
– Java; C# is very similar
– Eclipse interactive development environment
• Use of computation for scientific, engineering,
management problems
– Homework problems in engineering problem solving
– Introduction to numerical methods
2
Course goals, p.2
• Graphical user interfaces
– Java Swing, event models
• Data structures
– Stacks, queues, trees, lists, graphs, …
• Algorithms
– Sorting, searching, hashing,…
• Communication, distributed processing
– Streams, input and output
– Threads, brief introduction to World Wide Web
Computer options
• Your own laptop or desktop computer
– WindowsXP, Windows2000, Linux or MacOS
– 256MB RAM or more strongly recommended
– Install Java, Javadoc, Eclipse (instructions in tools section)
• Loaner laptop computers
– WindowsXP, Java, Javadoc, Eclipse already installed
3
Laptop computers
• Limited number of laptop loaners
– Request a loaner on the form if you really need it
• You may use it for other classes, return at final exam
Course information
• Course staff ( instructor name on syllabus):
– Instructor, 8 TAs, 2 lab TAs, 8 graders
• Course site contains all course materials
4
Course materials
• Lecture notes:
– Posted without solutions one class ahead
– Posted with solutions after each class
– Hardcopy at each class
• Tutorial notes posted every Friday for next week
– No hardcopy
• Homework:
– Hardcopy on Fridays
– Next homework posted one week ahead of hardcopy
5
Lectures, quizzes, exam
• Lectures are active learning, exercises (10%)
– Turn in exercise solutions to lectures 3-36
– Turn in zip file by 6pm that day (1/3 point each)
– Can skip 4 turn-ins (turn in 30 out of the 34 lectures)
– No late turn-ins.
– Turn-ins (zip files) sampled by graders for reality.
• Two quizzes, each 12% of the grade (24%)
– On Fridays at regular class time
6
Spiral model of development
5HTXLUHPHQWV 'HVLJQ
Re-read HW Do detailed design on entities,
for all details data, behaviors
Read Sketch
HW approach
End: turn in HW
Start
Review, Write simple Write final
test with version of version of
Review,
some data program program
test with
valid, invalid,
unusual data
7HVW 'HYHORSPHQW
7
Java Data Types
• 8 primitive or built-in data types
– Boolean (boolean): true or false, not 0 or 1
– Character (char): 2 bytes long
– 4 integer types (byte, short, int, long): 1 to 8 bytes long
– 2 floating point types (float, double):
• These are not objects, unlike everything else in
Java
• These are defined (almost) identically on every
machine on which Java runs, unlike other
programming languages
• Java is a strongly typed language:
– Every variable in a program must have a declared type
short 16
int 32
long 64
float 32
double 64
8
Java Data Types
9
What data type would you use?
• What would you use to store:
– Speed of light double
– Your grade in this course char
– Your grade point average this term double/float
– Number of refrigerators in a room int
– Location of a point on a screen float/int
– 265 BigInteger
– $234.77 double/int
– Half of $234.77 double/int
– Bits per second transmitted by modem int/double
A Java program
public class Welcome {
// main method called when program starts, by definition
public static void main(String[] args)
args) {
System.out.println("Welcome to 1.00");
1.00");
double pctGrads=
pctGrads= grads/students;
grads/students;
pctGrads);
System.exit(0);
System.exit(0);
}
}
10
A Java program
public class Welcome {
// main method called when program starts, by definition
public static void main(String[] args)
args) {
System.out.println("Welcome to 1.00");
1.00");
double pctGrads=
pctGrads= grads/students;
grads/students;
pctGrads);
System.exit(0);
System.exit(0);
}
}
11
Things to do
• Complete and hand in three items today at class:
– Academic honesty form (must sign)
– Pretest
– Laptop info form (please fill out even if you have your
own laptop)
• Check Web site to see if you’re eligible for laptop
12