Write a program that uses java.io.BufferReader to read the lines from the text file that is stored on disk. Handle the exceptions with following two ways:
Write a program to create 2 single dimension arrays in order to store 10 numbers respectively, then merge the values of both the arrays into third array so that the values of first array and second array will be alternate to each other, then display values of the merged array.
Alternate means third array will carry values of first and second arrays as follows:
c[0]=a[0]
c[1]=b[0]
c[2]=a[1]
c[3]=b[1]
c[4]=a[2]
c[5]=b[2]
c[6]=a[3]
c[7]=b[3]
.....
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