{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CSC 212 Assignment

CSC 212 Assignment - Design helps you decide what you are...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Kevin McDermott CSC 212 – Professor Early 9/23/07 Question 1: 2.7: What are parameters used for? Parameters are values that are passed into the method. The methods do different things based on what the parameters value. 3.1: How do you create objects? The object is the instance of a class, or it’s what the class is going to be doing. You can use the noun/verb technique and make objects for classes from whatever you want the method to do. Objects perform what’s in the classes. Example: Balance myBalance = new Balance(); 3.2: What is the difference between a class and an object? A class holds the object and the object performs the task within the class. Classes hold the plans for what you want to do with your information. 3.11: Is doSomething() a variable name or a method? How can you tell? doSomething is a method that tells someone or something to doSomething() literally. A variable in whatever method this is would be something like String Something;. 4.2: Why is design important?
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Design helps you decide what you are actually going to do instead of just jumping into something without having a basic idea of how you are going to solve your problem. Question 2: What is inheritance? Why is it used, and how is it accomplished in Java? Inheritance is what allows other classes to share common components. Allows sharing throughout the library of classes. Sort of like mixing different ingredients to make a dinner. It is used so that you don’t have to keep on creating the same code over and over again in all the classes. It’s accomplished in Java by adding “extends (class name) {“ after the class name. Question 3: Write a collection of class definitions that describe a hotel reservation system: Inheritance: System / \ Customer Front Desk Staff, Managers | | Room Room / \ / \ Availability Rates Occupied Cleaned Noun: system, customer, front desk staff. Managers, room. Verb: availability, rates, occupied, cleaned....
View Full Document

{[ snackBarMessage ]}

Page1 / 2

CSC 212 Assignment - Design helps you decide what you are...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon bookmark
Ask a homework question - tutors are online