switch metric

i need to do a conversion using the metric system and I'm having trouble inputing the proper format for a switch statement. please help

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include <iostream>
#include <cmath>
using namespace std;


int main()
{
    int answer;
    // function prototypes
    int menu(int answer);
    // These are to make sure there's a separate function call for each menu choice
    int lenght(int answer);
    int weight(int answer);
    int volume(int answer);



    {
        cout << "Pick a choice from the list";
        cout << "1. will convert lenght;kilometers to miles ";
        cout <<"2. will convert weight; lbs to ounces";
		cout <<"3. will conver liters to u.s. gallons";
        cin >> answer;

        menu(answer);

         }
}

int menu(int answer)
{
    switch (answer)
    {
        case '1' :
           cout << "Enter kilo to convert to miles"; 
        	cin >> lenght;
           lenght = lenght * 0.62137;
            break;

        case '2' :
            cout << "Enter lbs to convert to ounces";
        	cin >> weight;
            weight(weight * 16.000);
           cout << "new onces is" << lenght << endl; 
            break;

        case '3' :
            volume(volume * 0.26417);
            cin
            break;

        default:
            cout << "" << endl;
    }
    
}
Topic archived. No new replies allowed.