You are on page 1of 4

1

JAVA PROGRAMMING ACTIVITIES

LOOPING STATEMENTS PROGRAMMING ACTIVITIES [PART 1]: (use array if necessary)

1. Write a JAVA program that will compute for the Evaluation Rating of a teacher given by seven (7) students. Display the teacher's name and the average rating of the students.

2. Write a JAVA program that will generate and display the sum and product of ten (10) input numbers.

3. Write a JAVA program that will generate and display the highest and lowest numbers of the ten (10) input integers.

4. Write a JAVA program that will input ten (10) integers. Count the negative values entered and compute the average positive values. Display the results. Zero (0) is an invalid entry.

5. Write a JAVA program that will display the student who has eight (8) subjects in a The input data should contain the Name, Average Grade of the student...Extended five (5) students, NOT ONLY one (1).

average grade of a particular semester. Section, and the Requirement: ...with

6. Write a JAVA program that will display a Multiplication Table by inputting the x and y values of the table first. (ex. x=6, y=7 table created must have a max coordinate of 5 X 7)

7. Write a JAVA program that will input data for A and B where A is the numerator and B is the denominator. If B=0, then, display an error message and repeat the input. Otherwise, compute for Q = A/B, and determine whether the fraction is a proper fraction, an improper fraction and a whole number. Display also the

decimal equivalent and its lowest term equivalent number if there is any.

8. Write a JAVA program that will input the user name and will keep on asking the question "Are you cute?" if the user affirms. The program will end if the user answers 'N'/"No".

9. Variable Counter (Up/Down Counter) depending of the values inputted for Start Value and End Value of the Counter... extended requirement: 1. Identify each number if it is a positive, negative, zero, integer, real, prime or composite number ; 2. Display the total number of integers, real numbers, total number of positive, negative, odd, even and zero integers inside the counter loop. If the Start Value is equal to the End Value, display No Counter Generated!.

10. Write a JAVA program that will compute and display the values 2 raised to n where n = 0,1,2,4,8,16...etc...

11. Write a JAVA program that will compute and display the values x raised to y where y has a range from a to b. Note: x,y,a and b are variables with values to be provided by the user.

--

end

LOOPING STATEMENTS PROGRAMMING ACTIVITIES [PART 2 - ASTERISKS]:

==> Create a JAVA program that will display the following sample output: Enter an integer ==> _ // ex. 5

a. e. ***** ***** ***** ***** ***** i. ***** **** *** ** * * * ** ** *** *** **** **** **********

b. f. * ** *** **** ***** j. * * * * * * * * * * * * * * * ********** **** **** *** *** ** ** * *

c. g. ***** **** *** ** * k. * * * * * * * * * * * * * * * * * ** ** *** *** **** **** ********** **** **** *** *** ** ** * *

d. h. * ** *** **** ***** * * * * * * * * * * * * * * * * * * * * * * * * *

4 l. ********** **** **** *** *** ** ** * * * * ** ** *** *** **** **** ********** m. * * ** ** *** *** **** **** ********** * ** *** **** ***** **** *** ** * s. ***** **** *** ** * ** *** **** ***** t. ***** **** *** ** * ** *** **** ***** 1 22 333 4444 55555 | | | \ / v * * * * * * * * * * * * * * * * * *** * * * * * * * * * * q. * ** *** **** ***** **** *** ** * r. u. 11111 22222 33333 44444 55555

v.

n. * * ** ** *** *** **** **** ********** o. ********** **** **** *** *** ** ** * * p. ********** **** **** *** *** ** ** * *

--

end

You might also like