University of Gondar
Institute of Technology
Department of Computer Engineering
Advanced Programming –Lab Exercise part 1
1. Write a Java program to print 'Hello World ' on screen and your name on a separate line.
2. Write a java program that accepts the following inputs and display their value on the
screen. Integer number, decimal point number, character, string, byte, Boolean value and
a single line statement.
3. Write a program that takes two numbers as input and displays the sum, difference,
product, quotient and remainder of the two numbers.
4. Write a Java program that reads a number in inches and converts it to meters. Note One
inch is 0.0254 meter.
5. Accept two numbers from the keyboard and see the result by using bitwise operators.
6. Write a java program that reads marks of a student b/n 0 to 100 and display their grade
based on the following conditions.
Mark Grade
[85-100] A
[80-85) A-
[75-80) B+
[70-75) B
[65-70) B-
[60-65) C+
[50-60) C
[40-50) D
7. Write a java program that calculates the factorial of N number.
8. By integrating function call with switch case write a java program that implements #3.
9. For the given string “Advanced Programming”,
a. Find b. Print the c. Convert to d. Print the sub
length first and last lowercase string of
character and “rogramming”
uppercase
e. Find index f. Find index
of g and a. of a after
index 7.
10. Write a java program that matches any emails. Accept your email from the user.
11. Using [a-z] + pattern display the matched part of the sub string for the following given
string. “Advanced Programming”