Designing a Social Network Prep for Lab 10. March 26, 2018 Sprenkle - CSCI Why classes and objects? How do we create new data types?

Similar documents
Review of Lab 9. Review Lab 9. Social Network Classes/Driver Data. Lab 10 Design

Text UI. Data Store Ø Example of a backend to a real Could add a different user interface. Good judgment comes from experience

Lab 11: Pair Programming. Review: Pair Programming Roles

Coverage tools Eclipse Debugger Object-oriented Design Principles. Oct 26, 2016 Sprenkle - CSCI209 1

Objec&ves. Usability Project Discussion. May 9, 2016 Sprenkle - CSCI335 1

Review: SoBware Development

11/15/13. Objectives. Review. Our Screen Saver Dependencies. Our Screen Saver Dependencies. Project Deliverables Timeline TEAM FINAL PROJECT

Objec&ves. Review. JUnit Coverage Collabora&on

Best Prac*ces & Training Guide for Professional Development and Networking - June 2011-

Objec&ves. Review. So-ware Quality Metrics Sta&c Analysis Tools Refactoring for Extensibility

New features in Oracle 11g for PL/SQL code tuning.

Objec&ves. Tes&ng 11/8/16. by Frederick P. Brooks, Jr., 1986

1-1. Copyright 2015 Pearson Education, Inc.

Minimum Spanning Tree Union-Find Data Structure. Feb 28, 2018 CSCI211 - Sprenkle. Comcast wants to lay cable in a neighborhood. Neighborhood Layout

CSCI 325: Distributed Systems. Objec?ves. Professor Sprenkle. Course overview Overview of distributed systems Introduc?on to reading research papers

IBM Cognos Open Mic Cognos Analytics 11 Part nd June, IBM Corporation

Agenda. December Beth Saunders, MS CCC/SLP/ATP 1. Beth s Disclosure. Learner Outcomes. Chris<ne s Disclosure. Goal = Communica<on and Language

Thinking Like a Computer Scien4st About Ancient Roman Graffi4

Google App Engine 8/10/17. CS Cloud Compu5ng Systems--Summer II 2017

Proving correctness of Stable Matching algorithm Analyzing algorithms Asymptotic running times

CSCI211: Intro Objectives

Analyzing proofs Introduction to problem solving. Wiki: Everyone log in okay? Decide on either using a blog or wiki-style journal?

Dynamic Games Lesson 4: Economic Aplica4ons. Universidad Carlos III

Clause Logic Service User Interface User Manual

M-Vote (Online Voting System)

Decentralised solutions for renewable energies and water in developing countries

Hoboken Public Schools. PLTW Introduction to Computer Science Curriculum

The optical memory card is a Write Once media, a written area cannot be overwritten. Information stored on an optical memory card is non-volatile.

Hoboken Public Schools. Project Lead The Way Curriculum Grade 8

Bank Reconciliation Script

Guernsey Chamber of Commerce. Website User Guide

Prim's MST Algorithm with step-by-step execution

Legalization of Cannabis. Association of Municipalities of Ontario Annual Conference August 2017

Fall 2016 COP 3223H Program #5: Election Season Nears an End Due date: Please consult WebCourses for your section

TEMPO Mission Project July 23, Project Manager: Alan Little

Midterm Review. EECS 2011 Prof. J. Elder - 1 -

Cross- Campus Enrollment System Project Update. December, 2015

Cyber-Physical Systems Feedback Control

Final Review. Chenyang Lu. CSE 467S Embedded Compu5ng Systems

Congratula1ons: You are now a Rep

CS 5523: Operating Systems

General Framework of Electronic Voting and Implementation thereof at National Elections in Estonia

ISO/IEC20000 Overview and Cer2fica2on Approach

Chapter 8: Recursion

1 University Deposit Reconciliation - Central Offices 3. Overview - University Deposit Reconciliation and Approval 4

Estonian National Electoral Committee. E-Voting System. General Overview

Gary Hart, PhD. Partners

SPARC Version New Features

Installation Guide: cpanel Plugin

Integration Guide for ElectionsOnline and netforum

Lecture Series - MSG 141 Technical Architecture and Standards C2- Simula:on Interoperability (C2SIM)

6/21/2016. Project Overview and Objectives. Project Overview and Objectives

Creating a Criminal Appeal and documents in ecourts Appellate

Smart Voting System using UIDAI

The 10- Year Framework of Programmes on Sustainable Consump=on & Produc=on. * An Intergovernmental mandate * Introduction

