Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1 1.1) State whether the following statements are True or False. Write down the question number and the word True or False next to

Question 1

1.1) State whether the following statements are True or False. Write down the question number and the word True or False next to it. E.g.1.4 True

1.1.1 Objects enable reuse of software components.

1.1.2 A queue is a data structure that uses a LIFO data structure.

1.1.3 Composition is a relationship between two classes that is based on the aggregation relationship.

1.1.3 A direct access file is a type of file in which each data can be accessed sequentially.

1.1.4 The reserved word this can be used as a name for the calling object.

1.1.5 A constructor is a special kind of method used to initialize objects.

1.1.6 Constructors have return type void.

1.1.7The size of an array in Java is determined when the program is compiled.

1.1.8 The following statement creates an array of 20 elements: int[] array = {20};

1.1.9 A database is an efficient way to store, manipulate and retrieve large amounts of data.

1.1.10 To create an object of a class type, the word new is used.

1.1.11 The push operation removes the element at the top of the stack

1.2 Write a complete Java program called Queue1 for the following plan: (10)

Plan: 1.

Create a queue q1 2.

Add(3*4) 3.

Add(7+8) 4.

Remove() 5.

Add(6*7) 6.

Print Peek() 7.

Remove() 8.

Add((*3) 9.

Print queue

1.3 Write a complete Java program called Display that includes a String array called names[]. The array names[] must store 5 names and this should be output using a loop structure. (10)

1.4Create a Java class called Pen with the following variables: String type, String make and int size. The class should have a default constructor and an overloaded constructor which accepts the three parameters: type, make and size. Create a class called UsePen with a main method(). In the main method do the following:

Create an instance of class Pen p1 using the default constructor and populate the three variables with a type, make and size.

Create an instance of class Pen p2 using the overloaded constructor, passing it three parameters for type, ,make and size.

Show output for all constructors.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual Basic 4 Ole Database And Controls Superbible

Authors: Michael Hatmaker, C. Woody Butler, Ibrahim Malluf, Bill Potter

1st Edition

1571690077, 978-1571690074

More Books

Students also viewed these Databases questions

Question

Know what customers expect from the firm when they complain.

Answered: 1 week ago

Question

Understand why customers complain.

Answered: 1 week ago