constant byte variable ONE_HUNDRED and initialize it with value 100
Write a program and complete the following operations:
(1) Define a double variable y0, initialize it with value 90
Define a float variable y1, initialize it with value 0
Assign y1 with value in y0
Display y0 and y1
(1) Define an int variable x0, initialize it with value 99
Define a short variable x1, initialize it with value 0
Change x1 so x1 will hold a number which is the half of the number in x0
Display x0 and x1
Write a program:
Define 2 int variables vx & vy. Use Scanner object to read from console and assign input values to them respectively.
Display the values in console: “vx=a-value; vy=a-value”
Swap the values saved in vx and vy, display vx and vy again
Given a floating-point number, extract its integer part and fractional part, and display. For example, given number 123.456, the integer part and fractional part are: 123 and 0.456
For the following function, write Java code to display results:
y = ax2 + bx + c
Enter 3 floating-point numbers and assign them to coefficients a, b, c; then display the following table (? will be replaced by real numbers)
-5, y=?
-3, y=?
-1, y=?
0, y=?
1, y=?
3, y=?
5, y=?
Write program:
Given 3 digits x, y, and z, generate an integer number which is 100 * x + 10 * y + z (for example, if x, y, z are 1, 2, 3, the number will be 123). Display this number
Given 3 digits m, n, and k, generate a float-pointing number which is m*10 + n + k*10-1 (for example: if m=1, n=2, k=3, then the number will be 12.3). Display this number
Given 2 double variables r1 and r2 which are the radius of 2 circles. Write a program to calculate and display:
the total area of these 2 circles
the total circumference
Given the circumference of a circle, write a program to calculate the area of this circle.
A square circumscribes a circle as is shown in below. Write a program to calculate the area that’s blue colored in the picture. The radius of the circle is input from console.