0% found this document useful (0 votes)
29 views2 pages

Attempt All The Questions

This document contains 7 questions about Java programming. The questions cover topics like developing a transportation application prototype, reading and writing to files, abstract methods, exceptions, Fibonacci sequences, and creating a basic graphical user interface.

Uploaded by

Rajan Chaudhary
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views2 pages

Attempt All The Questions

This document contains 7 questions about Java programming. The questions cover topics like developing a transportation application prototype, reading and writing to files, abstract methods, exceptions, Fibonacci sequences, and creating a basic graphical user interface.

Uploaded by

Rajan Chaudhary
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Attempt all the questions.

1 Suppose you are hired to develop application for transportation system, 10


and you need to develop prototype in order to convince client. You have
to write java program to store information about different cities with
different between them.

Note: Use 2D matrix in order to store connection between two cities

2 a. Explain the procedure of compilation of a Java Code with 5


Diagram.

b. Write a complete Java program that prompts the user for


numbers n, read user input in, and after each user input display
the maximum and minimum value to the console. 5

3 Write a java program to read and display name and salary of all 10
employee from file,below is the sample format for the file

1. Rakesh, rs 100000, Kathmandu

2. John , rs 50000, Pokhara

4 Write a function to reverse an integer using numeric operators and 10


without using any arrays or other data structures. Example: Input: 1234

5
a. What is the role of abstract methods in object-oriented design?
5
b. Explain why ‘exceptions’ play an important role in Java file
handling.

5
6 a. Describe the differences between ‘text’ and ‘binary’ files in 5
Java.

b. Write the recursive program to generate Fibonacci sequence of


given position.
5

7 Write a Graphics Program that does the following: 10

 Create frame with the dimension 500*200

 Add buttons to the bottom of the frame labled with "Add",


"multiply", "Subtract", and "divide".

 Create two input box to the top of the frame asking two numeric
input

 Implement the actions for the button so that clicking on any of these
buttons must perform basic arithmetic operation such as addition,
abstraction e.t.c

You might also like