×

### Let's log you in.

or

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

×

or

35

0

5

# Programming Fundamentals IT 108

Mason
GPA 3.61

Irene Bruno

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

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

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

×
Unlock Preview

COURSE
PROF.
Irene Bruno
TYPE
Class Notes
PAGES
5
WORDS
KARMA
25 ?

## Popular in Information technology

This 5 page Class Notes was uploaded by Adonis Nader on Monday September 28, 2015. The Class Notes belongs to IT 108 at George Mason University taught by Irene Bruno in Fall. Since its upload, it has received 35 views. For similar materials see /class/215221/it-108-george-mason-university in Information technology at George Mason University.

×

## Reviews for Programming Fundamentals

×

×

### What is Karma?

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

Date Created: 09/28/15
T108 April 9 2009 Problem Create an 00 solution to calculate the amount of fencing needed to surround a rectangular yard The minimum dimensions the company can handle is 500 feet 0 800800 64000 6 stops working correctly 0 What to limit any rectangle to 800 o Instance Variables 0 Gets its very own copy of everything in the class 0 Rectangle yard ew RectangleO Creates Instance yard and calls constructor Constructor Rectangle setLengthO getperimetero getLengthO getWidthO setenghtmtb 39e 39quot Validating setWidthintboolean Process 0 Activity involves of the values in one object in order to solve the problem 0 Anything that has multiple job is taken care of Rectangle Code item Last Class public class RectangleClassDef private int length private int width public int getLengthO return length public int getWidthO return width public void setLengthint l length l T108 April 9 2009 public void setWidth int w width w public int perimeter 0 return 2 length 2 width public int area 0 return length width assign it to it to Changes to Class Code class Rectangle private int length private int width public int getLength 0 return length I input from user public int getWidth 0 return width width dimension of valid rectangle public Boolean setLengthint L ifLgtoampampLltsoo G length L return true else return false public Boolean setWidthint w if wgt0ampampwlt800 width w return true else T108 April 9 2009 return false public length L public int perimeter 0 return 2 length 2 width public int area 0 return 2 length 2 public void setLengthint l length l public void setWidthint w width w Changes to Class Code import javaxswingJOptionPane public class Fence public static void main String args rectangle yard new Rectangle int yardLengt h yardWidt h do yardLength lntergerparaselntJOptionPaneshowlnputDialog Enter length of yard while lyardsetLengthyardLength yardWidth lntergerparaselntJOptionPaneshowlnputDialog Enter width of yard quot while lyardsetLengthyardWidth yardWidth lntergerparaselntJOptionPaneshowlnputDialog ERROR Enter width of yard quotD JOptionPaneshowMessageDialognull A yard with length yardgetLength feet and widthquot yardgetWidth feet requires quot feet requiresquot yardpermiter feet of fencing quot Changes to Class Code Create and Fill an Obie import javaxswingJOptionPane public class Fence public static void main String args Rectangle mWard input 0 JOptionPaneshowMessageDialognull A yard with length yardgetLength feet and widthquot yardgetWidth feet requires quot feet requiresquot yardpermiter feet of fencing April 2 2009 0 0 solulion l Wholislne problem 2 Wholislne Objecl Procedural Info oul 3 Objecl ChOlT relurn vcrlue ccesslgel implemenlcrlion gequmeso Soccer Lecrue l lnpul info M Soccerjcrvcr Pl 0 l Dolor in one objecl 9 clossdefincrlion Access from objecl Oulpul home and slcrls lnformcrlion in orcrmeler Mucrlcrlorlseln Creole objecl lnpul leomNcrme lnpul inlo Objecl Tecrmjcrvcr o Dolo i Will be unique for each objecl l lnslonce vorioble b Melnods 39 Access Mulolor Conslruclor iv Speciol purpose Speciol Purpose 1 Operolion inslonce dolo lt April 2 2009 public class Team private String name private int won private int lost public String Mistakel return name public int getWon public void setNameString name return won name name public int getLost return lost Problem is one variable is representing public void setNameString n for two things name n Same name cant do both public void setWon int W Local over rides it you get a team won W without a name public void setLost int I lost l Public int stats return 100 won won lost Creates Teamname myTeam Falcons Public class soccer Public static void main String args Team myTeam newTeam Team another newTeam teamName JOption PaneSnowlnputDialog Namez

×

×

### BOOM! Enjoy Your Free Notes!

×

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!"

Allison Fischer University of Alabama

#### "I signed up to be an Elite Notetaker with 2 of my sorority sisters this semester. We just posted our notes weekly and were each making over \$600 per month. I LOVE StudySoup!"

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

#### STUDYSOUP CANCELLATION 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 support@studysoup.com

#### STUDYSOUP REFUND POLICY

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: support@studysoup.com

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 support@studysoup.com