Homework 14 Due ( MT sections ) ( WTh sections ) at midnight Sun., 12/7 Mon., 12/8 Problems

Slides:



Advertisements
Similar presentations
Continuation of chapter 6…. Nested while loop A while loop used within another while loop is called nested while loop. Q. An illustration to generate.
Advertisements

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.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 3: Flow Control I: For Loops.
Introduction to Programming
Introduction to Programming
1 Calling within Static method /* We can call a non static method from a static method but by only through an object of that class. */ class Test1{ public.
1 More on Arrays and Loops Reading for this Lecture: –Section 5.4, , Break and Continue in Loops Arrays and For-each Loops Arrays and Loops.
Homework 6 Due ( MT sections ) ( WTh sections ) about midnight Sun., 10/12 Mon., 10/13 Problems
CSCI S-1 Section 5. Deadlines for Problem Set 3 Part A – Friday, July 10, 17:00 EST Parts B – Tuesday, July 14, 17:00 EST Getting the code examples from.
1 Repetition structures Overview while statement for statement do while statement.
Homework 4 Due ( MT sections ) ( WTh sections ) at midnight Sun., 9/29 Mon., 9/30 Problems
 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.
10 ThinkOfANumber program1July ThinkOfANumber program CE : Fundamental Programming Techniques.
CSc2310 tutoring session, week 8 Fall, 2012 Haidong Xue 5:30pm—8:30pm 10/30/2012 and 10/31/2012 -Code PrintCalendar.
Class Schedule Template SundayMondayTuesdayWednedayThursdayFridaySaturday 6 AM 7 AM 8 AM 9 AM 10 AM 11 AM 12 AM 1 PM 2 PM 3 PM 4 PM 5 PM 6 PM Title Classroom.
CS 5 HW 12 (2 problems) M/T sections W/Th sections due Sunday, 11/21 at midnight due Monday, 11/22 at midnight Recitation for HW12 -- Friday 8:00am Looking.
Database Programming Dr. John Abraham. Data Sources Data source specifies the source of the data for an application. Click on Data from Menu Choose show.
Introduction to Java Thanks to Dan Lunney (SHS). Java Basics File names The “main” method Output to screen Escape Sequence – Special Characters format()
1 Introduction to Java Brief history of Java Sample Java Program Compiling & Executing Reading: => Section 1.1.
BUILDING JAVA PROGRAMS CHAPTER 2 Days of For Loops Past.
Homework 11 Due ( MT sections ) ( WTh sections ) at midnight Sun., 11/14 Mon., 11/15 Problems
CSCI S-1 Section 6. Coming Soon Homework Part A – Friday, July 10, 17:00 EST Homework Part B – Tuesday, July 14, 17:00 EST Mid-Term Quiz Review – Friday,
Homework 3 Due ( MT sections ) ( WTh sections ) at midnight Sun., 9/21 Mon., 9/22 Problems
This week in CS 5 HW 9 (2 problems) M/T sections W/Th sections due Sunday, 11/4 at midnight due Monday, 11/5 at midnight Recitation for HW9 -- Friday 11/2.
Homework 5 Due ( MT sections ) ( WTh sections ) at midnight Sun., 10/6 Mon., 10/7 Problems
1 Operators and Expressions Instructor: Mainak Chaudhuri
Homework 9 Due ( M & T sections ) ( W & Th sections ) at midnight Sun., 11/3 Mon., 11/4 Problems
Lec 20 More Arrays--Algorithms. Agenda Array algorithms (section 7.5 in the book) – An algorithm is a well-defined specification for solving a problem.
Lecture 8 Using casts, Strings and WordUtil. Agenda Generating random numbers Casts – Casting a double into an int – Casting an int into a char – Casting.
RECITATION 4. Classes public class Student { } Data Members public class Student { private String name; public String id; }
BEGINNING PROGRAMMING.  Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such.
VARIABLES Programmes work by manipulating data placed in memory. The data can be numbers, text, objects, pointers to other memory areas, and more besides.
1 Building Java Programs Chapter 3: Introduction to Parameters and Objects These lecture notes are copyright (C) Marty Stepp and Stuart Reges, They.
Indentation & Readability. What does this program do? public class Hello { public static void main ( String[] args ) { //display initial message System.out.println(
Homework 8 Due ( MT sections ) ( WTh sections ) at midnight Sun., 10/28 Mon., 10/29 Problems Reading is under week 7, however.
Eclipse Project. Installing Visit to download a copy for your home computerhttp:// –Get Release version 3.0 (or.
FOR LOOP WALK THROUGH public class NestedFor { public static void main(String [] args) { for (int i = 1; i
Building java programs, chapter 3 Parameters, Methods and Objects.
Code Compression the benefits of looping... Today in CS 5 HW 4 - (3 problems) M/T sections W/Th sections due Sunday, 9/26 at midnight due Monday, 9/27.
Sit-In Lab 2 - OOP Restaurant.  Manage a restaurant and perform these types of queries: Assign a favorite table to a specific group Assign the lexicographically-smallest.
Library Books exercise cosc The classes Library class +ArrayList -ArrayList + Library() +initializeDefaultCategories():void +displayAllCategories():void.
1 Class Chapter Objectives Use a while loop to repeat a series of statements Get data from user through an input dialog box Add error checking.
Take-Home Lab #02 CS1020 – DATA STRUCTURES AND ALGORITHMS 1 AY SEMESTER 2 1.
Week 6 - Friday.  What did we talk about last time?  Loop examples.
Computer Programming Lab 9. Exercise 1 Source Code package excercise1; import java.util.Scanner; public class Excercise1 { public static void main(String[]
Catie Welsh February 14,  Program 2 Due Tonight by 11:59pm  Program 3 Assigned 2.
JAVA METHODS (FUNCTIONS). Why are they called methods? Java is a strictly object-oriented programming language Methods are functions inside of objects.
Homework 10 Due ( MT sections ) ( WTh sections ) at midnight Sun., 11/10 Mon., 11/11 Problems
Methods. Creating your own methods Java allows you to create custom methods inside its main body. public class Test { // insert your own methods right.
Programming in Java Transitioning from Alice. Becomes not myFirstMethod but …. public static void main (String[] arg) { // code for testing classes goes.
Methods Matthew Harrison. Overview ● There are five main aspects of methods... ● 1) Modifiers – public, private ● 2) Method Name ● 3) Parameters ● 4)
CS 160 – Summer 16 Exam 1 Prep.
Homework 12 Sun., 11/24 Due Mon., 11/25 Problems (2 of them)
using System; namespace Demo01 { class Program
Using Objects.
Nelson Speaker Series Monica Lam, Stanford
Decision statements. - They can use logic to arrive at desired results
Homework 2 Sun., 9/12 Due Mon., 9/13 Problems available on-line
Computing Adjusted Quiz Total Score
Code Animation Examples
References and Objects
class PrintOnetoTen { public static void main(String args[]) {
Module 4 Loops and Repetition 4/7/2019 CSE 1321 Module 4.
Scope of variables class scopeofvars {
Module 4 Loops and Repetition 4/15/2019 CSE 1321 Module 4.
Lecture 22: Number Systems
Methods/Functions.
Why We Need Car Parking Systems - Wohr Parking Systems
Types of Stack Parking Systems Offered by Wohr Parking Systems
Add Title.
Presentation transcript:

Homework 14 Due ( MT sections ) ( WTh sections ) at midnight Sun., 12/7 Mon., 12/8 Problems Tutors available Saturday afternoons Parsons Lab only (maybe) Sunday afternoons Lac Lab and Parsons Sunday evenings Lac Lab and Parsons Monday evenings Lac Lab and Parsons

Tutors available -- contact information

Tutors available -- lab places and times You may also seek out tutors away from the labs, by phone, in the dorms, etc. Available in the LAC Lab (Linde Activities Center) Available in Parsons PC Labs (the CIS classrooms)

Visualizing Objects FilmDB allFilms type name addFilmdisplayAllFilms int count Film[] films … films[0]films[1]films[2] DirectorDB allDirs type name addDirectordisplayAllDirectors int count Director[] dirs dirs[1]dirs[2] … … dirs[0] int capacity

Visualizing Objects Film f type name displaygetTitle String titleint year Director d type name getFullNamegetFilmDB String fname String lname … String rating double review Director dir FilmDB filmDB

Overview public static void main(String[] args) { // create a FilmDB and a DirectorDB… // start a large while loop

Option 7 -- high level if (uc == 7) // adding a film (1) get title (2) check if film is already there! (3) get director’s first and last name (4) check if director is already there! (6) get year, rating, and review (7) create new film (5) create and add director, if needed (8) ADD f d f to f allFilms d ’s filmDB

Method Matching allFilms (a FilmDB) addFilm allDirs (a DirectorDB) addDirector f (a Film) getFullName displayAllFilms getFilmDB displayFilmsByDirector d (a Director) displayAllDirectors getTitle findDirectorByName checkForFilm

Option 7 -- high level if (uc == 7) // adding a film

This space for rent... cheap!

Finding a director... public Director findDirectorByName(String fname, String lname) // inside class DirectorDB addDirectordisplayAllDirectors int count Director[] dirs dirs[1]dirs[2] … dirs[0] int capacity

Getting a Director ’s name public String getFullName() // inside class Director getFullNamegetFilmDB String fname String lname … FilmDB filmDB

Printing a director’s films public void displayFilmsByDirector(String fname, String lname) // inside class DirectorDB addDirectordisplayAllDirectors int count Director[] dirs dirs[1]dirs[2] … dirs[0]

Other methods... public void displayFilmsByDirector(String fname, String lname) // inside class DirectorDB

films[0]films[1]films[2] dirs[1]dirs[2] … … dirs[0] FilmDB type int Film[] DirectorDB type int Director[]

Visualizing Objects FDB name addFilmdisplayAllFilms count films … DDB name addDirectordisplayAllDirectors count dirs

Visualizing Objects f name displaygetTitle title year d name getFullNamegetFilmDB fname lname … rating review dir filmDB

Visualizing Objects Film type Stringint Director type String double Director FilmDB

Finding a director... public Director findDirectorByName(String fname, String lname) // inside class DirectorDB

addDirectordisplayAllDirectors int count Director[] dirs dirs[1]dirs[2] … dirs[0] getFullNamegetFilmDB String fname String lname … FilmDB filmDB addDirectordisplayAllDirectors int count Director[] dirs dirs[1]dirs[2] … dirs[0]

Printing a director... public String getFullName() // inside class Director

Printing a director’s films public void displayFilmsByDirector(String fname, String lname) // inside class DirectorDB

Homework 14 Due ( MT sections ) ( WTh sections ) at midnight Sun., 12/9 Mon., 12/10 Problems Tutors available Saturday afternoons Lac Lab Sunday afternoons Lac Lab and AC Sunday evenings Lac Lab and AC Monday evenings Lac Lab and AC Joanna Wu & Jenny Xu LAC Andrew Klose & Jessica Lee in AC M. Chase & Chris Lee - LAC W. Berriel & A. Klose - AC

Overview public static void main(String[] args) { // Create a FilmDB and a DirectorDB

Overview // create a FilmDB and a DirectorDB… // start a large while loop

Option 7 -- high level if (userchoice == 7) // adding a film

Option 7 -- high level if (userchoice == 7) // adding a film (1) get title (2) check if film is already there! (3) get director’s first and last name (4) check if director is already there! (6) get year, rating, and review (7) create new film (5) create and add director, if needed (8) ADD f d d to f f DDB FDB d ’s filmDB

Method Matching FDB (a FilmDB) addFilm DDB (a DirectorDB) addDirector f (a Film) getFullName displayAllFilms getFilmDB displayFilmsByDirector d (a Director) displayAllDirectors getTitle findDirectorByName findFilmByTitle

Option 7 -- code if (userchoice == 7) // adding a film