0% found this document useful (0 votes)
2K views

PHP Measurement Converter Project

This document is a project report for a measurement converter application developed by four students at Amrutvahini Polytechnic, Sangamner. The report includes an introduction to the project, its aims and benefits, course outcomes achieved, literature review, methodology, resources used, outputs, skills developed, applications, and conclusion. The project uses PHP, CSS, and JavaScript to convert values between different units of measurement for areas, lengths, weights, temperatures, volumes, and speeds.
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)
2K views

PHP Measurement Converter Project

This document is a project report for a measurement converter application developed by four students at Amrutvahini Polytechnic, Sangamner. The report includes an introduction to the project, its aims and benefits, course outcomes achieved, literature review, methodology, resources used, outputs, skills developed, applications, and conclusion. The project uses PHP, CSS, and JavaScript to convert values between different units of measurement for areas, lengths, weights, temperatures, volumes, and speeds.
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/ 28

A

Project Report

On

“Measurement Converter”

Submitted to

Amrutvahini Polytechnic, Sangamner

Department of Information Technology

In partial fulfilment of the requirement for the diploma in

Information Technology

Submitted by

Bhoknal Sunanda Yadav (1800800113)

Avhad Jayshree Bhaskar (1800800122)

Avhad Roshani Rajendra (1800800125)

Chavhan Sayali Dilip (1800800152)

Under The Guidance of

Prof. M.S.Kurhe sir

Amrutvahini Polytechnic, Sangamner

(Approved by AICTE, NEW DELHI and affiliated to MSBTE 2020-2021)

1
Amrutvahini Polytechnic Sangamner,

Department: -Information Technology

Certificate

This is to that the project report entitled,

“Measurement Converter”

Is a Benefited Work Carrier Out By,

Bhoknal Sunanda Yadav (1800800113)

Avhad Jayshree Bhaskar (1800800122)

Avhad Roshani Rajendra (1800800125)

Chavhan Sayali Dilip (1800800152)

In partial fulfilment of the requirement for the diploma in

Information Technology

During the academic year 2020-2021

Prof. Kurhe.M.S Prof. Chaudhary .N.K


(Project guide) H.O.D. (IT)

2
Program Name – Information Technology
Program Code – IT6I (0080)
Course Name – WBP
Course Code – 22619

MICRO PROJECT TITLE

“Measurement Converter”

Sr. No. Name of Student Roll Enrollment


No. No.

1. Bhokanal Sunanda yadav 11 1800800113

2. Avhad Jayshri Bhaskar 20 1800800122

3. Avhad Roshani Rajendra 23 1800800125

4. Chavhan Sayali Dilip 37 1800800152

Prof. M.S.Kurhe

(Faculty & Signature)

3
Acknowledgement

We have taken efforts in this project. However, it would not have been
possible without the kind support and help of many individuals and
organization. We would to kind to extend our sincere thanks to all of them.
First and foremost, we want to thanks Prof. Chaudhary N.K H.O.D. (IT)
Amrutvahini polytechnic, Sangamner. For giving us an opportunity to work on
this project. We are highly indebted to Prof. M.S.Kurhe (Project guide) for her
guidance and constant supervision as well as for providing Necessary
information regarding the project & also for her support in the Project. We
would like to express our gratitude towards our parents & members of
Information Technology department for their kind co-operation and
encouragement which help us in completion of this our thanks and
appreciations also go to our colleague in developing the project and people
who have willingly helped us with their abilities.

Avhad Jayshree Bhaskar (1800800122)

Bhoknal Sunanda Yadav (1800800113)

Avhad Roshani Rajendra (1800800125)

Chavhan Sayali Dilip (1800800152)

4
INDEX

Sr.no Name Page No

1 Rationale 6

2 Aim/Benefits 6

3 Course outcomes achieved 6

4 Literature Review 6

5 Actual methodology followed 7-25

6 Actual Resource Used 25

7 Output of the micro-project 25-28

8 Skill Developed/Learning Outcome 28

9 Applications 28

10 Conclusion 28

5
Micro-Project Report
MEASUREMENT CONVERTOR

1.0 Rational:-
Measurement Conversion is developed using PHP, CSS, and JavaScript. This
application converts different quantities like Area, Length, Weight, Temperature, volume, and
speed from one unit to another.

2.0 Aims/Benefits of the Micro-Project:-


 Aim:-
Develop measurement convertor using php, html & JavaScript language.
 Benefits:-
This application converts different quantities like Area, Length, Weight,
Temperature, volume, and speed from one unit to another.

3.0 Course Outcomes Addressed:-


a) Develop program using control statement.
b) Perform operations based on arrays and graphics.
c) Develop programs by applying various object oriented concepts.
d) Use form controls with validations to collect users input.

4.0 Literature Review:-


Measurement Conversion is developed using PHP, CSS, and JavaScript. This
application converts different quantities like Area, Length, Weight, Temperature, volume, and
speed from one unit to another. Also, there is some validation used in the project to make it
more attractive and functioning. This project is an interesting useful project.

About the System

Talking about the features of this project, the application is designed to convert
entered numbers from one system/unit to another system/unit. Also, the design of this project
is pretty simple so that the user won’t find any difficulties while working on it. There is some
validation in the project which makes the project more realistic.

6
5.0 Actual methodology:-
CSS FILE:-

/*general*/

html{

height: 100%;

width: 100%;

margin: 0;

padding: 0;

body{

height: 100%;

width: 100%;

padding: 0;

background: #EEE;

font: 18px Georgia, Times, "Times New Roman", Serif;

#main-content{

width: 500px;

margin: 0 auto; padding: 20px 0;

h1{

font: 30px Arial, "Helvetica Neue", Helvetica, Sans-Serif;

/*menu page*/

ul#measurement-types{

list-style-type: none;

margin: 1em 0;

7
padding: 0;

ul#measurement-types li{

height: auto;

margin: 0 0 10px 0;

padding: 0;

ul#measurement-types li a{

text-decoration: none;

color: black;

display: block;

background: white;

padding: 16px 24px;

width: 180px;

border: 1px solid black;

ul#measurement-types li a:hover{

color: white;

background: #FDB912;

/*Conversion forms*/

form label{

display: inline-block;

width: 45px;

form input[type="text"]{

width: 80px;

font-size: 16px;

8
line-height: 16px;

form select{

margin: 1em 0;

font-size: 14px;

form input[type="submit"]{

font-size: 1em;

text-decoration: none;

color: black;

display: block;

background: white;

margin: 2em 0 2em 25px;

padding: 6px 12px;

border: 1px solid black;

form input[type="submit"]:hover{

color: white;

background: #FDB912;

1. FRONT PAGE:-

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<title>Measurement Conversion</title>

<link rel="stylesheet" type="text/css" href="styles.css">

</head>

9
<body>

<div id="main-content">

<h1>Measurement Conversion</h1>

<ul id="measurement-types">

<li><a href="length.php">Length and Distance</a></li>

<li><a href="area.php">Area</a></li>

<li><a href="volume.php">Volume and Capacity</a></li>

<li><a href="mass.php">Mass and Weight</a></li>

<li><a href="speed.php">Speed</a></li>

<li><a href="temperature.php">Temperature</a></li>

</ul>

</div>

</body>

</html>

2. FUNCTION:-

<?php

const LENGTH_TO_METER = array(

"inches" => 0.0254,

"feet" => 0.3048,

"yards" => 0.9144,

"miles" => 1609.344,

"millimeters" => 0.001,

"centimeters" => 0.01,

"meters" => 1,

"kilometers" => 1000,

"acres" => 63.614907234075,

"hectares" => 100,

"nautical_miles" => 1852

10
);

const VOLUME_TO_LITER = array(

"cubic_inches" => 0.0163871,

"cubic_feet" => 28.3168,

"cubic_centimeters" => 0.001,

"cubic_meters" => 1000,

"imperial_gallons" => 4.54609,

"imperial_quarts" => 1.13652,

"imperial_pints" => 0.568261,

"imperial_cups" => 0.284131,

"imperial_ounces" => 0.0284131,

"imperial_tablespoons" => 0.0177582,

"imperial_teaspoons" => 0.00591939,

"us_gallons" => 3.78541,

"us_quarts" => 0.946353,

"us_pints" => 0.473176,

"us_cups" => 0.24,

"us_ounces" => 0.0295735,

"us_tablespoons" => 0.0147868,

"us_teaspoons" => 0.00492892,

"liters" => 1,

"milliliters" => 0.001,

);

const MASS_TO_KILOGRAM = array(

"ounces" => 0.0283495,

"pounds" => 0.453592,

"stones" => 6.35029,

"long_tons" => 1016.05,

11
"short_tons" => 907.185,

"milligrams" => 0.000001,

"grams" => 0.001,

"kilograms" => 1,

"metric_tonnes" => 1000

);

function optionize($string) {

return str_replace(' ', '_', strtolower($string));

function float_to_string($float, $precision=10) {

$float = (float) $float;

$string = number_format($float, $precision, '.', '');

$string = rtrim($string, '0');

$string = rtrim($string, '.');

return $string;

// Length

function convert_to_meters($value, $from_unit) {

if(array_key_exists($from_unit, LENGTH_TO_METER)) {

return $value * LENGTH_TO_METER[$from_unit];

} else {

return "Unsupported unit.";

function convert_from_meters($value, $to_unit) {

if(array_key_exists($to_unit, LENGTH_TO_METER)) {

return $value / LENGTH_TO_METER[$to_unit];

} else {

12
return "Unsupported unit.";

}}

function convert_length($value, $from_unit, $to_unit) {

$meter_value = convert_to_meters($value, $from_unit);

$new_value = convert_from_meters($meter_value, $to_unit);

return $new_value;

// Area

function convert_to_square_meters($value, $from_unit) {

$from_unit = str_replace('square_', '', $from_unit);

if(array_key_exists($from_unit, LENGTH_TO_METER)) {

return $value * pow(LENGTH_TO_METER[$from_unit], 2);

} else {

return "Unsupported unit.";

function convert_from_square_meters($value, $to_unit) {

$to_unit = str_replace('square_', '', $to_unit);

if(array_key_exists($to_unit, LENGTH_TO_METER)) {

return $value / pow(LENGTH_TO_METER[$to_unit], 2);

} else {

return "Unsupported unit.";

}}

function convert_area($value, $from_unit, $to_unit) {

$meter_value = convert_to_square_meters($value, $from_unit);

$new_value = convert_from_square_meters($meter_value, $to_unit);

return $new_value;

13
// Volume

function convert_to_liters($value, $from_unit) {

if(array_key_exists($from_unit, VOLUME_TO_LITER)) {

return $value * VOLUME_TO_LITER[$from_unit];

} else {

return "Unsupported unit.";

function convert_from_liters($value, $to_unit) {

if(array_key_exists($to_unit, VOLUME_TO_LITER)) {

return $value / VOLUME_TO_LITER[$to_unit];

} else {

return "Unsupported unit.";

function convert_volume($value, $from_unit, $to_unit) {

$liter_value = convert_to_liters($value, $from_unit);

$new_value = convert_from_liters($liter_value, $to_unit);

return $new_value;

// Mass

function convert_to_kilograms($value, $from_unit) {

if(array_key_exists($from_unit, MASS_TO_KILOGRAM)) {

return $value * MASS_TO_KILOGRAM[$from_unit];

} else {

return "Unsupported unit.";

14
function convert_from_kilograms($value, $to_unit) {

if(array_key_exists($to_unit, MASS_TO_KILOGRAM)) {

return $value / MASS_TO_KILOGRAM[$to_unit];

} else {

return "Unsupported unit.";

function convert_mass($value, $from_unit, $to_unit) {

$kg_value = convert_to_kilograms($value, $from_unit);

$new_value = convert_from_kilograms($kg_value, $to_unit);

return $new_value;

// Speed

function convert_speed($value, $from_unit, $to_unit) {

if($from_unit == 'knots') { $from_unit = 'nautical_miles_per_hour'; }

if($to_unit == 'knots') { $to_unit = 'nautical_miles_per_hour'; }

list($from_dist, $from_time) = explode('_per_', $from_unit);

list($to_dist, $to_time) = explode('_per_', $to_unit);

if($from_time == 'hour') { $value /= 3600; }

$value = convert_length($value, $from_dist, $to_dist);

if($to_time == 'hour') { $value *= 3600; }

return $value;

// Temperature

function convert_to_celsius($value, $from_unit) {

switch($from_unit) {

case 'celsius':

return $value;

15
break;

case 'fahrenheit':

return ($value - 32) / 1.8;

break;

case 'kelvin':

return $value - 273.15;

break;

default:

return "Unsupported unit.";

function convert_from_celsius($value, $to_unit) {

switch($to_unit) {

case 'celsius':

return $value;

break;

case 'fahrenheit':

return ($value * 1.8) + 32;

break;

case 'kelvin':

return $value + 273.15;

break;

default:

return "Unsupported unit."; }

function convert_temperature($value, $from_unit, $to_unit) {

$celsius_value = convert_to_celsius($value, $from_unit);

$new_value = convert_from_celsius($celsius_value, $to_unit);

16
return $new_value;

}?>

3. LENGTH AND DISTANCE:-

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<title>Measurement Conversion</title>

<link rel="stylesheet" type="text/css" href="styles.css">

</head>

<body>

<div id="main-content">

<h1>Measurement Conversion</h1>

<ul id="measurement-types">

<li><a href="length.php">Length and Distance</a></li>

<li><a href="area.php">Area</a></li>

<li><a href="volume.php">Volume and Capacity</a></li>

<li><a href="mass.php">Mass and Weight</a></li>

<li><a href="speed.php">Speed</a></li>

<li><a href="temperature.php">Temperature</a></li>

</ul>

</div>

</body>

</html>

4. AREA:-

<!DOCTYPE html>

<html>

<head>

17
<meta charset="UTF-8">

<title>Convert Area</title>

<link href="styles.css" rel="stylesheet" type="text/css">

</head>

<body>

<div id="main-content">

<h1>Convert Area</h1>

<form action="" method="post">

<div class="entry">

<label>From:</label>&nbsp;

<input type="text" name="from_value" value="" />&nbsp;

<select name="from_unit">

<option value="square_inches">square inches</option>

<option value="square_feet">square feet</option>

<option value="square_yards">square yards</option>

<option value="square_miles">square miles</option>

<option value="square_millimeters">square millimeters</option>

<option value="square_centimeters">square centimeters</option>

<option value="square_meters">square meters</option>

<option value="square_kilometers">square kilometers</option>

<option value="acres">acres</option>

<option value="hectares">hectares</option>

</select>

</div>

<div class="entry">

<label>To:</label>&nbsp;

<input type="text" name="to_value" value="0" />&nbsp;

<select name="to_unit">

18
<option value="square_inches">square inches</option>

<option value="square_feet">square feet</option>

<option value="square_yards">square yards</option>

<option value="square_miles">square miles</option>

<option value="square_millimeters">square millimeters</option>

<option value="square_centimeters">square centimeters</option>

<option value="square_meters">square meters</option>

<option value="square_kilometers">square kilometers</option>

<option value="acres">acres</option>

<option value="hectares">hectares</option>

</select>

</div>

<input type="submit" name="submit" value="Submit" />

</form>

<br />

<a href="index.php">Return to menu</a>

</div>

</body>

</html>

5. VOLUME AND CAPACITY:-

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>Convert Volume</title>

<link href="styles.css" rel="stylesheet" type="text/css">

</head>

<body>

19
<div id="main-content">

<h1>Convert Volume</h1>

<form action="" method="post">

<div class="entry">

<label>From:</label>&nbsp;

<input type="text" name="from_value" value="" />&nbsp;

<select name="from_unit">

<option value="cubic_inches">cubic inches</option><option


value="cubic_feet">cubic feet</option><option value="imperial_gallons">Imperial
gallons</option><option value="imperial_quarts">Imperial quarts</option><option
value="imperial_pints">Imperial pints</option><option value="imperial_cups">Imperial
cups</option><option value="imperial_ounces">Imperial ounces</option><option
value="imperial_tablespoons">Imperial tablespoons</option><option
value="imperial_teaspoons">Imperial teaspoons</option><option value="us_gallons">US
gallons</option><option value="us_quarts">US quarts</option><option
value="us_pints">US pints</option><option value="us_cups">US cups</option><option
value="us_ounces">US ounces</option><option value="us_tablespoons">US
tablespoons</option><option value="us_teaspoons">US teaspoons</option><option
value="cubic_centimeters">cubic centimeters</option><option value="cubic_meters">cubic
meters</option><option value="liters">liters</option><option
value="milliliters">milliliters</option> </select>

</div>

<div class="entry">

<label>To:</label>&nbsp;

<input type="text" name="to_value" value="0" />&nbsp;

<select name="to_unit">

<option value="cubic_inches">cubic inches</option><option


value="cubic_feet">cubic feet</option><option value="imperial_gallons">Imperial
gallons</option><option value="imperial_quarts">Imperial quarts</option><option
value="imperial_pints">Imperial pints</option><option value="imperial_cups">Imperial
cups</option><option value="imperial_ounces">Imperial ounces</option><option
value="imperial_tablespoons">Imperial tablespoons</option><option
value="imperial_teaspoons">Imperial teaspoons</option><option value="us_gallons">US
gallons</option><option value="us_quarts">US quarts</option><option
value="us_pints">US pints</option><option value="us_cups">US cups</option><option
value="us_ounces">US ounces</option><option value="us_tablespoons">US
tablespoons</option><option value="us_teaspoons">US teaspoons</option><option

20
value="cubic_centimeters">cubic centimeters</option><option value="cubic_meters">cubic
meters</option><option value="liters">liters</option><option
value="milliliters">milliliters</option> </select>

</div>

<input type="submit" name="submit" value="Submit" />

</form>

<br />

<a href="index.php">Return to menu</a>

</div>

</body>

</html>

6. MASS AND WEIGHT:-

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>Convert Mass</title>

<link href="styles.css" rel="stylesheet" type="text/css">

</head>

<body>

<div id="main-content">

<h1>Convert Mass</h1>

<form action="" method="post">

<div class="entry">

<label>From:</label>&nbsp;

<input type="text" name="from_value" value="" />&nbsp;

<select name="from_unit">

<option value="ounces">ounces</option><option
value="pounds">pounds</option><option value="stones">stones</option><option
value="long_tons">long tons</option><option value="short_tons">short

21
tons</option><option value="milligrams">milligrams</option><option
value="grams">grams</option><option value="kilograms">kilograms</option><option
value="metric_tonnes">metric tonnes</option> </select>

</div>

<div class="entry">

<label>To:</label>&nbsp;

<input type="text" name="to_value" value="0" />&nbsp;

<select name="to_unit">

<option value="ounces">ounces</option><option
value="pounds">pounds</option><option value="stones">stones</option><option
value="long_tons">long tons</option><option value="short_tons">short
tons</option><option value="milligrams">milligrams</option><option
value="grams">grams</option><option value="kilograms">kilograms</option><option
value="metric_tonnes">metric tonnes</option> </select>

</div>

<input type="submit" name="submit" value="Submit" />

</form>

<br />

<a href="index.php">Return to menu</a>

</div>

</body>

</html>

7. SPEED:-

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>Convert Speed</title>

<link href="styles.css" rel="stylesheet" type="text/css">

</head>

<body>

22
<div id="main-content">

<h1>Convert Speed</h1>

<form action="" method="post">

<div class="entry">

<label>From:</label>&nbsp;

<input type="text" name="from_value" value="" />&nbsp;

<select name="from_unit">

<option value="feet_per_second">feet per second</option><option


value="miles_per_hour">miles per hour</option><option
value="meters_per_second">meters per second</option><option
value="kilometers_per_hour">kilometers per hour</option><option
value="knots">knots</option> </select>

</div>

<div class="entry">

<label>To:</label>&nbsp;

<input type="text" name="to_value" value="0" />&nbsp;

<select name="to_unit">

<option value="feet_per_second">feet per second</option><option


value="miles_per_hour">miles per hour</option><option
value="meters_per_second">meters per second</option><option
value="kilometers_per_hour">kilometers per hour</option><option
value="knots">knots</option> </select>

</div>

<input type="submit" name="submit" value="Submit" />

</form>

<br />

<a href="index.php">Return to menu</a>

</div>

</body>

</html>

8. TEMPRATURE:-

23
<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>Convert Temperature</title>

<link href="styles.css" rel="stylesheet" type="text/css">

</head>

<body>

<div id="main-content">

<h1>Convert Temperature</h1>

<form action="" method="post">

<div class="entry">

<label>From:</label>&nbsp;

<input type="text" name="from_value" value="" />&nbsp;

<select name="from_unit">

<option value="celsius">Celsius</option><option
value="fahrenheit">Fahrenheit</option><option value="kelvin">Kelvin</option>
</select>

</div>

<div class="entry">

<label>To:</label>&nbsp;

<input type="text" name="to_value" value="0" />&nbsp;

<select name="to_unit">

<option value="celsius">Celsius</option><option
value="fahrenheit">Fahrenheit</option><option value="kelvin">Kelvin</option>
</select>

</div>

<input type="submit" name="submit" value="Submit" />

</form>

<br />

24
<a href="index.php">Return to menu</a>

</div>

</body>

</html>

6.0 Actual Resource Used:-

S. Name of Specification Qty. Remarks


No. Resource/Material
1) Laptop Intel (R) Core i3- 4GB RAM 1 -

2) Operating system Windows 10 1 -

3) Software Tool Visual Studio Code 1 -


,XAMPP Server

7.0 Outputs of Micro- project:-

25
26
27
8.0 Skill Developed:-

1) Able to prepared code.

2) Able to face errors, defects And Faults.

9.0 Application of this Micro - Project:-

1) Easy to use

2) Easy to convert one unit to another unit.

Conclusion

In this project we have learnt conversion of measurements using php language.


We also able to solve errors of code and execute it successfully.

28

You might also like