Java MP

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

Goverement Polytechnic Nandurbar

DIPLOMA IN COMPUTER ENGINEERING

SYCO
SEMESTER 4[2021-2022]

SUBJECT: JAVA PROGRAMMING


Members in Group

Rahul Gagdale
Kirtan Shimpi
Kalpesh Borse
Jayesh Mhanjan
Lalit Borse

GUIDED BY: - MR. Magan Vasave


MAHARASHTRA STATE BOARD OF TECHNICAL
EDUCATION
Certificate

This is to certify the following group of students of 4th semester of Diploma in


Computer Engineering(CO) of institute,Goverement Polytechnic Nandurbar
has completed the Micro Project satisfactorily in the subject – Java
Programming ( 22412 ) for the Academic year 2020to 2021as prescribed in the
Curriculum.

Place: Enrolment No.:

Date:_ Seat No.: _

Subject Teacher Head of Department Principal

Seal of
Institution
ACKNOWLEDGEMENT
We would like to express our special thanks of gratitude to our
institute Goverement Polytechnic Nandurbar our subject teacher
MR. Magan Vasave who gives us opportunity to make this micro
project on the topic "To Write a Program in java to define class
Flight_Management that calculate the value of fuel In flight”. This
has greatly helped us in expanding my cohere of knowledge. We are
thankful to each other because every one of us aided to complete
this project within the limited frame of time.
PROPOSAL

PROPOSAL
1.0 Aim/Benfits of the Micro-Project:
Aim:- To Write a Program in java to define class Flight_Management that calculate the value
of fuel In flight.
Benefits:-
The Project aims at the better development development and understanding the basics of JAVA
programming. It gives us through knowledge of classes and object avaible in JAVA.We know
how to to Implement If …Else If in JAVA.

2.0 Course Outcome addressed:


The theory, practical experiences and relevant soft skills associated with the course are to be
taught and implemented, so that the student demonstrates the following industry oriented Cos
associated with the above mentioned competency:
a. Develop programs using Object Oriented Methodology in JAVA.
b. Develop programs using multithreading.

3.0 Proposed Methodology:


1. Getting the overview of the project and understanding the concept throroughly.
2. Collective information about implementing the concepts of JAVA in the given micro-
project.
3. Making of the Proposal
4. Building of the code of the micro-project and removing the errors.
5. Making of the Report.

1. Action Plan:

Name Of
Responsible
Sr No Activity Details Starting Date Finishing Date
Team
Members
Getting the overview 5/03/2022 Kalpesh Borse
1. of the project

Gathering of 12/03/2022 24/04/2022 Jayesh Mahajan


2.
Information
Making of the 26/03/2022 02/05/2022 Rahul Jagdale
3.
Proposal
Building of the 10/03/2022 18/01/2022 Kirtan Shimpi
4.
Code
Making of the 19/03/2022 22/05/2022 Lalit Borse
5.
Report

2. Resources Used

Sr. No Name of
Specification Quantity
Resource/material
1. Computer System Intel i5 6600k, 8GB Ram 1
2. Software 1 Window 10 1

3. Software 2 Jdk-15.0.2 1

Roll Number of the Team Name of the Team


Members Members

2126 Kalpesh Borse

2124 Jayesh Mahajan

2155 Rahul Jagdale

2123 Kirtan Shimpi

2132 Lalit Borse

(Subject Teacher)
Mr. Magan Vasave

Report
1.0 Rationale
Java is platform independent, open-source object oriented programming language enriched
with free and open source libraries. In current industrial screnario Java has the broad industry
support and is prerequisite with many allied technologies like Advanced Java, Java Server
Pages and Android Application Development. Thus current industrial trends necessitate
acquiring Java knowledge for Computer Engineering graduates. This course develops
necessary skills in students to apply object oriented programming techniques in Java so that
students will be able to develop complete applications using core Java.

2.0 Aims/Benefits of the Micro-Project


Aim:- To Write a Program in java to define class Flight_Management that calculate the value
of fuel In flight. Benefits:-
The Project aims at the better development development and understanding the basics of
JAVA programming. It gives us through knowledge of classes and object avaible in
JAVA.We know how to to Implement If …Else If in JAVA

3.0 Course outcomes achieved


The theory, practical experiences and relevant soft skills associated with the course are to
be taught and implemented, so that the student demonstrates the following industry oriented
Cos associated with the above mentioned competency:
a. Develop programs using Object Oriented Methodology in JAVA.
b. Develop programs using multithreading..

4.0 Literature review