Safer internet evening. 11 February 2014

Predic'ng Armed Conflict Using Machine Learning. Graig R. Klein, Binghamton University Nicholas P. TatoneB, Columbia University

HISTORY GEOSHARE, DRINET, U2U

Omega Psi Phi Fraternity, Inc. MyPage End-User Help Guide

Bridging the Gap Between Legacy & Standards. d-wise. Bill Qubeck, Life Sciences Director

STATE OF KANSAS v. ANTHONY A. ALLEN. No. 74,639 SUPREME COURT OF KANSAS. 260 Kan. 107 (1996)

MWONGOZO; THE CODE OF GOVERNANCE FOR STATE CORPORATIONS. CS Catherine Musakali

16-1. Copyright 2015 Pearson Education, Inc.

Priority Queues & Heaps

MAVA 102 Introduc0on to Media & Communica0ons. Week 2 - Media, Communica0on & Culture

memo Date: March 26, 2012 To: From:

Review: Background on Bits. PFTD: What is Computer Science? Scale and Bits: Binary Digits. BIT: Binary Digit. Understanding scale, what does it mean?

Post contractual non-competition clauses

Who Am I? Jordan Brown NPO Partnerships Coordinator Razoo.com. Facebook.com/RazooGiving

Support Vector Machines

Priority Queues & Heaps

Fortgeschri+enes Experimen2eren. Advanced Physics Lab

User Guide. News. Extension Version User Guide Version Magento Editions Compatibility

IC Chapter 15. Ballot Card and Electronic Voting Systems; Additional Standards and Procedures for Approving System Changes

City of Toronto Election Services Internet Voting for Persons with Disabilities Demonstration Script December 2013

The Elements of Editing. Charles F. Whitaker Helen Gurley Brown Magazine Research Chair Medill School of Journalism

reddit: How to engage with the internet s passionate communities Victoria Taylor, director of communications at reddit

Coali&on Ba*le Management Language (C- BML) and C2SIM History and Development

Find Your Voice! Political Participation

Building Blocks of Research Process. Alan Monroe Chapter 2

HANDS ACROSS BORDERS. An International Workshop on. Alterna(ve Mechanisms to Establish and Govern Transboundary Conserva(on Ini(a(ves

Recommendations For Reddit Users Avideh Taalimanesh and Mohammad Aleagha Stanford University, December 2012

Sector Discrimination: Sector Identification with Similarity Digest Fingerprints

THE PREPARED CURRICULUM: FOR POST-SECONDARY AND CAREEER READINESS

Service Request Manual

Compsci 290.3, Spring 2017 Software Design and Implementation: Mobile Landon Cox Owen Astrachan

Child Check In Quick Start Guide. v 9.5. Local: (706) Atlanta: (404) Toll Free: (866)

Monday, March 4, 13 1

Hybrid and electric vehicle ac0vi0es in Latvia. 37 th IA- HEV ExCo mee0ng, October 2012

Using Technology to Improve Jury Service 39

Adaptive QoS Control for Real-Time Systems

The Seniority Info report window combines three seniority reports with an employee selection screen.

Overview. Ø Neural Networks are considered black-box models Ø They are complex and do not provide much insight into variable relationships

Elec%ons & Legisla%ve Session WAPA ANNUAL CONVENTION DECEMBER 2, 2014

Guidelines Targeting Economic and Industrial Sectors Pertaining to the Act on the Protection of Personal Information. (Tentative Translation)

Andreas Fring. Basic Operations

BMI for everyone. Compsci 6/101: PFTW. Accumulating a value. How to solve an APT. Review how APTs and Python work, run

Admission of TCN- Introduction. Constança Urbano de Sousa ULB, Brussels, 2 and 3 February 2013

Records Reten+on Basics for ESDs Texas State Associa+on of Fire and Emergency Districts (SAFE-D) Annual Conference Galveston, TX February 24, 2018

TNAU Weather so. Weather Database cum weather analysis so.ware

Transcription:

Objec(ves Designing a Social Network Prep for Lab 10 March 26, 2018 Sprenkle - CSCI111 1 Review What trends did we see in the names of students at W&L? Ø What was as you expected? Ø What surprised you? Why classes and objects? How do we create new data types? March 26, 2018 Sprenkle - CSCI111 2 1

Review: Card and Deck classes March 26, 2018 Sprenkle - CSCI111 3 DESIGNING CLASSES March 26, 2018 Sprenkle - CSCI111 4 2

Summary: Designing Classes What does the object/class represent? How to model/represent the class s data? Ø Instance variable Ø Data type What func)onality should objects of the class have? Ø How will others want to use the class? Ø Put into methods for others to call (API) General Class Design: nouns in a problem are classes/objects verbs are methods March 26, 2018 Sprenkle - CSCI111 5 Top-Down Design Break down larger problems into pieces that you can solve Smaller pieces: classes, methods, functions Implement smallest pieces and build up We ve been doing this most of the semester Ø Typically, program was 1) read input, 2) process input, 3) print result Started pu[ng Step 2 into >= 1 func(ons Steps 1 and 3 were some(mes a func(on Ø Now: on larger scale March 26, 2018 Sprenkle - CSCI111 6 3

Requirements for a Social Network Applica(on Reads social network from two files Ø One file contains people Ø One file contains connec(ons between people Add connec(ons between people Ø Symmetric rela(onship Provides a user interface to access/update a social network March 26, 2018 Sprenkle - CSCI111 7 Designing a Social Network Applica(on Break down into pieces What classes do we need? Ø What data needed to model those classes? Ø What func(onality do each of those classes need? What does our driver program (user interface) do? How should we implement those classes/ program? Recall: General Class Design: nouns in a problem are classes/objects verbs are methods March 26, 2018 Sprenkle - CSCI111 8 4

Designs For each of your classes Ø Data Ø API March 26, 2018 Sprenkle - CSCI111 9 Social Network Classes/Driver Data Person Ø Id Ø Name Ø Friends Driver (UI) Ø Social network Social Network Ø People in network What are the data types for each class s data? March 26, 2018 Sprenkle - CSCI111 10 5

SN Classes/Driver Func(onality Person Ø Gefers (accessors) Ø String rep Ø Sefers Social Network Ø Gefers Ø String rep Ø Add people to network Ø Add connec(ons Ø Wri(ng to a file Driver Ø Ge[ng user input to Read people, connec(ons files Store social network to file Add a person Add connec(ons Ø Summary: call appropriate methods on classes to do above How should we test these? March 26, 2018 Sprenkle - CSCI111 11 Lab 10 Design 3 files: person.py, social.py, facespace.py social.py SocialNetwork (test func(ons) facespace.py Driver Person (test func(ons) person.py Uses SocialNetwork object Gets command-line arguments Handles UI Calls methods on the SN object March 26, 2018 Sprenkle - CSCI111 12 6

Problem: People Files Given a people file that has the format <num_users> <user_id> <name> <user_id_n> <name_n> Write algorithm to create Person objects to represent each person, add to SocialNetwork object March 26, 2018 Sprenkle - CSCI111 13 Problem: Connec(on Files Given a connec(on file that has the format <user_id> <user_id> <user_id> <user_id> <user_id> <user_id> Each line represents a friend/connec(on Ø Symmetric rela(onship Ø Each is a friend of the other Update SocialNetwork object March 26, 2018 Sprenkle - CSCI111 14 7

UI Specifica(on Checks if user entered command-line arguments Ø Default files otherwise Read people, connec(ons from files Repeatedly gets selected op(ons from the user, un(l user quits Repeatedly prompts for new selec(on if invalid op(on Executes the appropriate code for the selec(on Stops when user quits Stores the social network into the file Write pseudocode March 26, 2018 Sprenkle - CSCI111 15 UI Pseudocode Use default files if only one command-line argument Read people, connec(ons from files while True: display menu op(ons prompt for selec(on while invalid op(on print error message prompt for selec(on break if selected quit otherwise, do selected op(on Store social network to designated file March 26, 2018 Sprenkle - CSCI111 16 8

Implementa(on Plan 1. Implement Person class Ø Test (write test func(ons, e.g., testperson()) 2. Implement SocialNetwork class Ø Example runs in lab write up Ø Note: Methods for classes will not prompt for input; Use input parameters Ø Test 3. Implement driver program March 26, 2018 Sprenkle - CSCI111 17 Plan for Implemen(ng a Class Write the constructor and string representa(on/ print methods first Write func(on to test them Ø See card.py and deck.py for example test func(ons While more methods to implement Ø Write method Ø Test Ø REMINDER: methods should not be using input func(on but ge[ng the input as parameters to the method March 26, 2018 Sprenkle - CSCI111 18 9

This Week Lab 10 Ø Use a class that was already defined Ø Define your own classes Broader Issue: Facebook March 26, 2018 Sprenkle - CSCI111 19 10