This is the presentation of a program made by me and my friend Shoaib Khan, This program is written in C Language. If you want the copy of this program write me...
2.
Presented to:
Miss Farah Nawaz
Computer Science Department
Newports Institute of Communication and Economics
Presented by:
Muhammad Shoaib
Zuhaib Ali
Coerce :
Programming Techniques 1
Fall 2013
3. CONVERTER
We have created a program “converter”.
The program is written in C Language.
That can converter Temperature, Time and Length.
7. SWITCH CASE
We have used a “Switch Case” in this program. And
give 4 cases.
Switch Case
Case 1 - Temperature
Case 2 - Time
Case 3 - Length
Case 4 - Exit
8. IF FUNCTION
In first 3 case we used
“If function”.
Temperature
If Celsius
Else if Fahrenheit
Else if Kelvin
Time
If Day
Else if Hour
Else if Minute
Else if Second
Length
If Centimeter
Else if Foot
Else if Inch
Else if Meter
9. CUSTOM FUNCTION
We have created 11 custom functions in our program.
Temperature
Time
Celsius to all
Fahrenheit to all
Kelvin to all
Day to all
Hour to all
Minute to all
Second to all
Length
Centimeter to all
Foot to all
Inch to all
Meter to all
10. EXAMPLE OF CUSTOM FUNCTION
CelsiusToAll()
{
float Celsius,Fahrenheit,Kelvin;
clrscr();
printf("Enter Temperature in Celsius: ");
scanf("%f",&Celsius);
Fahrenheit=(1.8*Celsius)+32;
Kelvin=(Celsius+273.15);
printf("nTemperature in Fahrenheit : %.3f", Fahrenheit);
printf("nTemperature in Kelvin : %.3fn", Kelvin);
system("pause");
return 0;
}
14. FORMULAS
The formulas used for temperature conversations in
this program are:
From
Temperature
Fahrenheit
Kelvin
Celsius
To
Celsius
=
(Fahrenheit-32)/1.8
Kelvin-273.15
Fahrenheit
Celsius*1.8
=
(Kelvin*1.8)-459.67
Kelvin
Celsius+273.15
(Fahrenheit+459.67)/1.8
=
15. RESULT
After selecting the input unit program the program
ask to enter temperature in selected unit and
calculate the result in other units and print it.
Example:
18. FORMULAS
The formulas used for time conversations in this
program are
From
Time
Hours
Minutes
Seconds
Days
=
Hours/24
Minutes/60/24
Seconds/60/60/24
Hours
Days*24
=
Minutes/60
Seconds/60/60
Minutes
Days*24*60
Hours*60
=
Seconds/60
Seconds
Days*24*60*60
Hours*60*60
Minutes*60
=
To
Days
19. RESULT
After selecting the input unit program the program
ask to enter time in selected unit and calculate the
result in other units and print it.
Example:
22. FORMULAS
The formulas used for Length conversations in this
program are:
From
Length
Foot
Inch
Meter
Centimet
er
=
Foot*30.48
Inch/0.3937
Meter*100
Foot
Centimeter*0.033
=
Inch/12
Meter/0.3048
Inch
Centimeter*0.398
Foot*12
=
Meter/0.0254
Meter
Centimeter*100
Foot*0.3048
Inch/39.37
=
To
Centimeter
23. RESULT
After selecting the input unit program the program
ask to enter Length in selected unit and calculate
the result in other units and print it.
Example: