CompSci 001 13.1 Today’s topics Java The Database Program Upcoming Recursion Reading Great Ideas, Chapter 4.

Slides:



Advertisements
Similar presentations
Formulas, Ranges, and Functions. Formulas n Formulas perform operations such as addition, multiplication, and comparison on worksheet values. n Formulas.
Advertisements

RAPTOR Syntax and Semantics By Lt Col Schorsch
REACH-CRC. Lookup Functions INDEX-MATCH LOOKUP Database Functions DSUM DMIN DMAX DCOUNT DAVERAGE.
© Paradigm Publishing, Inc Excel 2013 Level 2 Unit 1Advanced Formatting, Formulas, and Data Management Chapter 2Advanced Functions and Formulas.
Introduction to Excel Formulas, Functions and References.
CompSci Today’s topics Java Recursion in Graphics Writing a Class Simple Animation Upcoming Simulation Reading Great Ideas, Chapters 5.
MIS: Chapter 14 Cumulative concepts, features and functions, plus new functions COUNTIFS, SUMIFS, AVERAGEIFS (Separate ppt on REACH.louisville.edu) All.
What are the features of Moodle? Do NOT view this PowerPoint as a show. You need to be able to read the notes down below.
Exploring Microsoft Access
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. ACCESS 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 12 – Building.
Instructor: Craig Duckett CASE, ORDER BY, GROUP BY, HAVING, Subqueries
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
CS 178: Programming with Multimedia Objects Aditya P. Mathur Professor of Computer Sciences Purdue University, West Lafayette Sept 9, 2004 Last update:
1 Simple Phone Applet Lab Mobile Phone Display Area Send, Menu and End Numbers 0-9 * and #
Java Programming, 3e Concepts and Techniques Chapter 5 Arrays, Loops, and Layout Managers Using External Classes.
Week 6 - Programming I So far, we’ve looked at simple programming via “scripts” = programs of sequentially evaluated commands Today, extend features to:
CS 106 Introduction to Computer Science I 03 / 17 / 2008 Instructor: Michael Eckmann.
10.1 AWT The AWT classes Users today expect a Graphical User Interface (GUI) Improves application usability Difficult to implement cross-platform.
Microsoft Access 2010 Chapter 7 Using SQL.
Querying and Sorting IT Key Ideas, Dynamic Database Systems, 2002 Chapter 3.
Exploring Office Grauer and Barber 1 Information From the Database: Reports and Queries(Wk4)
Attribute Data in GIS Data in GIS are stored as features AND tabular info Tabular information can be associated with features OR Tabular data may NOT be.
Java: Chapter 1 Computer Systems Computer Programming II.
Java Programming, 3e Concepts and Techniques Chapter 3 Section 65 – Manipulating Data Using Methods – Java Applet.
CPS Today’s topics Java Information Retrieval Upcoming Database Programs Reading Great Ideas, Chapter 4.
CS 106 Introduction to Computer Science I 03 / 19 / 2007 Instructor: Michael Eckmann.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 9 1 Microsoft Office Access 2003 Tutorial 9 – Using Action Queries, and Defining Table Relationships.
CIS 451: Regular Expressions Dr. Ralph D. Westfall January, 2009.
File Processing - Indexing MVNC1 Indexing Jim Skon.
WEEK 11 Database Design. TABLE INSTANCE CHARTS Create Tables.
CompSci Today’s topics Java Review Just a bunch of headings meant to trigger questions A contraction of previous notes Upcoming Midterm Exam Reading.
NoteSearch - Find what you’re looking for. Prototype Team B.
Exploring Office Grauer and Barber 1 Committed to Shaping the Next Generation of IT Experts. Chapter 3 - Information From the Database: Reports.
 Agenda 2/20/13 o Review quiz, answer questions o Review database design exercises from 2/13 o Create relationships through “Lookup tables” o Discuss.
Copyright © 2012 Pearson Education, Inc. Chapter 6 More Conditionals and Loops Java Software Solutions Foundations of Program Design Seventh Edition John.
Microsoft Access 2000 Presentation 1 The Basics of Access.
Perst Query-by-Example. Customized Searches  When using relational SQL-style databases, you define a search using a query string  Specify columns 
Chapter 3 Query and Report. Agenda Report types Report contents Report creation Report design view Query and dynaset Function and grouping Action query.
Course ILT Forms and queries Unit objectives Create forms by using AutoForm and the Form Wizard, and add or modify form headers and footers Open and enter.
CPS Today’s topics Java Applications Graphics Upcoming Review for Midterm Exam Reading Great Ideas, Chapters 5.
1 Lesson: Applets with User Input and Output with GUI ICS4M.
Java Applets: GUI Components, Events, Etc. Ralph Westfall June, 2010.
Java Applet Basics (2). The Body Mass Index Calculator.
CompSci Today’s topics Java Applications Simulation Upcoming Software Engineering (Chapter 7) Reading Great Ideas, Chapters 6.
LANDESK SOFTWARE CONFIDENTIAL Tips and Tricks with Filters Jenny Lardh.
Excel 2007 Part (3) Dr. Susan Al Naqshbandi
Compsci 201 Recitation 10 Professor Peck Jimmy Wei 11/1/2013.
SNU OOPSLA Lab. 1 Great Ideas of CS with Java Part 1 WWW & Computer programming in the language Java Ch 1: The World Wide Web Ch 2: Watch out: Here comes.
CompSci Today’s topics Java Numbers Iteration Upcoming More Java Reading Great Ideas, Chapter 3.
CSI 3125, Preliminaries, page 1 AWT Control. CSI 3125, Preliminaries, page 2 AWT Control The AWT supports the following types of controls: ■ Labels ■
CompSci Today’s topics Java Writing Functions/Methods Upcoming Information Retrieval Reading Great Ideas, Chapter 4.
Exploring Office 2003 Vol 1 2/e - Grauer and Barber 1 Committed to Shaping the Next Generation of IT Experts. Chapter 3 - Information From the Database:
Lecture 8: Advanced OOP Part 2. Overview Review of Subtypes Interfaces Packages Sorting.
CS 180 Problem Solving and Object Oriented Programming Fall 2010 Notes for Week 9: Oct 18-22, 2010 Aditya Mathur Department of Computer Science Purdue.
Today’s topics Java Input More Syntax Upcoming Decision Trees More formal treatment of grammers Reading Great Ideas, Chapter 2.
Fall Lab 131 CS105 Lab 13 – Logical Operator Precedence and Joining Tables Announcements: MP 3 released Friday, 11/20 Honors project due: Tuesday,
Enum,Structure and Nullable Types Ashima Wadhwa. Enumerations, Enumerations, or enums, are used to group named constants similar to how they are used.
Access Module Implementing a Database with Microsoft Access A Great Module on Your CD.
CompSci Today’s topics Basic HTML  The basis for web pages  “Almost” programming Upcoming  Programming  Java Reading Great Ideas Chapters 1,
CompSci 1 Lecture 2 HTML Webpages. Today’s Topics Basic HTML The basis for web pages “Almost” programming Upcoming Programming Java Reading Great Ideas.
Today’s topics Java Looping Upcoming Arrays in Java Reading Great Ideas, Chapter 3.
Access Query Design. IT Fundamentals2 Access Query Design The Query design screen provides a mechanism for selecting specific data from datafile(s) by:
Course Contents Overview: Database basics Lesson 1: Benefits of using a database Lesson 2: Table that data Lesson 3: Analyzing, viewing, and reporting.
CompSci Today’s topics Java Recursion Upcoming Graphics Reading Great Ideas, Chapter 4 (begin Chapter 5 for graphics)
CompSci From bits to bytes to ints  At some level everything is stored as either a zero or a one  A bit is a binary digit a byte is a binary.
Today’s topics Java Upcoming Reading Recursion in Graphics
Today’s topics Java Information Retrieval Upcoming Database Programs
Today’s topics Java Arrays Upcoming Functions Reading
Primitive Data Types and Operators
Java-Assignment #4 (Due, April. 9, 2004)
Presentation transcript:

CompSci Today’s topics Java The Database Program Upcoming Recursion Reading Great Ideas, Chapter 4

CompSci Database  Extend ideas used in phone program  Can have many “parallel” arrays  Design Used Car Database Make Style Color Owner Year “Mercedes” “Ford” “Mercedes” “Datsun” “Ford” “4 door” “truck” “4 door” “2 door” “4 door” “white” “ivory” “blue” “green” “red” “blue” “M.Ramm” “D.Ramm” “M.Ramm” “D.Ramm” “K.Ramm” “D.Ramm”

