CH 3

Chapter 2

Chapter 2 Questions

2.2 The value returned is zero
2.6  public student TicketMachine
{
}
public LabClass TicketMachine
{
}
2.9 Fields: private int price; private int balance;  private int total
private int total;
Constructors: * Create a machine that issues tickets of the given price.
* Note that the price must be greater than zero, and there
* are no checks to ensure this.
Methods: price = ticketCost;
balance = 0;
total = 0;
2.10 No, the constructors are very similar to the methods of the class.
2.11 int, string, string
2.12 boolean alive, person tutor, Game game
2.15 private int status
2.16 student class
2.17 two parameters; types: string and double
2.18 private int Book
2.19 public Pet(string petsName)
{
private string name;
name=petsName;
}
2.20 take away the int before price
2.21 there is no difference besides the balance and price parts
2.22 What is the current balance?
2.24 The get methods of a ticket machine perform similar tasks-returning the value of one of their object's fields
2.26 get price returns data while the printTicket prints information
2.27 They do not have return statements because one stores money and the other displays it
2.29 You can tell because it says void
2.31 return price+increase;
2.32 return price-discount;
2.35: They show two different outputs because the costs are different.
2.36: It would print out just price, not the user inputted price..
2.37: It would probably come up with an error, because cents is not defined.
2.38: No, because one doesn’t display the price, and the other has an error.
2.44: nothing is going to change because zero is positive.
2.45: it controls the size of the circles and the intergers associated with it.
2.47: yes it could be set to negative
2.49: price * discount = saving;
2.50: total / count = mean;
2.51: if ( price>budget)
{
comment = “Topo expensive.”;
}
else
{
comment = “Just right.”;
}
2.52: if ( price>budget)
{
comment = “Topo expensive.”;
}
else
{
comment = “Please enter the correct amount:” price;
}
2.53: because it is returning the balance after it clears it.
2.54: because you are returning the balance and then instantly clearing it, so your actualy balance shown will not be correct.
2.55: it is both
2.59: the name is getCode and the return is code
2.60: the name is setCredits and the parameter is creditValue
2.62: allows the input of characters to spell out a name, allows the input of numbers to write an age, allows the input of characters to write out a code, allows the input of numbers to shows credits
2.65: public int getAge()
2.68: public class printDetails
{
private String name;
name = setName;
comment = “The name of this person is:” name;
}
2.74: 102, catfish, cat9, 12cat, cat12

Chapter 1 Part2

Chapter 1 Part 1

Chapter 1 Definitions

object-  Java object model objects from a problem domain

class- objects are created from classes. The class describes the kind of object; the objects represent individual instantiations of the class.

instance- An object of a particular class. In programs written in the Java programming language, an instance of a class is created using the new operator followed by the class name.

method- We can communicate with objects by invoking methods of them. Objects usually do something if we invoke a method.

signature- The header of a method is called its signature. It provides information needed to invoke that method

parameter- Methods can have parameters to provide additional information for a task.

type- Parameters have types. The type defines what kind of values a parameter can take.

state- Objects have state. The state is represented by storing values in fields.

source code- The source code of a class determines the structure and the behavior (the fields and methods) of each of the objects in that class.

return value- A Java keyword used to finish the execution of a method. It can be followed by a value required by the method definition.

compiler- A program to translate source code into code to be executed by a computer. The Java compiler translates source code written in the Java programming language into bytecode for the Java virtual machine.

ScreenFlow

Podcast Script

Introduction: You are listening to Matt’s podcast and I am your host Matt Pinizzotto.

Program Overview: Today I will talk about Gang activity and how it is harmful to society. I will also get into the specifics of gangs and how they operate.

Program Script:

Podcast

Outline: Gangs

a. Origin/History: There are four kinds of gangs which were predecessors of the street gangs of today. 1. Secret Societies; 2. Gangs of Outlaws in the Wild West; 3.Racist gangs like the Klu Klux Klan; and 4. “Voting Gangs” tied mainly to the Democratic Party in large cities. The “Father of Gang Research,” Frederic Thrasher, gave the word its industrial-era meaning in the 1920s and made “gang” into a term which meant kids of the street. Gangs have become a permanent feature of the urban landscape around the world. A gang is typically defined as an unsupervised lower-class peer group, with leadership, structure, and adherence to a local territory.

b. Controversy in the Topic: Social scientists have differed on whether or not gangs necessarily exhibit criminal and delinquent activity. Some hold that gangs are fundamentally the product of delinquent subcultures; others believe gangs are a response to social disorganization. The United States’ National Youth Gang Center reports there are about 25,000 gangs in the United States, with nearly three quarters of a million members.

c. Impact on society: The chief problem in any community cursed with crime is not the punishment of the criminals, but the preventing of the young from being trained to crime. For as long as there have been inhabitants on this earth, gangs and criminal behavior have been in existence plaguing our society until this very day.

d. My thoughts: I feel that gangs are a big burden to society. They ruin the lives of citizens because teens are brought into the gangs at young ages and never do anything positive with their lives. Gangs are a constant worry for innocent citizens living near gang territory. Innocent lives are also lost from gang activity.

Follow

Get every new post delivered to your Inbox.