Class
A class is a user defined blueprint or prototype from which objects are created. It represents
the set of properties or methods that are common to all objects of one type. In general, class
declarations can include these components, in order:
1. Modifiers: A class can be public or has default access (Refer this for details).
2. class keyword: class keyword is used to create a class.
3. Class name: The name should begin with an initial letter (capitalized by convention).
4. Superclass(if any): The name of the class’s parent (superclass), if any, preceded by the
keyword extends. A class can only extend (subclass) one parent.
5. Interfaces(if any): A comma-separated list of interfaces implemented by the class, if any,
preceded by the keyword implements. A class can implement more than one interface.
6. Body: The class body surrounded by braces, { }.

Syntax:

Class classname
{
Variable declaration:
Method declaration;
}

Constructor
When discussing about classes, one of the most important sub topic would be constructors.
Every class has a constructor. If we do not explicitly write a constructor for a class, the Java
compiler builds a default constructor for that class.
Each time a new object is created, at least one constructor will be invoked. The main rule of
constructors is that they should have the same name as the class. A class can have more than
one constructor.

Scanner Classes

Scanner class in Java is found in the java.util package. Java provides various ways to read
input from the keyboard, the java.util.Scanner class is one of them.

The Java Scanner class breaks the input into tokens using a delimiter which is whitespace by
default. It provides many methods to read and parse various primitive values.

The Java Scanner class is widely used to parse text for strings and primitive types using a
regular expression. It is the simplest way to get input in Java. By the help of Scanner in Java,
we can get input from the user in primitive types such as int, long, double, byte, float, short,
etc.

The Java Scanner class extends Object class and implements Iterator and Closeable interfaces.

The Java Scanner class provides nextXXX() methods to return the type of value such as
nextInt(), nextByte(), nextShort(), next(), nextLine(), nextDouble(), nextFloat(),
nextBoolean(), etc. To get a single character from the scanner, you can call next().charAt(0)
method which returns a single character.

Syntax:

Scanner sc = new Scanner(System.in);

If-else-If Staement
The if-else-if ladder statement executes one condition from multiple statements.

Syntax:

if(condition1){
//code to be executed if condition1 is true
}
else if(condition2){
//code to be executed if condition2 is true
} else
if(condition3){
//code to be executed if condition3 is true
}
...
else{
//code to be executed if all the conditions are false
}
Java.util.Scanner
The java.util.Scanner class is a simple text scanner which can parse primitive types and strings
using regular expressions.Following are the important points about Scanner − A Scanner
breaks its input into tokens using a delimiter pattern, which by default matches whitespace.
• A scanning operation may block waiting for input.
• A Scanner is not safe for multithreaded use without external synchronization

5.0 Actual Methodology Followed


1. Getting the overview of the project and understanding the concept throroughly.
2. Collective information about implementing the concepts of JAVA in the given
micro- project.
3. Making of the Proposal
4. Building of the code of the micro-project and removing the errors.
5. Making of the Report.

6.0 Actual resources used


Sr. No Name of
Specification Quantity
Resource/material
1. Computer System Intel i5 6600k, 8GB Ram 1
2. Software 1 Window 10 1

3. Software 2 Jdk-15.0.2 1

7.0 PROGRAM CODE

import java.util.Scanner;
public class Flight_Management_P
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
System.out.print("Enter the Flight number:");
int num = in.nextInt(); System.out.print("Enter
the Orgin:");
String origin = in.next();
System.out.print("Enter the Destination:");
String destination = in.next();
System.out.print("Enter the Distance:"); long
distance = in.nextLong();
System.out.println("*************************");
System.out.println("Flight Number is:"+num);
System.out.println("Origin of Flight:"+origin);
System.out.println("Destination of Flight:"+destination);
System.out.println("Distance of Flight:"+distance); if(distance<=1000)
{
System.out.println("Value of Fuel = 500");
}
else if(distance>1000 && distance<=2000)
{
System.out.println("Value of Fuel = 1100");
}
else if(distance>2000)
{
System.out.println("Value of Fuel = 2200");
}
System.out.println("*************************");
}
}
OUTPUT :-

❖ Distance <= 1000 km


❖ 1000 < Distance < = 2000
❖ Distance > 2000

7.0 Skills Developed/Learning Outcome of the Microproject


Thus we learnt to declare and use classes. How and where to create If Else If statement in
JAVA. Thus a successful program creation in JAVA
8.0 Applications of this Micro-project
With the help of this micro-project we have define a class Flight_management and calculate
the value of fuel.

Roll Number Name of the Team Members


2126 Kalpesh Borse

2124 Jayesh Mahajan


2155 Rahul Jagdale

2123 Kirtan Shimpi

2132 Lalit Borse

Subject Teacher

Mr. Magan Vasave

You might also like