
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
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

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images

Knowledge Booster
Similar questions
- Write a Java class named PhoneRecord.java that performs the following functions: The class should contain the following data attributes and methods: private String name - The customer's name private String number - The customer's phone number public PhoneRecord(String personName, String phoneNumber) - Constructor get/set Methods - For each data attribute public String toString( ) - Special method to be used when printing a phoneRecord object Thank you so much for your help. Trying to write this class has really been stumping me.arrow_forwardIn python and include doctring: First, write a class named Movie that has four data members: title, genre, director, and year. It should have: an init method that takes as arguments the title, genre, director, and year (in that order) and assigns them to the data members. The year is an integer and the others are strings. get methods for each of the data members (get_title, get_genre, get_director, and get_year). Next write a class named StreamingService that has two data members: name and catalog. the catalog is a dictionary of Movies, with the titles as the keys and the Movie objects as the corresponding values (you can assume there aren't any Movies with the same title). The StreamingService class should have: an init method that takes the name as an argument, and assigns it to the name data member. The catalog data member should be initialized to an empty dictionary. get methods for each of the data members (get_name and get_catalog). a method named add_movie that takes a Movie…arrow_forwardin C# i need to Create an application named TurningDemo that creates instances of four classes: Page, Corner, Pancake, and Leaf. Create an interface named ITurnable that contains a single method named Turn(). The classes named Page, Corner, Pancake, and Leaf implement ITurnable. Create each class’s Turn() method to display an appropriate message. For example: The Page’s Turn() method should display You turn a page in a book. The Corner’s Turn() method should display You turn corners to go around the block. The Pancake's Turn() method should display You turn a pancake when it's done on one side. The Leaf's Turn() method should display A leaf turns colors in the fall.arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY

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 Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science

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
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education

Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY