0% found this document useful (0 votes)
100 views9 pages

Java Distance Conversion Program

This document describes a distance conversion program that allows users to convert between meters, kilometers, feet, and inches. It includes chapters on the introduction, literature review, project details, outputs, and advantages/disadvantages. The program uses methods like calculateKilometers() and calculateInches() to convert distances based on formulas. It displays a menu and gets user input to determine which conversion to perform. The output displays the converted distance. Developing this program helps learn object-oriented programming and distance conversion concepts.

Uploaded by

aabid mulla
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)
100 views9 pages

Java Distance Conversion Program

This document describes a distance conversion program that allows users to convert between meters, kilometers, feet, and inches. It includes chapters on the introduction, literature review, project details, outputs, and advantages/disadvantages. The program uses methods like calculateKilometers() and calculateInches() to convert distances based on formulas. It displays a menu and gets user input to determine which conversion to perform. The output displays the converted distance. Developing this program helps learn object-oriented programming and distance conversion concepts.

Uploaded by

aabid mulla
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

Distance Convertor

Chapter 1 – INTRODUCTION TO PROJECT

1.1 ABSTRACT
In that Project we Represent the project of Distance Convertor and Implement the program will
then present a user menu of conversion types, converting the distance to kilometers, feet and
inches, according to the user’s selection. The converted distances will then be printed.
Conversion of units is the conversion between different units of measurement for the same
quantity, typically through multiplicative conversion factors.
The mile is an English unit of length of linear measure equal to 5,280 feet, or 1,760 yards, and
standardized as exactly 1,609.344 meters by international agreement in 1959.

1.2 RATIONALE
Importance of the project of the project in to converter in the distance convertor using netback
Miles and Kilometers are different units used for distance measurement. For example Miles is part
of the imperial system and Kilometers is part of the metric system. The following formula can be
used to convert miles into kilometers,
Distance in km = 1.60934 * distance in miles.
The following formula can be used to convert kilometers to miles,
Distance in miles = 0.621371 * distance in km
There are many conversion tools. They are found in the function libraries of applications such as
spreadsheets databases, in calculators, and in macro packages and plugins for many other
applications such as the mathematical, scientific and technical applications.
There are many standalone applications that offer the thousands of the various units with
conversions. For example, the free software movement offers a command line utility GNU units for
Linux and Windows.

1.3 COURSE OUTCOMES ADDRESSED


i. Develop a program using object oriented methodology in java.
ii. Apply concept of inheritance for code reusability.
iii. Implement the Exaptation handling.

Computer Department -1- msbte notes academy


Distance Convertor

Chapter 2 – LITERATURE REVIEW

The mile is an English unit of length of linear measure equal to 5,280 feet, or 1,760 yards, and
standardized as exactly 1,609.344 meters by international agreement in 1959.
A conversion factor is used to change the units of a measured quantity without changing its value.
The unity bracket method of unit conversion consists of a fraction in which the denominator is
equal to the numerator, but they are in different units. Because of the identity property of
multiplication, the value of a quantity will not change as long as it is multiplied by one.[2] Also, if
the numerator and denominator of a fraction are equal to each other, then the fraction is equal to
one. So as long as the numerator and denominator of the fraction are equivalent, they will not
affect the value of the measured quantity.
The following example demonstrates how the unity bracket method is used to convert the rate 5
kilometers per second to meters per second. The symbols km, m, and s represent kilometer, meter,
and second, respectively. Thus, it is found that 5 kilometers per second is equal to 5000 meters per
second.
The program will then present the following menu of selections:
Main Menu: -
1. Convert to kilometers
2. Convert to inches
3. Convert to feet
4. Quit the program
The program will convert the distance to kilometers, inches, or feet, depending on the user’s
selection. Here are the specific requirements:
1. Write a method named calculate Kilometers, which accepts the number of meters as an
argument. The method should return the argument converted to kilometers. Convert the
meters to kilometers using the following formula: kilometers = meters * 0.001
2. Write a method named calculate Inches, which accepts the number of meters as an
argument. The method should return the argument converted to inches, Convert the
meters to inches using the following formula: inches = meters * 39.37
3. Write a method named calculate Feet, which accepts the number of meters as an argument.
The method should return the argument converted to feet. Convert the meters to feet using
the following formula: feet = meters * 3.281

Computer Department -2- msbte notes academy


Distance Convertor

4. Write a method named menu that returns a list of menu of selections. This method should
not accept any arguments.
5. The program should continue to display the menu until the user enters 4 to quit the
program.
6. If the user selects an invalid choice from the menu, the program should display an error
message.

Computer Department -3- msbte notes academy


Distance Convertor

Chapter 3 – PROJECT DETAILS

3.1 ACTUAL METHODOLOGY FOLLOWED


import [Link].*;
import [Link];
public class Convert1
{
public static void main(String args[])
{
double meters,kilometers,miles;
Scanner in = new Scanner([Link]);
[Link]("Choose the type of Distance conversion : ");
[Link](" [Link] to KiloMeters \n 2. Miles to KiloMeters \n [Link] into
Meters \n [Link] to Miles :");
int ch=[Link]();
switch(ch)
{
case 1:
[Link]("Meters into KiloMeters");
[Link]("Enter the number of Meters:");
meters=[Link]();
kilometers = meters * 0.001;
[Link]( meters + " Meters is " + kilometers + "Kilometers ");
break;

case 2:
[Link]("Miles to Kilometers conversion");
[Link]("Enter the number of Miles");
miles=[Link]();
kilometers = miles * 1.60934;
[Link]( miles+ " Miles is " + kilometers + " Kilometers");
break;

Computer Department -4- msbte notes academy


Distance Convertor

case 3:
[Link]("KiloMeters into Meters");
[Link]("Enter the number of KiloMeters:");
kilometers=[Link]();
meters = kilometers * 1000;
[Link](kilometers + " Kilometers is " + meters + "meters");
break;

case 4:
[Link]("Kilometers to Miles");
[Link]("Enter the number of Kilometers");
kilometers=[Link]();
miles = kilometers / 1.60934;
[Link]( kilometers + " Kilometers is " + miles + "Miles");
break;
}
}
}

3.2 ACTUAL RESOURCES REQUIRED

Sr. Quan
Name of Resource/Material Specifications Remarks
No. tity
1. Computer System HP ProOne 400 1
Intel(R) core(TM) i3-
2. Processor 1
4170T CPU 3.20GHz
2 GB
3. Primary Memory 1

4. Operating System Window 8 1

5. Command prompt - 1

Computer Department -5- msbte notes academy


Distance Convertor

Chapter 4 – MICRO-PROJECT OUTPUTS

4.1 OUTPUTS OF THE MICRO-PROJECT

4.2 SKILL DEVELOPED/LEARNING OUT OF THIS MICRO-PROJECT


i. To Develop the Program for Distance Convertor.
ii. To Understand the Concept of distance meter.
iii. To implementing the java programing.

Computer Department -6- msbte notes academy


Distance Convertor

Chapter 5
ADVANTAGES, DISADVANTAGES & APPLICATIONS

5.1 ADVANTAGES
− Metric system is a decimal system of weights and measures it is easy to
convert between units (e.g. from millimeters to meters, or grams to kilograms) simply by
multiplying or dividing by 10, 100, 1000, etc. Often this is just a case of moving the decimal
point to the right or left.
− Cost of transmission is less, since only two conductors are used for transmission. There is no
reactive power. So transmission losses are reduced. Due to high voltage transmission, for
the same power current is less.

5.2 DISADVANTAGES
− The only major disadvantage in using the metric system is that it's not well-suited for
working with fractions. For example, 1/6 meter is approximately equivalent to 167
millimeters and 1/3 kilogram is approximately equal to 333 grams.

5.3 APPLICATIONS
− A conversion factor is used to change the units of a measured quantity without changing its
value. The unity bracket method of unit conversion consists of a fraction in which the
denominator is equal to the numerator, but they are in different units.
− There are many conversion tools. They are found in the function libraries of applications
such as spreadsheets databases, in calculators, and in macro packages and plugins for many
other applications such as the mathematical, scientific and technical applications.

Computer Department -7- msbte notes academy


Distance Convertor

Chapter 6
CONCLUSIONS, FUTURE SCOPE & REFERENCES

6.1 CONCLUSION
We have to understate the concept of distance converter and implementing there java
program code.

6.2 AREA OF FUTURE IMPROVEMENT


− HVDC its Scope : HVDC scope, efficiency of HVDC, electrical energy storage, interconnection
using HVDC, Integration, DC-DC conversion, asynchronous power sharing

6.3 REFERENCES
[1] [Link]
[2] [Link]
[Link]
[3] [Link]
DIARIsABnkbYT9tR1Se-U2Z-_wM4q2Jp8moc49soGuB0-
nU4zrwQOyhBZhPV237SQaAtbEEALw_wcB
[4] [Link]

Computer Department -8- msbte notes academy


Distance Convertor

WEEKLY WORK / PROGRESS REPORT

Details of 16 Engagement Hours of the Student


Regarding Completion of the Project
Timing Sign
Week
Date Duration Work/Activity Performed of
No. From To
in Hours Guide
1.

2.

3.

4.

5.

6.

7.

8.

9.

10.

11.

12.

13.

14.

15.

Name & Signature of Project Guide


Prof_name

Computer Department -9- msbte notes academy

Common questions

Powered by AI

Challenges with the unity bracket method include potential confusion and errors if the units are not explicitly clear or if the conversion factors are misapplied. Ensuring proper documentation and using software tools that automate conversions can reduce errors. Training users to accurately identify and apply conversion factors can address these challenges effectively .

To address the metric system's limitations with fractions, educational initiatives could focus on teaching techniques to approximate fractions in the metric equivalent using decimals. Development of software tools that allow quick fractional approximations and visualizations could also improve usability. Users can benefit from calculators that handle fractional inputs and display clear decimal equivalents, enhancing daily usage in environments that require precise measurements .

The 'calculateFeet' method accepts the number of meters as an argument and returns the equivalent distance in feet by applying the conversion formula: feet = meters * 3.281. This method encapsulates the conversion logic, making it reusable throughout the application for any required conversion from meters to feet .

The Distance Convertor project applies object-oriented methodology by developing programs that utilize inheritance to achieve code reusability. This approach is useful for developing modular, maintainable code, and exception handling is implemented to manage runtime errors, enhancing the program's robustness .

The unity bracket method of unit conversion can be used to change units without altering the value of the measured quantity. It involves using a fraction where both the numerator and the denominator are equal but expressed in different units. Due to the identity property of multiplication, this method ensures the value remains constant as long as the fraction equals one .

The imperial system, commonly used in the United States, uses units like miles and feet, while the metric system, used widely across the world, employs units like kilometers and meters. For instance, one mile is equivalent to 1.60934 kilometers. Conversions between the systems require multiplicative conversion factors, reflecting the fundamental differences in unit definitions between the two systems .

The project aims to develop skills in programming for a distance convertor, understanding the concept of distance measurement units, and implementing a program in Java. These objectives focus on fostering practical skills in software development and unit conversion understanding .

The conversion menu in the Distance Convertor program serves as the user interface allowing users to choose between converting distances to kilometers, inches, feet, or quitting the program. The method `menu` returns these selections, and the program continuously displays this menu until the user opts to quit, facilitating user interaction and program continuity .

The main advantage of the metric system in unit conversion is its simplicity since it is a decimal-based system. Conversions are straightforward by multiplying or dividing by powers of ten, making it easy to move the decimal point. However, its primary disadvantage is that it is not well-suited for fractions, as it can lead to awkward values like 1/6 meter being approximately 167 millimeters .

Future improvements involving HVDC (High Voltage Direct Current) can enhance unit conversion projects by improving computational efficiency and expanding integration capabilities. HVDC's scope in energy transmission suggests possibilities for asynchronous power sharing and DC-DC conversion which can be adapted to enhance data handling and processing speed in conversion software, leading to faster and more versatile conversion applications .

You might also like