Java Reference
In-Depth Information
4. Write a GUI program to convert a character to a corresponding integer, and
vice versa.
5. Write a GUI program to convert all letters in a string to uppercase letters.
For example, Alb34ert will be converted to ALB34ERT .
6. Write a GUI program to convert all lowercase letters in a string to uppercase
letters, and vice versa. For example, Alb34eRt will be converted to
aLB34ErT .
7. Write a GUI program to compute the amount of a certificate of deposit on
maturity. The sample data follows:
Amount deposited: 80000.00
Years: 15
Interest rate: 7.75
Hint: To solve this problem, compute 80000.00 (1 + 7.75 / 100) 15 .
8. Write a GUI program that will accept three (integer) input values, say, x , y ,
and z , and then verify whether or not x * x + y * y = z * z .
9. Design and implement a GUI program to convert a positive number given in
one base to another base. For this problem, assume that both bases are less
than or equal to 10. Consider the sample data:
number = 2010, base = 3, and new base = 4.
In this case, first convert 2010 in base 3 into the equivalent number in base
10 as follows:
2 * 3 3 + 0 * 3 2 + 1 * 3 + 0 = 54 + 0 + 3 + 0 = 57
To convert 57 to base 4 , you need to find the remainders obtained by
dividing by 4 , as shown in the following:
57 % 4 = 1, quotient = 14
14 % 4 = 2, quotient = 3
3 % 4 = 3, quotient = 0.
Therefore, 57 in base 4 is 321 .
Search WWH ::




Custom Search