Oopj Certi 1

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Enrollment No: 221041303001

LABORATORY MANUAL
OBJECT ORIENTED PROGRAMMING WITH JAVA (1330304)

COMPUTER ENGINEERING

Integrated M.Sc. SEM. III (COMPUTER), Year 2023-24(ODD SEM)

DEPARTMENT OF COMPUTER ENGINEERING


GUJARAT POWER ENGINEERING AND RESEARCH INSTITUTE, MEHSANA

(APPROVED BY AICTE)

(Affiliated to Gujarat Technological University)

Near Toll Booth, Ahmedabad-Mehsana Express Way, Village-Mevad

District Mehsana-Gujarat

Contact No. 02762-292262/63


GUJARAT POWER ENGINEERING AND RESEARCH
INSTITUTE, MEHSANA
(A constituent of Gujarat Technological University)

This is certify that the work carried out by Mr./Ms. _

Enrollment No. student of Computer Engineering, semester III of session 2023-


2024 has satisfactorily completed at Gujarat Power Engineering and Research
Institute, Mehsana. This manual is record of his/her
own work of subject out under competent carried
supervision and guidance.

Date of Submission:

Faculty In-charge Head Of Department

Prof. Vyom Patel Prof. Avani Raval


INDEX

Sr. Page
No. Experiment Title No. Date Sign

Write a program that displays Welcome to java, learning java now


1 and programming is fun.

Write A program that solves the following equations and1q displays


2 the value of X and Y : (1)3.4X + 50.2Y=44.5 (2)2.1X + 55Y=5.9

Write a program that reads a number in meters and convert into feets,
3 and displays the result.

Calculate BMI. Write a program that prompts the user to enter the
4 weight in pounds and height in inches and displays the BMI.

write a program which prompts the user to enter three integers and
5 display three integers in decreasing order.

write a program that prompts the user to enter a letter and check
6 Whether a letter is vowel or consonant.

Assume a vehicle plate number consists of three uppercase letters


7 followed by four digits. Write a program to generate a plate number.

Write a Program that reads an integer and displays all its smallest
8 factors in increasing order.

Write a method with following method header. public static int


gcd(int num1, int num2) Write a program that prompts the user to
9
enter two integers and compute the gcd of two integers.

Write a test program that prompts the user to enter ten numbers,
10 invoke a method to reverse the numbers, display the numbers.
Write a program that generate 6*6 two-dimensional matrix, filled
with 0’s and 1’s , display the matrix, check every raw and column
11
have an odd number’s of 1’s.

Write a program that creates a Random object with seed 1000 and
displays the first 100 random integers between 1 and 49 using the
12
NextInt (49) method.

A program for calculator to accept an expression as a string in which


13 the operands and operator are separated by zero or more spaces.

A program that creates an Array List and adds a Loan object , a Date
object , a string, and a Circle object to the list, and use a loop to
14 display all elements in the list by invoking the object’s to String()
method.

The bin2Dec (string binary String) method to convert a binary string


into a decimal number. Implement the bin2Dec method to throw a
15
NumberFormatException if the string is not a binary string.

Write a program that prompts the user to enter a decimal number and
16 displays the number in a fraction.

Write a program that displays a tic-tac-toe board. A cell may be X, O,


or empty. What to display at each cell is randomly decided. The X
17
and O are images in the files X.gif and O.gif.

Write a program that moves a circle up, down, left or right using
18 arrow keys.

Write a program that displays the color of a circle as red when the
mouse button is pressed and as blue when the mouse button is
19
released.

Write a program to create a file name 123.txt, if it does not exist.


Append a new data to it if it already exist. Write 150 integers created
20 randomly into the file using Text I/O. Integers are separated by
space.

You might also like