CompSci Basic Functions  What do we expect of a database program?  Load Data (file I/O would be nice)  Display Data (complete dump)  Edit/Update (make corrections, add more data)  Query/Search (selective info retrieval)  What are we actually going to implement?  Know no file I/O: build data in  Will have a way to display all  This program will not attempt edit/update  Queries are the key to making this useful

CompSci Naïve Query  Use same approach as telephone lookup  Specify value for only one of the lists  E.g., specify Ford o Get all entries that are Fords o OK for small lists like this toy example  What is the problem here?  ?  Similar problem for using any other single specification

CompSci More Queries  Other Simple Query  The example has 5 lists  Specify what we want to match in each list  E.g. Ford, truck, blue, M.Ramm, 1972 o Very limiting o Can really only expect a True/False response of this o We either get a “hit” or we do not  Wild Card Specification  Can specify that we do not care about one or more lists  Adds surprising versatility!  E.g. Mercedes,4 door, don’t-care,don’t-care,don’t-care  Yields multiple responses for this example

CompSci Database Program public class UsedCars extends java.applet.Applet implements ActionListener { TextField gMake, gStyle, gColor, gOwner, mInstruct; IntField gYear; String Make[] = {"Mercedes","Mercedes","Ford","Mercedes","Datsun","Ford“ }; String Style[]= {"4 door", "4 door", "truck", "4 door", "2 door","4 door"}; String Color[]= {"white", "ivory", "blue", "green", "red", "blue“ }; String Owner[]= {"M.Ramm", "D.Ramm", "M.Ramm","D.Ramm", "K.Ramm","D.Ramm"}; int Year[] = { 1987, 1987, 1972, 1971, 1978, 1978 }; Label make, style, color, owner, year; Button bSearch; TextArea mResults; int size = 6;

CompSci Database Program.2 public void init() { year = new Label("Year"); make = new Label("Make"); style = new Label("Style"); color = new Label("Color"); owner = new Label("Owner"); mInstruct = new TextField(60); mInstruct.setText( "Enter Selections, leave blank for Wild Card"); gYear = new IntField(10); gMake = new TextField(10); gStyle = new TextField(10); gColor = new TextField(10); gOwner = new TextField(20); bSearch = new Button("Search"); mResults = new TextArea(10, 60);

CompSci Database Program.3 bSearch.addActionListener(this); add(mInstruct); add(year); add(gYear); add(make); add(gMake); add(style); add(gStyle); add(color); add(gColor); add(owner); add(gOwner); add(bSearch); add(mResults); } public void actionPerformed(ActionEvent event) { int yea; String mak, sty, col, own; yea = gYear.getInt(); mak = gMake.getText(); sty = gStyle.getText(); col = gColor.getText(); own = gOwner.getText(); mResults.setText("Cars Matching Parameters Specified\n"); report(yea, mak, sty, col, own, size); }

CompSci Database Program.4 boolean isMatch(int year, int yea, String make, String mak, String style, String sty, String color, String col, String owner, String own) { if ((year == yea || yea == 0) && (make.equals(mak) || mak.equals("")) && (style.equals(sty)|| sty.equals("")) && (color.equals(col)|| col.equals("")) && (owner.equals(own)||own.equals("")) ) { return true; } return false; }

CompSci Database Program.5 void report(int yea, String mak, String sty, String col, String own, int num) { int k = 0; while (k < num) { if (isMatch(Year[k], yea, Make[k], mak, Style[k], sty, Color[k], col, Owner[k], own)){ mResults.append("year: " + Year[k] + " make: " + Make[k] + " style: " + Style[k] + " color: " + Color[k] + " owner: " + Owner[k] + "\n"); } k = k + 1; }

CompSci Other possible Features  Allow output of counts rather than displaying field  Permit logical expression, not just matching  E.g., Ford | Chevy  For numeric data allow ranges  E.g., 1999 < year < 2003  Allow merging or joining of databases  This capability is called a Relational Database  Like having multiple database all linked together

CompSci Relational Databases  Possible Duke Databases: Students Name, Year, Major, Schedule, … Classes Dept, Number, Section, Instructor, Times, Location, Roll, … Rooms Building, Number, Capacity, AV, … Courses Dept, Number, Title, Type, Description, Prerequisites, …  Possible Queries (Reports):  Class Roll : Which of the databases above are needed?