Java Programming
Java Programming
9th Edition
ISBN: 9780357616635
Author: Joyce Farrell
Publisher: CENGAGE L
Question
Book Icon
Chapter 4, Problem 5PE
Program Plan Intro

a.

Display the school name, sport name and team name

Program plan:

Filename: “Team.java”

  • Define the “Team” class.
    • Declare the required variables.
    • Define the parameterized constructor.
      • Set the values.
    • Define “getSchoolName” method
      • Return the school name.
    • Define “getSportName” method
      • Return the sport name.
    • Define “getTeamName” method
      • Return the team name.

Filename: “TestTeam.java”

  • Define the “TestTeam” class.
    • Define the main method.
      • Create the objects for “Team” class with different parameters.
      • Display the results.

Program Plan Intro

b.

Display the game details

Program plan:

Filename: “Team.java”

  • Define the “Team” class.
    • Declare the required variables.
    • Define the parameterized constructor.
      • Set the values.
    • Define “getSchoolName” method
      • Return the school name.
    • Define “getSportName” method
      • Return the sport name.
    • Define “getTeamName” method
      • Return the team name.

Filename: “Game.java”

  • Define the “Game” class.
    • Declare the required variables.
    • Define the parameterized constructor.
      • Set the values.

Filename: “TestTeam.java”

  • Define the “TestTeam” class.
    • Define the main method.
      • Create the objects for “Team” class with different parameters.
      • Create an object for “Game” class.
      • Display the results.

Blurred answer
Students have asked these similar questions
In 32-bit MSAM, You were given the following negative array. write a program that converts each array element to its positive representation. Then add all these array elements and assign them to the dl register. .data    myarr sbyte -5, -6, -7, -4.code     ; Write the rest of the program and paste the fully working code in the space below.   the dl register should have the value 22 after summing up all elements in the array.
Microprocessor 8085 Lab Experiment Experiment No. 3 Logical Instructions Write programs with effects 1. B=(2Dh XOR D/2) - (E AND 2Eh+1) when E=53, D=1Dh 2. HL= (BC+HL) XOR DE (use register pair when necessary), when BC=247, HL 516, DE 12Ach 3. Reset bits 1,4,6 of A and set bits 3,5 when A=03BH Write all as table (address line.hexacode,opcede,operant.comment with flags)
In 32-bit MASM, Assume your grocery store sells three types of fruits. Apples, Oranges, and Mangos. Following are the sale numbers for the week (7 days).dataapples   dword 42, 47, 52, 63, 74, 34, 73oranges dword 78, 53, 86, 26, 46, 51, 60mangos dword 30, 39, 41, 70, 75, 84, 29Using a single LOOP instruction, write a program to add elements in all these three arrays. Then assign the total result into the eax register. The eax register should have the value 1153 after a successful execution.
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning