Java program In yourLastNameArena.java: 1. define: 1 static variable: yourLastNameSlogan(string) 4 private instance variables: ArenaID(int),capacity(int),size(int),shape(String) 2. Defind following methods: getLTD(): return the last two digits of the ArenaID as an integer;  getLTC(): return the last two characters of the value in variable yourLastNameSlogan as a String. getShape(): return the shape of the Arena. We assume that each character is associated with a weight based on their position in the alphabet table. The weight of ‘a’ is 1, the weight of ‘b’ is 2, the weight of ‘c’ is 3, so on and so forth, the weight of ‘y’ is 25 and the weight of ‘z’ is 26. For example, if the result of getLTC() is “ab”, then the weight of “ab” is 3. Based on the above information, if the weight of the getLTC() is less or equal to 26, the getShape() method will return “Circle”; otherwise, return “Square”. Constructors:  Default constructor: set yourLAstNameSlogan as "yourLastName works!"; set capacity as 50, set ArenaId as 2222, set size as 20, and set shape properly Constructor with inputs: capacity, size and ArenaID; set yourLastNameSlogan as "yourFirstName works!"; this constructor should initialize all instance variables properly. arenaType(): return a String based on the Capacity of the Arena. If the capacity is less than or equal to 4000, return “Small”; if the capacity is larger than 4000 but less than or equal to 7000 return “Medium”; else return “Large”. arenaArea(): return the area value (a double) based on the shape of the Arena. Assume that the size is the Arena radius if shape is circle, otherwise size is the side length if the shape is square.  crowdLevel(…): the parameter of this method is an integer indicating the number of people in the Arena now, while the return of this method is a double  x/Area(), where x is the parameter (i.e., the number of people in the Arena now). Make sure to check if x is under the Arena capacity. Show warning messages if x is over the Arena capacity.  showArenaSeatingDiagram (): this method uses while-loop to create a triangle; The letter to print at each position is 1; the length and height of the triangle are the number of letters in the instance variable of yourLastNameSlogan. For example, for “M Jordan”, if yourLastNameSlogan is “M work” this will print out: 222222 22222 2222 222 22 2

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Java program

In yourLastNameArena.java:

1. define:

  • 1 static variable: yourLastNameSlogan(string)
  • 4 private instance variables: ArenaID(int),capacity(int),size(int),shape(String)

2. Defind following methods:

  • getLTD(): return the last two digits of the ArenaID as an integer;  getLTC(): return the last two characters of the value in variable yourLastNameSlogan as a String.
  • getShape(): return the shape of the Arena. We assume that each character is associated with a weight based on their position in the alphabet table. The weight of ‘a’ is 1, the weight of ‘b’ is 2, the weight of ‘c’ is 3, so on and so forth, the weight of ‘y’ is 25 and the weight of ‘z’ is 26. For example, if the result of getLTC() is “ab”, then the weight of “ab” is 3. Based on the above information, if the weight of the getLTC() is less or equal to 26, the getShape() method will return “Circle”; otherwise, return “Square”.
  • Constructors: 
    • Default constructor: set yourLAstNameSlogan as "yourLastName works!"; set capacity as 50, set ArenaId as 2222, set size as 20, and set shape properly
    • Constructor with inputs: capacity, size and ArenaID; set yourLastNameSlogan as "yourFirstName works!"; this constructor should initialize all instance variables properly.
  • arenaType(): return a String based on the Capacity of the Arena. If the capacity is less than or equal to 4000, return “Small”; if the capacity is larger than 4000 but less than or equal to 7000 return “Medium”; else return “Large”.
  • arenaArea(): return the area value (a double) based on the shape of the Arena. Assume that the size is the Arena radius if shape is circle, otherwise size is the side length if the shape is square. 
  • crowdLevel(…): the parameter of this method is an integer indicating the number of people in the Arena now, while the return of this method is a double  x/Area(), where x is the parameter (i.e., the number of people in the Arena now). Make sure to check if x is under the Arena capacity. Show warning messages if x is over the Arena capacity. 
  • showArenaSeatingDiagram (): this method uses while-loop to create a triangle; The letter to print at each position is 1; the length and height of the triangle are the number of letters in the instance variable of yourLastNameSlogan. For example, for “M Jordan”, if yourLastNameSlogan is “M work” this will print out:

    222222

    22222

    2222

    222

    22

    2

In yourFirstNameOrganization.java:

1. in the main method:

  • do the following operations:
    • Create an array of YourLastNameArena object and each object has a capacity of a random capacity a random number between 0 and 7000; the array length should be 25. For each object in the array, make sure that the ArenaID is set as: 1234 + index_of_the_object_in_the array while the size is 50.
    • Find the Arena object with the smallest capacity; call its showArenaSeatingDiagram() and crowdLevel(4000).
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY