Java代写 | Training Exercises 9


Exercise .1: Design a program that counter the real
time using the computer timer, by using

System.currentTimeMillis() method.
– User construct a data type of time millisecond.
– Start the time counting by calling the constructor.
– Stop the time counter and calculate the elapsed time.

Exercise .2: Create a data type that used to work with currencies
and made exchange from Euro, USD, POUND, YEN.

1. Create a class currency, for name and rate.

2. Create a constructor (Set the values of currency and
exchange rates. For example:

1 Euro = 1.06 USD
1 Euro = 0.85 POUND
1 Euro = 119.06 YEN

3. Create a methods for exchange computation. Using the
double targetAmount =
sourceAmount * rateToTarget / rate;

Exercise .3: write a program that return true for an input
of strings if the input is palindromes.

(A palindrome is a sentence that you can read it from
both side “left and right” which it has the same structure.
For example: racecar, level)

Exercise .4: Create a data type to manipulate complex numbers.

PS: Create Class called complex that has the following methods:

Exercise .5: Write a generic set to add a set of
numbers: “11, 24, 85, 47, 45, 47, 55, 7, 14”. Then print
the result.

Exercise .6: Using HashMap write a program
store the employee name and salary and
then print the results, and modify the salary
for one of the employee.


本网站支持淘宝 支付宝 微信支付  paypal等等交易。如果不放心可以用淘宝交易!

E-mail:  微信:itcsdx