Sei sulla pagina 1di 2

http://www.ramgopalgupta.

com

MCA- 3
RD
SEM (2014)
INTERNET & JAVA PROGRAMMING (LAB)

Assignment-1
(Completion date 15
th
Sep, 2014)

Faculty Name: R.G. Gupta (rgmail@rediffmail.com)


TRY ALL THESE PROGRAMES UESING Flow Control Constructs:

1. Accept a number and check the number is even or odd.
2. Accept a day number and display the corresponding day name. If the day
number exceeds to 7 it show an appropriate message.
3. Accept the month number and the year, show the number of days in the month
consider the year also.
4. Show a menu to the user like:
1. ADD
2. Multiply
3. Sunstract
4. Division
5. Remainder
Accept two number and a choice from 1-5 and show the result accordingly. Also
take appropriate action if choice not in between 1-5.

5 Program to convert time in second to time in hours, minutes and seconds
For example: input is 3678
Result : 1 hours, 1 minutes & 18 seconds

6. Accept four positive numbers and display the greatest among them.

7. Write a program to test a given number is a palindrome number.
8. Write a C program to convert a binary number into a decimal number.
9. Program to convert a decimal number into its equivalent binary number.
10. Write a program that calculate the sum of digits of an integer.
For example, the sum of the digits of the number 2155 is 2+1+5+5=13.
The programe should accept any arbitrary integer typed by the user.



http://www.ramgopalgupta.com
11. Write a program in Java to input the marks obtained by students in 5 subjects
and calculate the total and percentage and further print the following according
to the percentage:
a. if percentage is >= 75 then print passed with honors
b. If percentage is between 60-74 then print passed with I Division
c. If percentage is between 50-59 then print passed with II Division
d. If percentage is between 40-49 then print passed with III Division
e. Otherwise failed.

Repeat this process for five students.

12. Suppose that in a year 1975, the population of cities A and B is 70,000 and
1,00,000 respectively. Further suppose that if the population of cities increases
at rate of 6 and 4 percent respectively. Write a program to find the year in which
the population of city A will exceed population of city B.

13. A program to accept an integer number and check the number is prime or not.

14. Write a program to declare two set A and B using Arrays. After that find A U B
and A B.

15. Write a program to transpose a matrix of 3x3 elements.

16. Write a program to multiply two matrix (3x3) and resulting matrix also multiply
given two matrixes.

17. Define a matrix of size 5 x 5 the store the elements in this array. Now do the
following:-
a. Display the sum of all elements
b. Display the sum of each row
c. Display the sum of each column
d. Display the sum of only even numbers

Mini Project based on flow control:
Design numerology systems which will the display characteristics of a number (from 1 to 9).
(Try to develop it from your own and dont make it very complicated)

Potrebbero piacerti anche