Implement an application (a system) of any abstract data type (stack, tree, graph, hashing) using Java as programming language. Some of the examples are the following:
• Dictionary implementation using AVL Tree
• Log-book for Task Monitoring
by CodeChum Admin
We've already tried printing out the values of an array in reversed order, right? Today, we shall compute for the squares of all the numbers.
There's already a predefined array/list containing 100 integer values. Loop through each values, compute their squares, and display them.
Write a program to convert decimal to octal or decimal to hexadecimal or decimal to binary digits and then display the decimal number along with its changed form. Use only for loop or while loop and java.util.* package
(E.g.)The output must be like below-
Press A to convert the decimal into octal:
Press B to convert the decimal into hexadecimal:
Press C to convert the decimal into binary:
Enter a decimal number: 4.8
Its binary form: 100.11001100110
_______________________________________________________________________
**I pressed C so I got its binary form, If I have pressed B then it would have been like this-
Its hexadecimal form: 4.CCCCCCCCCCC
BTW above is for 4.8e10
Write a program to check and display whether the number is Goldbach number or not using only for loop or while loop & java.util.* package
The output must be like below-
Enter a number:
6
Goldbach number
Your task is to find the sum of the length of all lines (in kms) that can be drawn between co-ordinates of these countries.
Population limit: 65847
Your task is to find the sum of the length of all lines (in kms) that can be drawn between co-ordinates of these countries.
1. Create a class named RunQuad. This class shall contain the main method.
2. Add three (3) classes named Quadrilateral, Rectangle, and Square. Rectangle shall inherit from
Quadrilateral while Square shall inherit from Rectangle.
3. Declare a public method named showDescription() in all three (3) classes except in RunSquad.
Customize each method by creating different println() statements.
a. For Quadrilateral: "- is quadrilateral".
b. For Rectangle: "- has 4 right angles". Add a super() statement to call Quadrilateral's
method.
c. For Square: "- has 4 equal sides". Add a super() statement to call Rectangle's method.
4. Code the main method of the RunQuad class. The output shall ask the user to press R or S to
choose between rectangle and square. Display appropriate description(s).
5. Keep a copy of your program. You will be using it next week.
Write a program to take a String as input then display number of words it has.
Use java.util.* package and charAt(),length(),trim() only.
The output must be like below:
Enter a String:
(black space) My name is Stinger (blank space)
Number of words is 4
Create a superclass class Employee with this:
-A name and salary instance variables
-A constructor that receives values to set the values of the instance variables
-To String method that returns the name along with the salary as a String
Create a class Manager that inherits from Employee with the following:
-Add an instance variable, named department, of type String.
-A constructor that receives the values of name, salary, and department and set them properly
-Supply a method toString that returns the manager’s name, department, and salary.
Create a class Executive that inherits from the Manager with the following:
-A constructor that receives the values of name, salary, and department and set them properly
-toString method that returns the manager’s name, department, and the salary he
Create a class that contains the main method with the following
-Create an object of each Employee, Manager, and Executive properly
-Display the returned value of calling the toString methods for each of the created objects
Write a program to create 2 single dimension arrays in order to store 5 numbers and 6 numbers respectively. Then merge those values of both the array into third array so that the values of the first array will be kept first from left to right followed by values of second array again from left to right. Then display those values of the merged(third) array.
Use only java.util.* package
The output of the program must be like below:
Enter 5 numbers for first array
34 57 879 21 9
Enter 6 numbers for second array
12 3 4567 23 31 98
Values of first array from left to right followed by second array again from left to right
34 57 879 21 9
12 3 4567 23 31 98
Values of merged array
34 57 879 21 9 12 3 4567 23 31 98