Define a subclass of tournaments called collegegames

Assignment Help JAVA Programming
Reference no: EM131041635

True or False Questions: Please answer the following questions either "true" or "false If, our answer is false, correct the statement so that it is true.

1. A class is a container for holding static member variables and methods. A class is also used like a blueprint to construct objects.

2. While there may be many objects constructed from a class, there can be only one of each type of class.

3. A variable can hold only a reference to an object. By reference, we mean the memory address where the object is located.

4. A constructor cannot have the same name as the class in which it is defined.

5. The word create is used to construct objects, as in the following example:

ClassType myObject = create ClassType();

6. A constructor has a return type.

7. Many constructors can be defined for the same class, as long as their signatures are different from one another.

8. It is legal to use a non-static member variable in a static method, but it is not legal to use a static member variable in a non-static method.

9. An object knows to which class it actually belongs because information about the actual class of the object is stored as part of the object's construction.

10. The word extends is used to create subclasses.

11. A class can have many immediate/direct superclasses.

12. A variable that can hold a reference to an object from class A can also hold a reference to an object from any subclass of class A.

Questions 13 through 23 relate to the class defined in Problem 13.

13. A tournament organizing company wants to automate parts of its database. As part of its software, a Tournaments class has been created. For the following class definition, indicate which member variables and methods belong to the class and which belong to objects constructed from the class.

class Tournaments (
private static int numBasketball; private static int numVollcyball; public String eventNamc;
public int numGames;
public String monthHcld;
// constructors would go here
public static int getNumBasketballa {
return numBasketball;
}
public static int getNumVollcyball() ) { return numVolleyball; 'a
public String idLevel0fPlay () {
String x null;
return x;
}
}

14. Suppose that a subclass of Tournaments is defined.

a. Can it include additional member variables that are not included in the superclass Tournaments?

b. Can it exclude any of the member variables that are included in Tournaments?

c. Can it include additional member methods that are not included in Tournaments?

d. Can it modify any of the member methods that are included in Tournaments%

15. Write the definition for a default constructor for the class Tournaments. The constructor should initialize the variable eventName to "Mid-West Regional Basketball", numGames to 15, and monthHeld to "March", respectively. Include means for updating any state variables that need to be updated.

16. Write the definition for a constructor for the class Tournaments, whereby the variables eventName and numGames are initialized according two parameters, eventName and numGames, respectively. Again, include menus for updating any stale variables that need to be updated. To do so, use a third parameter to distinguish whether an event is basketball or volleyball, so Maybe state variables are correctly updated.

17. What is the value to which monthlield is initialized in (16) above?

18. Call the default constructor in Problem 15 to construct a type Tournaments object called event 1.

19. Call the constructor with parameters in Problem 16 to construct a type
Tournaments object called event2. The event name should be "State H.S. Women's Volleyball", and the number of games (matches in this case) should be 31.

20. Construct an array of type Tournaments objects. The array should have 4 elements. Use the default constructor.

21. Define a subclass of Tournaments called CollegeGames. The subclass should include an additional member having type String and visibility public. The name of the member variable will be "sponsor". Modify idLevel0fPlay so that the second line in the method reads as follows:
Sting x "CollegeGames";

22. Suppose that another subclass of Tournaments is called HighSchoolGames. Suppose that a type CollegeGames object and a type HighSchoolGames object have been constructed. If the first object is called collegel and the second object is called
hsl, construct an array that can hold both of these objects. Store the objects in the array, using a means that you have learned.

23. Using array notation, how would you print the name of the subclass from which each element in the array arose'?

24. What will the following print?

Int[] myArray an new int[3];
for (int i = 0; i < myArray.length; ++i) { myArray[i] = i +3;
int x = 5;
myFunction (myArray, x );
System.outprintin (myArray[1]);
System.out.println (x);
myFunction ( myArray, x );
System.out.println(myArray[1])
System.out.println(x);
if myFunction is defined to be as follows?
public static void myFunction(inta al, int xi) ( a1[1]+= 1;
xl += 2;
}

25. List all the different ways that you can extract information from a function. One is print statements to standard out (your monitor) or a file. There are at least three others.

Reference no: EM131041635

Questions Cloud

Convert the following string to uppercase : -Write two assembly language programs one using regular instructions (not string instructions) and one using string instructions. The program should copy the string in problem-1 to another location and then compare the original and copied string t..
Customer service responsbilities of natural gas : An important part of the customer service responsbilities of a natural gas utility company concerns the speed with which calls relating to no heat in a house can be serviced. Suppose that one service variable of importance refers to whether or not th..
Using knowledge management and business intelligence : Using knowledge management and business intelligence, you will explore the opportunities for this level of IS support at Dirt Bikes USA. Your memo for this assignment will focus on identifying the knowledge assets, knowledge needs, and knowledge mana..
Estimate of the maximum value of the kidman properties : FINA3324 Assignment 2016. Provide your estimate of the maximum value of the Kidman properties that DomaCom should pay. The maximum price is the price at which you think an investment via DomaCom's crowdfunding campaign is not worthwhile
Define a subclass of tournaments called collegegames : Define a subclass of Tournaments called CollegeGames. The subclass should include an additional member having type String and visibility public.
Key changes and their evidence : Watch "The English Language Arts Standards: Key Changes and their Evidence" and "The Mathematics Standards: Key Changes and Their Evidence."
Develop a program that accepts the car registration : Develop a program that accepts the car registration
Calculate the average wait time : Assume that a hospital has a single-phase, multiple-channel waiting line. There are two employees, and new patients arrive at the rate of approximately 40 patients per hour. Calculate the average wait time.
Absent an applicable routine use : Beauregard is a high level employee of the Department of State. Recently, he has been using official travel for trips to a number of locations around the world, where, coincidentally, there are beautiful beaches, including Rio de Janeiro, Tahiti, St...

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd