New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here

Intro to Software Development

by: Miss Terry Reichel

Intro to Software Development CSSE 120

Miss Terry Reichel
GPA 3.52


Almost Ready


These notes were just uploaded, and will be ready to view shortly.

Purchase these notes here, or revisit this page.

Either way, we'll remind you when they're ready :)

Preview These Notes for FREE

Get a free preview of these Notes, just enter your email below.

Unlock Preview
Unlock Preview

Preview these materials now for free

Why put in your email? Get access to more of this material and other relevant free materials for your school

View Preview

About this Document

Class Notes
25 ?




Popular in Course

Popular in Computer Science and Engineering

This 18 page Class Notes was uploaded by Miss Terry Reichel on Monday October 19, 2015. The Class Notes belongs to CSSE 120 at Rose-Hulman Institute of Technology taught by Staff in Fall. Since its upload, it has received 22 views. For similar materials see /class/225105/csse-120-rose-hulman-institute-of-technology in Computer Science and Engineering at Rose-Hulman Institute of Technology.

Similar to CSSE 120 at RHIT

Popular in Computer Science and Engineering


Reviews for Intro to Software Development


Report this Material


What is Karma?


Karma is the currency of StudySoup.

You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 10/19/15
DEFINING CLASSES Review Using Obiec rs WIDTH 400 HEIGHT 50 RE PEATCOUNT 2 O PAUSELENGTH 025 win GraphWin Giants Win WIDTH HEIGHT p PointWIDTH2 HEIGHT2 t Textp NY Giants 2008 super Bowl Champs tsetStyle bold39 tdrawwin nextColorIsRed True tsetFill blue39 for i in rangeREPEATCOUNT sleepPAUSELENGTH if nextColorIsRed tsetFill39red39 else tsetFill blue39 nextColorIsRed not nextColorIsRed winclose Q1 Obiect Terminology ii Obiects are data types that i UML class diagram might be considered active They store information in instance variables They manipulate their data through methods ii Obiects are instances of some class ii Obiects are created by calling constructors Instance variables written here Methods written here QZ Key ConcepT III A class is an quotobiecT facToryquot Calling The constructor Tells The classes To make a new obiecT ParameTers To consTrucTor are like quotfacTory opTionsquot used To seT insTance variables III Or Think of class like a quotrubber sTampquot Calling The consTrucTor sTamps ouT a new obiecT shaped like The class ParameTers To consTrucTor quotfill in The blanksquot ThaT is They are used To iniTialize insTance variables Examples up Point200 100 at Textp Go Giantsl 200 200 100 100 39bock39 39black39 39bock39 39black39 This is c clone of p Creating Custom Obiects Definin Your Own Classes h III Custom obiects Hide complexity Q Provide another way to break problems into pieces a Make it easier to pass information around III Example Cards Decks and Hands Recall from BlackJack suits Clubs39 Diamonds Hearts 39Spades39 cardNames Ace Deuce 39339 39439 395 39639 39739 39839 39939 391039 39Jack3939Queen 39King Q34 Code To Define Cl Cldss named Card class Card quotquotquotThis class represents a card from a standard deckquotquotquot docstring describes Class used by hep function and by Eclipse help Code to Define a Class class Card quotquotquotThis cla selfsuitName represents a card f def initself ard suit selfcardName nga Special name init declares a constructor Special self parameter is the first formal parameter of each sui t method in a class Create instance variables just by assigning to them self always refers to the current object I 1 gt3 H N N A sample constructor coll c Card39Ace39 39Hearts39 Code To Define a Class class Card quotquotquotThis class represents a card from a standard deckquotquotquot def initself card suit selfcardName selfsuitName def getValuese quotquotquotReturns Aces alwayE to count ac pos cardk if pos lt 1C return return 10 self parameter again no other formal parameters card suit I docstring for method l the value of this card in BlackJack count as one so hands need to adjust es as 11quotquotquot amesindexselfcardName useselfltvarNamegttO read instance variable A sample method call pos 1 getValueO Q5 Code to Define 1 Class class Card quotquotquotThis class represents a card from a standard deckquotquotquot def def def initself card suit Self39 Caldeame Card Sample uses of str method selfsu1tName su1t print C n 39 n getValueself msg Card is strc quotquotquotReturns the value of this card in BlackJack Aces always count as one so hands need to adjust to count aces as 11quotquotquot pos cardNamesindeXselfcardName if pos lt 10 return pos 1 return 10 Special s tr method returns a string representation of an object str self return selfcardName quot of quot selfsuitName Stepping Through Some Code Sample use card Card 7 39Clubs class Card print cardgetValue quotquotquotThis class represents a card print card def initself card suit selfcardName card selfsuitName suit def getValueself quotquotquotReturns the value of this card in BlackJack Aces always count as one so hands need to adjust to count aces as 11quotquotquot pos cardNamesindeXselfcardName if pos lt 10 return pos 1 return 10 def str self return selfcardName quot of quot selfsuitName Review of Key ldeas II Constructor a Defined with special name init II Called like ClassName III Instance variables II Created when we assign to them n Live as long as the obiect lives I self formal parameter a lmplicitly get the value before the dot in the call at Allows an ob39ect to quottalk about itselfquot in a method I Another Example Lists of Ob39ec rs Lists in Ob39ec r t class CardCollection quotquotquotThis class represents a collection of cards either a single hand or the Whole deckquotquotquot def initself neWDeck False quotquotquotCreates a new 007 Ct Optional formal parameter can it39s emPtY but if new constructaCardCollection three ways COlleCtion is a fU11 St deck CardCollectionTrue selfname None hand CardCollectionFalse self ardLiSt hand CardCollection sel hideFirst True 39 newDeck Create an entire deck of cards for s in suits Inganceva abm for c in cardNames containing a list self insert Card c 5 Self call constructor calls another method of the CardCollection Class Another Example continued Lists of Ob39ects Lists in Ob39ect l class CardCollection I I I I I I def initself neWDeck False I I I I I 7 selfname None selfcardList selfhideFirst True if newDeck Create an entir for s in suits for c in car Names selfin ertCardC 5 insertrne mdLBeSappend method to mutate the list instance variable deck of cards def insertself card quotquotWAdds the given ard to this collectionquotquotquot selfcardListappendCard We can put objects into lists Why not iust use Cl list of cards class CardCollection def getValueself quotquotquotReturns the best score fbr this collection in the game of39BlackJackquotquotquot score O hasAce False for card in selfcardList val cardgetValueN CaHMgrneWDdSOH score val the objects stored in Iterating over the list 1f val 2 the list hasAce True if score lt winningScore 10 and hasAce score 10 return score 06 Encapsulation El Insulating the rest of a program from some details by quothidingquot them inside some structure Topdown design encapsulates operations inside functions Obiectoriented design encapsulates data and operations inside classes I Encapsulation is a form of abstraction ignoring irrelevant details Q79 Check It Out III Use Eclipse SVN Repository Exploring perspective a Go to your personal repository http svncs rosehulmclnedu reposcsse39l 20200920usemame D Checkout the BaIISim proiect III Switch back to the PyDev perspective 1 The blackiackWithClasses module in the Session 5 proiect will serve as a great example of defining closses That39s the Way the Ball Bounces El We39re going to begin working with defining classes by creating a simulation of an ideal gas I Like simulating billiard balls on a frictionless table a We hope this will be a straightforward and enioyable assignment I Begin by opening the instructions from ANGEL Lessons 9 Homework 9 Homework 15 I Try to get to step 4f in class GET HELP IF YOU GET STUCK


Buy Material

Are you sure you want to buy this material for

25 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

Why people love StudySoup

Bentley McCaw University of Florida

"I was shooting for a perfect 4.0 GPA this semester. Having StudySoup as a study aid was critical to helping me achieve my goal...and I nailed it!"

Kyle Maynard Purdue

"When you're taking detailed notes and trying to help everyone else out in the class, it really helps you learn and understand the I made $280 on my first study guide!"

Steve Martinelli UC Los Angeles

"There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

Parker Thompson 500 Startups

"It's a great way for students to improve their educational experience and it seemed like a product that everybody wants, so all the people participating are winning."

Become an Elite Notetaker and start selling your notes online!

Refund Policy


All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email


StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here:

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.