Project Description
There are two main systems for measuring distance, weight and temperature, the Imperial System of Measurement and the Metric System of Measurement. Most countries use the Metric System, which uses the measuring units such as meters and grams and adds prefixes like kilo, milli and centi to count orders of magnitude. In the United States, we use the older Imperial system, where things are measured in feet, inches and pounds.
Write a program that shows the following menu options and lets the user to convert from Metric to Imperial system:
Converter Toolkit
--------------------
1. Temperature Converter
2. Distance Converter
3. Weight Converter
4. Quit
Project Specifications
Input for this project:
Input Validation:
Output: The program should display the following:
Processing Requirements
F = (9/5)*C + 32 where F is the temperature in Fahrenheit and C is the temperature in Celsius
Plz give the code and flow chart, thank you so much!!!
Flow chart:
Source code ( C++):
#include<iostream>
#include<conio.h>
#include<stdio.h>
using namespace std;
void main()
{
int choice;
float c,d,k,m,f,p;//c-temperature in
celcius,d-distance in kilometer,k-weight in kilogram,m-distance in
miles,f-temperature in fahrenheit
do //loop to make the program a menudriven
program
{
cout<<"\nChoose the option
from the given below\n";//choice dispaly
cout<<"1. Temperature
Converter\n";
cout<<"2. Distance
Converter\n";
cout<<"3. Weight
Converter\n";
cout<<"4. Quit\n";
cin>>choice;
switch(choice)
{
case 1: //to convert temperature in
fahrenheit
cout<<"\nEnter the temperature in celcius\n";
cin>>c;
f=((9.0/5)*c)+32;
cout<<"\nTemperature in fahrenheit is "<<f;
break;
case 2: //to convert distance in
miles
cout<<"\nEnter the distance in kilometers\n";
cin>>d;
m=d*0.6;
cout<<"\nDistance in mile is "<<m;
break;
case 3: // to convert weight in
pound
cout<<"\nEnter the weight in kilogram\n";
cin>>k;
p=k*2.2;
cout<<"\nWeight in pounds is "<<p;
break;
case 4: // to quit
break;
default : // for wrong input
cout<<"\nEntered a wrong choice";
}
}while(choice!=4);
}
Get Answers For Free
Most questions answered within 1 hours.