Question

In: Computer Science

1. Which class category has static methods and constants, but no objects? A) Real-life entity abstraction...

1. Which class category has static methods and constants, but no objects?

A) Real-life entity abstraction B) Actor class C) Utility class D) Concept class

2. Which of the following would be an appropriate name for a game-related class?

A) CompletedLevelOne B) InitialLevel C) ResetCurrentLevel D) AscendToFinalLevel

3. A class (ClassOne) is considered to have a dependency on class (ClassTwo) under which of the following conditions?

A) Each class uses objects of the other. B) The public interfaces of both classes are cohesive.

C) ClassTwo uses objects of ClassOne. D) ClassOne uses objects of ClassTwo.

4. A UML class diagram would be most useful in visually illustrating which of the following?

A) the cohesiveness of a class’s interface. B) the amount of complexity of a class’s interface.

C) dependencies between classes. D) relationships between classes and their interfaces.

Solutions

Expert Solution

1.

Utility class category has static methods and constants, but no objects.

Utility class can't allow to do the instantiation.

Utility class found to be as stateless.

Utility class has static methods which are reused.

Option C

2.

InitialLevel an appropriate name for a game-related class.

Starting of the game execute a class which is an appropriate name for a game-related class.

Don't think about first, second, .. levels to include the name.

Option B

3.

A class (ClassOne) is considered to have a dependency on class (ClassTwo) under condition

ClassOne uses objects of ClassTwo

In this dependent class is ClassOne

ClassTwo contains the required data which is needed by the ClassOne.

The usage of one class by the other class done using the objects.

Option D

4.

A UML class diagram would be most useful in visually illustrating dependencies between classes.

Dependency relation is referred as relationship an element or the group of elements required by the other model.

In UML class diagram one class elements used by the other class for their, so one class is dependent and other class is supplier.

Option C


Related Solutions

JAVA programming- answer prompts as apart of one java assignment Static static variables static methods constants...
JAVA programming- answer prompts as apart of one java assignment Static static variables static methods constants Create a class Die representing a die to roll randomly. ☑ Give Die a public final static int FACES, representing how many faces all dice will have for this run of the program. ☑ In a static block, choose a value for FACES that is a randomly chosen from the options 4, 6, 8, 10, 12, and 20. ☑ Give Die an instance variable...
In Lab 4, you made a class with static methods. The static methods converted an integer...
In Lab 4, you made a class with static methods. The static methods converted an integer in binary, Hex, and Octal. To do this, you made a class of static methods. The class did not have any fields. The static methods received the integer value as a parameter. For this lab, make all of the static methods, non-static methods. Lab 5 Requirements Create a class named “Lab5_IntConv_Class Have one private field name intValue. Add two constructors: One is a default...
1: (Passing Objects to Methods) From the following UML Class Diagram, define the Circle class in...
1: (Passing Objects to Methods) From the following UML Class Diagram, define the Circle class in Java. Circle Circle Radius: double Circle() Circle(newRadius: double) getArea(): double setRadius(newRadius: double): void getRadius(): double After creating the Circle class, you should test this class from the main() method by passing objects of this class to a method “ public static void printAreas(Circle c, int times)” You should display the area of the circle object 5 times with different radii.
Write a class that has three overloaded static methods for calculating the areas of the following...
Write a class that has three overloaded static methods for calculating the areas of the following geometric shapes: - circles - rectangles - cylinders Here are the formulas for calculating the area of the shapes. Area of a circle: Area = π r2, where p is Math.PI and r is the circle's radius Area of a rectangle: Area = Width x Length Area of a cylinder: Area = π r2 h, where p is Math.PI, r is the radius of...
Write a class that has three overloaded static methods for calculating the areas of the following...
Write a class that has three overloaded static methods for calculating the areas of the following geometric shapes: - circles - rectangles - cylinders Here are the formulas for calculating the area of the shapes. Area of a circle: Area = π r2, where p is Math.PI and r is the circle's radius Area of a rectangle: Area = Width x Length Area of a cylinder: Area = π r2 h, where p is Math.PI, r is the radius of...
You shall implement six static methods in a class named BasicBioinformatics. Each of the methods will...
You shall implement six static methods in a class named BasicBioinformatics. Each of the methods will perform some analysis of data considered to be DNA. DNA shall be represented arrays of chars containing only the characters A, C, G and T. In addition to the six methods you will implement, six other methods exist in the class, which use Strings instead of char arrays to represent DNA. These other methods simply invoke the methods you are to implement, so all...
Design a Geometry class with the following methods: * A static method that accepts the radius...
Design a Geometry class with the following methods: * A static method that accepts the radius of a circle and returns the area of the circle. Use the following formula: Area=?r^2 * A static method that accepts the length and width of a rectangle and returns the area of the rectangle. Use the folliwng formula: Area = Length x Width * A static method that accepts the length of a triangle's base and the triangle's hight. The method should return...
Write a Java application, and an additional class to represent some real-world entity such as a...
Write a Java application, and an additional class to represent some real-world entity such as a technology item, an animal, a person, a vehicle, etc. Keep in mind that a class is a model in code of something real or imagined, which has attributes (member variables) and behaviors (member methods). The class will: Create a total of 5 member variables for the class, selecting the appropriate data types for each field. For example, a class to represent a lamp might...
Coding Java Assignment Write the following static methods. Assume they are all in the same class....
Coding Java Assignment Write the following static methods. Assume they are all in the same class. Assume the reference variable input for the Scanner class and any class-level variables mentioned are already declared. All other variables will have to be declared as local unless they are parameter variables. Use printf. A method that prompts for the customer’s name and returns it from the keyboard. A method called shippingInvoice() that prompts for an invoice number and stores it in a class...
Question 3 A java source module contains the following class with the static methods main and...
Question 3 A java source module contains the following class with the static methods main and procedure1, and the instance method procedure2 (assume given the bodies of procedure1 and procedure2): public class TestQuestion3             {                         static int result, num1 = 10;                         public static void Main( String [ ] args )                         {                                     int [ ] list1 =   { 2, 4, 6, 8, 10}, list2;                                     .    .    .                         }                         static void procedure1( void )                         {                                     .   .   .                         } void procedure2( void )...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT