PowerPoint Presentation by E5f21UV2

VIEWS: 7 PAGES: 30

									          CSE205
Object-Oriented Programming
    and Data Structures

        Spring 2012



                          1
Instructor:

Mutsumi Nakamura
Office: BYENG (BrickYard ENGineering wing) 520 (5th floor)
Phone: 965-1757
E-mail: mutsumi@asu.edu
Office hours:
Please see the syllabus for the office hours

(If these hours are not convenient,
I will be happy to make an appointment to meet with you
at other times.)




                                                             2
TA(Teaching Assistants):

To be Announced.

You can view the TA’s lab hours on the course website.




                                                         3
Catalog Description

•Problem solving by programming with an
object-oriented programming language (Java).

•Introduction to data structures.

•Overview of computer science topics.




                                               4
Major Topics Covered in this Java-based Course

1. Object-Oriented Software Development

       Brief introduction to Java
       Classes, Interfaces, Abstract classes
       Polymorphism
       Introduction to GUI

2. Introduction to Data Structures

       Arraylist
       Linked lists
       Stacks
       Queues
       Introduction to binary trees
                                                 5
3. Algorithms

       Recursion
       Searching/sorting
       Big O notation

4. Exceptions and Input/Output streams

       Exception handling
       File read/write
       Serialization




                                         6
Lecture Hours

Lecture 1: MWF 9:40am-10:30am
Lecture 2: TTh 9:00am-10:15am
Lecture 3: TTh 10:30am-11:45am
Lecture 4: MW 2:00pm-3:15pm




                                 7
Web Site

http://myasucourses.asu.edu/
login and look for CSE205 course page.
To be able to login to the myASU site, you need to have an ASURITE
account. Activating your ASURITE UserID is a self-service process.
You can activate your account by visiting the ASURITE Activation
Web site
(https://selfsub.asu.edu/apps/WebObjects/ASURITEActivation/ )
There are also special terminals set aside just for activating accounts
and adding new services. The largest of which is in Computing
Commons. The process takes about fifteen minutes.

There is a link from the above site to the following site:
http://courses.eas.asu.edu/cse205/spr12/

                                                               site.
This site can be accessed directly without going through myASU 8
To see notes, announcements, assignments, and exam dates.
Prerequisites

CSE 110 (Java)



If you feel that you already know the materials of this course,
you can test out the course by taking a comprehensive exam.
For more information, please contact the instructor.




                                                                  9
Textbook

•Java Foundations, Introduction to Program Design
 and Data Structures,
by John Lewis, Peter DePasquale, Joseph Chase, including a CD,
ISBN: 0-321-42972-8, 9




                                                           10
Grading
The grading schema is broken down as follows:
Item Number of Items        Point Value Percent of Final Grade
Exams         4             100           60%
Assignments 9-13            20            40%
Attendance ?                ?             5%

Total                                   105%

You can calculate your own standing by using the following formula:
(60%)*(YET + Final Score
 - the lowest exam score)/(3*100)+(40%)*YAT/(TNA*20)+(5%)*YQT/MQ
where:
YET = Your Exams Total
YAT = Your Assignments Total
TNA = Total number of Assignments
YQT = Your Quiz Total                                           11
MQT = Maximum Quiz Total
Exams

There will be three exams and one final exam.
The lowest scored exam will be dropped.
There will be absolutely no make-up exams.
(If you happen to miss an exam, that will be the one to be dropped.)
Your picture ID needs to be shown during the exams.
There is no exam during the final exam week.

Exam dates
Exam1 - Wednesday, February 8th
Exam2 - Wednesday, March 14th
Exam3 - Wednesday, April 18th

Final Exam

Lecture 5 (MW 2:00pm section) - Monday, April 30th, 12:10pm-2:00pm
                                                                  12
Assignments
All submitted files are expected to have a standard header at the top
with your information:
// Assignment #:
// Name:
// StudentID:
// Lecture:
// Description: (class description)

Here is the grading schema for those assignments:
Item      Num of Items   Point Value   Total Pts   Description
Compilation        1       2                  2    Program compiles
Test Cases         4       2                  8    Automated test cases
Documentation      1       4                  4    Program is well-documented
Indentation        1       1                  1    Indentation makes program easy to re
Space              1       1                  1    Spacing makes program easy to read
Classes&methods 1          4                  4    Required classes and methods
Total                                         20
                                                                            13
No Late Assignment is Accepted.




                              14
Attendance

Attending class is important in order for you to be aware of what
is going on. Often, announcements will be made or information
will be discussed that is not available on the web site.
Announcements in the class take precedence over printed material.
Your attendance grade may be determined by sign-in sheets or
in-class exercises that are given out randomly.




                                                              15
Grade Breakdown


Final Grade   Percentage
A+            >= 97%
A             >= 90% and < 97%
B+            >= 87% and < 90%
B             >= 80% and < 87%
C+            >= 77 and < 80%
C             >= 70% and < 77%
D             >= 60% and < 70%
E             < 60%




                                 16
Grading Appeals:

Any questions, corrections, or appeals on grades of programs
or tests must be done in writing within one week after it has returned
to the class. State the problem and the rationale for any change
in your grade in your appeal.




                                                                 17
Collaboration Policy
You are required to compose your own unique solution to each
problem and each project.

Some obvious acts of cheating include, but are not limited to:
•practicing any form of academic deceit;
•referring to materials or sources or employing devices,
        not specifically authorized by the instructor for use during tests,
        quizzes, homework, and class activities;
•acting as a substitute for another person in any academic evaluation
    or using a substitute in any academic evaluation;
•possessing, buying, selling, or otherwise obtaining or using,
         without appropriate authorization, a copy of any materials
        intended to be used for academic evaluation in advance
        of its administration;

                                                                   18
•depending on the aid of others to the extent that the work is not
        representative of the student’s abilities, knowing or having good
        reason to believe that this aid is not authorized by the instructor;
•providing inappropriate aid to another person, knowing or having good
    reason to believe the aid is not authorized by the instructor;
•submitting the ideas or work of another person or persons without
        customary and proper acknowledgment of sources
•permitting one's own ideas or work to be submitted by another person
        without the instructor’s authorization; or attempting to influence
        or change any academic evaluation or record for reasons having
        no relevance to class achievement.
•turning in work/code done by someone else
•copying work/code done by someone else
•writing one code together with someone else(should be individual work


                                                                  19
We have no problem failing you in this class for the semester and
having the appropriate entries placed in your ASU student records.
All instances of cheating will be handled by the Dean's office
according to the ASU Student Academic Integrity Policy and
the STA 104-01: Student Code of Conduct and Student
Disciplinary Procedures.

I will be using a cheating detection software to compare
all students files.




                                                               20
2. What you need to do this week.

-Work on the Assignment1 by January 11th, Wednesday, 7pm.
-Work on the Assignment2 by January 13th, Friday, 7pm.
 (see the example 4.6 on pages 134-135/1st edition (129-130/2nd edition)
 as its reference)
 All assignments should be submitted on line.




                                                                21
-Reading you need to do by the next lecture

1. Primitive data types
       p 45-49/1st edition (44-47/2nd edition)


      Type      Storage     Min Value            Max Value

      byte      8 bits      -128                 127
      short     16 bits     -32,768              32,767
      int       32 bits     -2,147,483,648       2,147,483,647
      long      64 bits     < -9 x 1018          > 9 x 1018

      float     32 bits     +/- 3.4 x 1038 with 7 significant digits
      double    64 bits     +/- 1.7 x 10308 with 15 significant digits

      char    16 bits       The character type
      boolean 1 bit         The type with the values, false and true22
2. String class -- pages 78-81/1st edition (76-79/2nd edition)

Some commonly used methods in the String class:
char charAt(int index)
        Returns the char value at the specified index.
 int compareTo(String anotherString)
        Compares two strings lexicographically.
 int compareToIgnoreCase(String str)
        Compares two strings lexicographically, ignoring case differences.
 String concat(String str)
        Concatenates the specified string to the end of this string.
boolean endWith(String suffix)
        Tests if this string ends with the specified suffix.
boolean equals(Object anObject)
        Compares this string to the specified object.

                                                                  23
boolean equalsIgnoreCase(String anotherString)
  Compares this String to another String, ignoring case considerations.
int indexOf(int ch)
   Returns the index within this string of the first occurrence
   of the specified character.
int indexOf(int ch, int fromIndex)
  Returns the index within this string of the first occurrence
  of the specified character, starting the search at the specified index.
int lastIndexOf(int ch)
   Returns the index within this string of the last occurrence of
   the specified character.
int lastIndexOf(int ch, int fromIndex)
  Returns the index within this string of the last occurrence of the
  specified character, searching backward starting at the specified index.
int length()
   Returns the length of this string.
                                                                  24
String replace(char oldChar, char newChar)
      Returns a new string resulting from replacing all occurrences
      of oldChar in this string with newChar.
String [] split(String regex)
      Splits this string around matches of the given regular expression.
boolean startsWith(String prefix)
      Tests if this string starts with the specified prefix.
String substring(int beginIndex, int endIndex)
      Returns a new string that is a substring of this string.
String toLowerCase()
      Converts all of the characters in this String to lower case using
      the rules of the default locale.
String toUpperCase()
      Converts all of the characters in this String to upper case using
       the rules of the default locale.
String trim()
       Returns a copy of the string, with leading and trailing
                                                                     25
       whitespace omitted.
3. Java escape sequences – page 39-40/1st edition (37-38/2nd edition)

Some Java escape sequences:
             Escape Sequence       Meaning

                    \b            backspace
                    \t                tab
                    \n             newline
                    \r          carriage return
                    \"           double quote
                    \'           single quote
                    \\            backslash




                                                               26
4. Scanner class (in java.util package)

The Scanner class is used to read user input. This new class was
introduced in JDK5.0, but does not exist in older version of Java library.

Pages 60-64/1st edition (57-61/2nd edition), Input (Read) Statement
Example:

import java.util.Scanner;

public class Example1
{
  public static void main(String[] args)
   {
     Scanner console = new Scanner(System.in); //create a Scanner object
     System.out.print(“Enter a unit price: “ + “\n”); //ask a user to enter a number
     double price = console.nextDouble();
     System.out.print(“Enter a quantity : “ + “\n”); //ask a user to enter an integer
     int num = console.nextInt();
     System.out.println(“Total price is: “ + (price*num));
   }
 }                                                                                      27
Some commonly used methods in the Scanner class:

boolean hasNext()
boolean hasNextDouble()
boolean hasNextInt()
boolean hasNextLine()

These methods test whether it is possible to read any non-empty string,
a floating-point value, an integer, or a line, as the next item. They return
true if it is possible to read an item of the requested type, false otherwise.

String next()
double nextDouble()
int nextInt()
String nextLine()

These methods read the next whitespace-delimited string (just one string
without containing any whitespace), floating-point value, integer or line
(until a carriage return). They return The value that was read.
                                                                      28
Conditional statements (Decisions)
if, if-else, switch
          – chapter 4, page 115,128/1st edition (110,123/2nd edition)

Loops (Iterations)
while loops, do-while, for loops
        – chapter 4, starting page 132, 149/1st edition
                                      (127,141,144/2nd edition)

Single dimensional arrays (for later assignment, not for hw1 or 2)
   -- chapter 7, page 334/1st edition (327/2nd edition)




                                                                    29
5. Creating classes (for Assignment #4) – read by sometime next week

-Read Chapter 5, page 170/1st edition (162/2nd edition)




                                                             30

								
To top