Program: Mini Phone Book 2/11/2016

Slides:



Advertisements
Similar presentations
Chapter 12 Sorting and searching. This chapter discusses n Two fundamental list operations. u Sorting u Searching n Sorted lists. n Selection/bubble sort.
Advertisements

CATHERINE AND ANNIE Python: Part 3. Intro to Loops Do you remember in Alice when you could use a loop to make a character perform an action multiple times?
Computer Science 209 Software Development Equality and Comparisons.
Using Classes to Store Data Computer Science 2 Gerb.
Chapter 6: Arrays Java Software Solutions for AP* Computer Science
CPS120: Introduction to Computer Science Searching and Sorting.
Text Chapters 1, 2. Sorting ä Sorting Problem: ä Input: A sequence of n numbers ä Output: A permutation (reordering) of the input sequence such that:
CS 206 Introduction to Computer Science II 09 / 05 / 2008 Instructor: Michael Eckmann.
CS107 Introduction to Computer Science Lecture 5, 6 An Introduction to Algorithms: List variables.
AP Computer Science.  Not necessary but good programming practice in Java  When you override a super class method notation.
Searching and Sorting Arrays
CS 106 Introduction to Computer Science I 03 / 17 / 2008 Instructor: Michael Eckmann.
1 CSC 222: Computer Programming II Spring 2005 Searching and efficiency  sequential search  big-Oh, rate-of-growth  binary search  example: spell checker.
Address Book in JAVA By What is Address Book Address Book is book or database used for storing entries called contacts Each contact.
Searching Algorithms. The Search Problem Problem Statement: Given a set of data e.g., int [] arr = {10, 2, 7, 9, 7, 4}; and a particular value, e.g.,
Institute for Personal Robots in Education (IPRE)‏ CSC 170 Computing: Science and Creativity.
Writing Methods Using if, loops, and variables to implement algorithms Copyright © 2012 Pearson Education, Inc.
A review session 2013-T2 Lecture 16 School of Engineering and Computer Science, Victoria University of Wellington COMP 103 Marcus Frean.
Chapter 10 Strings, Searches, Sorts, and Modifications Midterm Review By Ben Razon AP Computer Science Period 3.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington ArraySet and Binary Search.
© A+ Computer Science - public Triangle() { setSides(0,0,0); } Constructors are similar to methods. Constructors set the properties.
Computer Science 101 Circuit Design - Examples. Sum of Products Algorithm Identify each row of the output that has a 1. Identify each row of the output.
SortingBigOh ASFA AP Computer Science A. Big-O refers to the order of an algorithm runtime growth in relation to the number of items I. O(l) - constant.
1 CompSci 105 SS 2005 Principles of Computer Science Lecture 6: Recursion Lecturer: Santokh Singh Assignment 1 due tomorrow. Should have started working.
Basic Data Structures Stacks. A collection of objects Objects can be inserted into or removed from the collection at one end (top) First-in-last-out.
Exercise 2 Introduction to C# CIS Create a class called Employee that contains the following private instance variables: Social Securitystring.
Ordered Lists and Sorted Lists Chapter 7. Ordered Lists Array version vs. Linked-list version.
ALGORITHMS.
Computer Science 209 Software Development Inheritance and Composition.
Composition When one class contains an instance variable whose type is another class, this is called composition. Instead of inheritance, which is based.
Complexity and Efficiency Computer Science 3 Gerb Objective: Understand complexity and efficiency of algorithms.
Introduction to Objects and Encapsulation Computer Science 4 Mr. Gerb Reference: Objective: Understand Encapsulation and abstract data types.
Chapter 8 Slides from GaddisText Arrays of more than 1 dimension.
Lecture 2 What is a computational problem? What is an instance of a problem? What is an algorithm? How to guarantee that an algorithm is correct? What.
ITEC 2620M Introduction to Data Structures Instructor: Prof. Z. Yang Course Website: 20m.htm Office: TEL 3049.
Computer Science 2 Arrays of Records. First Record Program Input an unknown number of Team Names, School names, and Total scores. (While loop) –Output:
CPS120: Introduction to Computer Science Sorting.
© A+ Computer Science - Elevens is a lab about classes and Lists. List is a major concept being tested by the Elevens lab. Elevens.
Chapter 9: Sorting and Searching Arrays
Sorting and "Big Oh" ASFA AP Computer Science A SortingBigOh.
CS 240 Week 2.
AP Java Elevens Lab.
CMSC201 Computer Science I for Majors Lecture 22 – Searching
Software Development Java Classes and Methods
Chapter 2 (16M) Sorting and Searching
Lesson 5-15 AP Computer Science Principles
Java Array Lists 2/13/2017.
Multiple Choice -answer the easiest question 1st
Final Review Dr. Xiaolin Hu.
كلية المجتمع الخرج البرمجة - المستوى الثاني
Chapter 8 Arrays Objectives
© A+ Computer Science - Arrays and Lists © A+ Computer Science -
ITunes Lab Copyright © 2012 Pearson Education, Inc.
Programming with ANSI C ++
Sorts on the AP Exam Insertion Sort.
Computer Science — An Overview J. Glenn Brookshear
Computer Science 2 Arrays of Records.
Computer Science 2 Getting an unknown # of …. Into an array.
BTEC COMPUTING – UNIT 1 SECTION B - FLOWCHARTS
Computer Science Sorting.
Computer Science 2: Trees
Java Array Lists 2/13/2017.
Final Review Fan Bai Csc 2310 Spring 2012.
Computer Science Sorting Pre-Test Discussion/program
Chapter 8 Arrays Objectives
Sorting Develop a sorting algorithm
Sorting and Complexity
Feed Order System Manual
COMPUTING.
Presentation transcript:

Program: Mini Phone Book 2/11/2016 AP Computer Science Program: Mini Phone Book 2/11/2016

Create a ‘Contact’ class with the following Instance variables: - String name, - String phoneNumber, - String school Constructor: Sent a name and phone number Methods +String getName() +String getNumber() +String toString() +compareTo(Contact otherPerson) returns <0 if less than otherPerson.getName() returns 0 if equal to otherPerson.getName() returns >0 if greater than otherPerson.getName() Write an application with an ArrayList of contacts with the following menu items with a while loop Add contact Show all contacts Find contact: Input a name and search the ArrayList and return the phone number or a remark if the person is not in the ArrayList Find contacts from a school. Input the name of the school and show all of the contacts from that school. Push: Sort contacts by name Push: Sort contacts by School so that within each school the names are in order Push: Modify the add contact part of the menu to insert the new contact in order by name

Add ons (2/16/2016) Include the sort by name option Modify the Add name to put the names in order alphabetically Modify the Find algorithm to use a Binary Search Binary Search