Preview

JAVA LESSON 6

Better Essays
Open Document
Open Document
1293 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
JAVA LESSON 6
6: Design, Debugging,

Interfaces

6.092: Introduction to Java

Assignment 5: main()
Programs start at a main() method, but many classes can have main() public class SimpleDraw {
/* ... stuff ... */ public static void main(String args[]) {
SimpleDraw content = new SimpleDraw(new DrawGraphics());
/* ... more stuff ... */
}
}

Assignment 5: main()

Programs start at a main() method, but many classes can have main() public class SimpleDraw {
/* ... stuff ... */ public static void main(String args[]) {
SimpleDraw content = new SimpleDraw(new DrawGraphics());
/* ... more stuff ... */
}
}

public class DrawGraphics {
BouncingBox box; public DrawGraphics() { box = new BouncingBox(200, 50, Color.RED);
}
public void draw(Graphics surface) {

surface.drawLine(50, 50, 250, 250);

box.draw(surface);

}
}

public class DrawGraphics {
BouncingBox box; // a field or member variable public DrawGraphics() { box = new BouncingBox(200, 50, Color.RED);
}
public void draw(Graphics surface) {

surface.drawLine(50, 50, 250, 250);

box.draw(surface);

}
}

public class DrawGraphics {
BouncingBox box; public DrawGraphics() { // constructor box = new BouncingBox(200, 50, Color.RED);
}
public void draw(Graphics surface) {

surface.drawLine(50, 50, 250, 250);

box.draw(surface);

}
}

public class DrawGraphics { public void draw(Graphics surface) { surface.drawLine(50, 50, 250, 250); box.draw(surface); surface.fillRect (150, 100, 25, 40); surface.fillOval (40, 40, 25, 10); surface.setColor (Color.YELLOW); surface.drawString ("Mr. And Mrs. Smith", 200, 10);
}
}

