Cs480 - write a java program to find the summation of all


1) Write a Java program to find the summation of all the integers entered on command line.

$ java Add 1 2 3
6
$ java Add 3 5 1
9

- Write above program in NetBeans pass arguments through Project Properties ->run configuration.
- Write above program using JOptionPane input Dialog box.

2) Write a java program to Read five integers from the keyboard and display the one that is smallest.

3) Reading a number and determine whether it is an even or odd number. This is a sample session of running this program

Output:
Enter a number: 2
2 is even
Enter a number: 9
9 is odd
Enter a number: 8
8 is even
Enter a number: 7
7 is odd
Enter a number: 5
5 is odd

4) Create a program to compute a worker's daily salary.

input: hour_rate, number_of_hours
output: salary = hour_rate * number_of_hours

Modify the program to compute a worker's daily salary based on the following table:

--------------------------------------
| $7.00/hr | The first 8 hours |
--------------------------------------
| $9.00 /hr | After 8 hours |
--------------------------------------
For example, if a worker works 10 hours, then her/his salary is
$7.00/hr * 8 hrs + $9.00/hr * (10 - 8) hrs
Note: The number 7.00 is read from keyboard. 9.00 is fixed.

Modify the program to compute N worker's daily salary.
The number N is an input to this program.

Modify the program to compute and print N worker's total daily salary. A session of running this program would look like:

Output:
Please enter number of workers? 3
Please enter worker 1's working hours: 10
Worker 1's salary is 74
Please enter worker 2's working hours: 6
Worker 2's salary is 42
Please enter worker 3's working hours: 9
Worker 3's salary is 65
The total salary for the 3 workers is: 181

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Cs480 - write a java program to find the summation of all
Reference No:- TGS01420069

Now Priced at $15 (50% Discount)

Recommended (97%)

Rated (4.9/5)