public class DrawGraphics {
ArrayList boxes = new ArrayList(); public DrawGraphics() {

boxes.add(new BouncingBox(200, 50, Color.RED));

boxes.add(new BouncingBox(10, 10, Color.BLUE));

boxes.add(new BouncingBox(100, 100, Color.GREEN));

boxes.get(0).setMovementVector(1, 0);

boxes.get(1).setMovementVector(-3, -2);

You May Also Find These Documents Helpful

  • Satisfactory Essays

    Nt1310 Unit 3 Lab Report

    • 665 Words
    • 3 Pages

    The ping pong balls stack on top of one another in a three dimensional mode.…

    • 665 Words
    • 3 Pages
    Satisfactory Essays
  • Powerful Essays

    JCT2 Task 1

    • 1659 Words
    • 8 Pages

    Supply Chain (JCT2) Task 1 Business Fundamentals Simulation Review A. Documents From Simulation Cumulative industry results for last four quarters ending in quarter: 4 Minimum Maximum Average Mr. Matts Machines Total Overall 0.00 749.39 11.82 1.75 Financial Performance -73.50 211.50 9.41 6.46 Market Performance 0.00 0.65 0.11 0.44 Marketing Effectiveness 0.00 0.82 0.24 0.67 Investment in Future 0.00 468.30 1.22 1.71 Wealth -2.12 5.21 0.47 0.93 Human Resource Management 0.00 0.82 0.25 0.77 Asset Management 0.00 2.63 0.38 0.78 Manufacturing Productivity 0.00 1.00 0.25 1.00 Financial Risk 0.00 1.00 0.32 0.95 Income Statement Quarter 1 Quarter 2 Quarter 3 Quarter 4 Gross Profit Revenues 0 1,643,600 3,600,500 4,298,600 - Rebates 0 48,700 101,800 123,000 - Cost of Goods Sold 0 1,237,849 2,174,294 2,500,626 =…

    • 1659 Words
    • 8 Pages
    Powerful Essays
  • Better Essays

    Jdt2 Task 1

    • 1786 Words
    • 8 Pages

    | Per your request to investigate and recommend Toy Company’s position regarding Claim #1-2013; this report was generated. The initial research has been finalized and recommendations determined. I will refer to the claim by its number #1-2013 and the claimant as AA23 to keep the confidentiality of the claimant. First this report will provide a summary of the claim and the history associated with it. Second it will discuss the definition of Constructive Discharge and its relevance to this claim. Third it will provide the specific areas under the Title VII of the Civil Rights Act of 1964. Fourth it will offer recommendations and supporting legal references. Fifth it will recommend proactive steps to avoid future legal issues in relationship to the Title VII of the Civil Rights Act of 1964. And finally any references used in this research will be provided. A. Definition of Constructive DischargeSummary of Claim and history:In January 1, 2013 a new policy was implemented to support exponential company growth. This policy impacted all production employees. The impacted employees were notified of the changes two months in advance of the January 2013 implementation to allow for assimilation and training on the new shifts schedules and there impacts. Production employee schedules were shifted from a Monday through Friday schedule, 8 hour shift to a Monday through Sunday schedule, 12 hour shift, four working days can occur any day of the week. This schedule requires all production employees to work on holy days regardless of religious affiliation as the production now runs seven days a week.Office staff members were not impacted by this policy change.AA23 quit on January 2, 2013 after new policy was in effect.…

    • 1786 Words
    • 8 Pages
    Better Essays
  • Powerful Essays

    Student will learn how to write Java programs to perform simple calculations, they will use Scanner class to obtain input from the console, they will know how to use identifiers to name variables, constants, methods, and classes. The use of constants , Java primitive…

    • 2338 Words
    • 10 Pages
    Powerful Essays
  • Powerful Essays

    Comp3652 Unit 2 Assignment

    • 1090 Words
    • 5 Pages

    routines, nor to create your own classes to manage the drawing of shapes to the screen.…

    • 1090 Words
    • 5 Pages
    Powerful Essays
  • Good Essays

    JDT2 Task 3

    • 2402 Words
    • 8 Pages

    Higher employee satisfaction – When an appraisal is exquisitely prepared and well delivered employees are prone to respond better to the feedback presented. The employees also come away from the meeting with a clear understanding of their performance and where improvement is needed. They will also have good understanding of the company’s goals both for itself and for the employee themselves.…

    • 2402 Words
    • 8 Pages
    Good Essays
  • Better Essays

    JNT2 Task 1

    • 1417 Words
    • 6 Pages

    The City of Houston currently finds itself in quite a quandary. With a looming budget deficit of nearly $142 million dollars, city leaders have asked employees to begin to re-engineer work processes, cut costs wherever possible and eliminate unnecessary spending. While departments have all been mandated to cut 1% of their total budget for the next fiscal year, there still lies the issue of employees streamlining their work processes in order to eliminate any unnecessary waste.…

    • 1417 Words
    • 6 Pages
    Better Essays
  • Better Essays

    JOT2 Task 1

    • 839 Words
    • 4 Pages

    I recently left a position at a small Early Childhood Education center in the city of Pittsburgh, Pennsylvania. The school consisted of children ranging in age of 6 weeks to 6 years. I worked there for eleven years in a variety of age groups. Most of my experience was in Preschool, with children who were three and four years old. The school was located in Point Park University located in the heart of downtown Pittsburgh, in one of the University’s dorm buildings and took up two floors. Each classroom was between three and four dorm rooms combined in size. The rooms were long and narrow with partial walls knocked down and converted into doorways between the rooms. Because of the classrooms being converted from individual dorm rooms to single classrooms, there were many blind spots in the room. There for, each classroom had at least two teachers spread out among the room to be able to see every child and what they were doing at all times. It was very rare that there were only two teachers per class. Many times, the classroom had two teachers, and students from the university enrolled in a work study program helping to work with fifteen to twenty students.…

    • 839 Words
    • 4 Pages
    Better Essays
  • Good Essays

    JNT2 Task 1 1

    • 787 Words
    • 4 Pages

    Discussion of Data Collection Instruments Used: If students can identify letter names and sounds, why can they not successfully identify beginning, middle and ending sounds of any given word? How many students are below benchmark standards? Is district-wide sponsored curriculum supporting benchmark testing standards? Are additional interventions necessary?…

    • 787 Words
    • 4 Pages
    Good Essays
  • Powerful Essays

    JNT2 Task 1 Needs Analysis

    • 2841 Words
    • 19 Pages

    Many students who struggle with reading ask why should we read, what is the point? The point is that being able to read opens you up a whole new world of knowledge and imagination. But to have that new world opened up you need to be able to comprehend what you are reading. The primary goal of reading is to determine the meaning of what the writer is communicating and make the most of that information. That’s why reading comprehension skills are so important. Without them the reader cannot gather any information and use it to efficiently function and enjoy the richness of life (Marshall).…

    • 2841 Words
    • 19 Pages
    Powerful Essays
  • Good Essays

    The triumph of love over death and destruction is at once an inspiring and timeless theme. This theme is thoroughly examined in both Khaled Hosseini’s A Thousand Splendid Suns and Sarah Gruen’s Water for Elephants. Despite their subtle differences in writing style, both novels have protagonists who undergo similar experiences and have similar settings.…

    • 1019 Words
    • 5 Pages
    Good Essays
  • Better Essays

    Psychoanalytic theory was developed by Sigmend Freud. It is a system in which unconscious motivations are considered to shape normal and abnormal personality development and behavior. Psychoanalysis is commonly used to treat depression and anxiety disorders. Freud’s Psychosexual Theory of Development explains that if there was a conflict in a stage and not resolved that person would be fixated. Carl Jung’s Analytic Psychology is according to the mind or psyche. Alfred Alder’s Individual Psychology is the importance of each person’s perceived niche in society.…

    • 1122 Words
    • 5 Pages
    Better Essays
  • Better Essays

    JNT2 Task 1

    • 2089 Words
    • 9 Pages

    Much like the runways of Paris with its changing fashion trends, the world of education follows trends as well. Educators cringe when they hear “No Child Left Behind” some ten years beyond its advent. Now, the phrases “Common Core” and “Student Learning Objectives” have teachers seeing red.…

    • 2089 Words
    • 9 Pages
    Better Essays
  • Powerful Essays

    It 210 Weeks

    • 2760 Words
    • 12 Pages

    This course provides students with a basic understanding of programming practices. Concepts covered include flowcharting, pseudocode methodologies, and an understanding of programming practices. Students will learn how these concepts, when properly applied, improve program design.…

    • 2760 Words
    • 12 Pages
    Powerful Essays
  • Powerful Essays

    U.S.A's Fast Food Industry

    • 1330 Words
    • 6 Pages

    Fast food restaurants represent one of the largest segments of the food industry with over 200,000 restaurants and $120 billion in sales in the U.S. alone. Fast food restaurants, also known as quick service restaurants, are noted for their short food preparation time. Some of the largest players in this category include international giants like McDonald 's and Yum! Brands, national chains such as Wendy 's and Burger King and regional players like Jack In The Box and Sonic. Firms within the fast food industry fall under the market structure of perfect competition. Market structure is a classification system for the key traits of a market. The characteristics of perfect competition include: large number of buyers and sellers, easy entry to and exit from the market, homogeneous products, and the firm is the price taker. Many fast food franchises fit all or most of these characteristics. Competition within the industry as well as market supply and demand conditions set the price of products sold. For example, when Wendy 's introduced its $.99 value menu, several other companies implemented the same type of changes to their menu. The demand for items on Wendy 's value menu was so high because they were offering the same products as always, but at a discounted price. This change in market demand basically forced Wendy 's competition to lower prices of items on their menu, in order to maintain their share of the market. The previous example illustrates the elasticity of the fast food industry. Supply and demand set the equilibrium price for goods offered by franchises within the industry. Competitors of Wendy 's must accept the prices established by the consumer demand for the value menu. If consumers didn 't respond so positively to Wendy 's changes, other firms wouldn 't have had to adjust prices. On the flip side of this concept, there is no need for franchises to further…

    • 1330 Words
    • 6 Pages
    Powerful Essays