Need Help on Coding Assignment

Basically My assignment is to put everything into different functions. I successfully got Jedi_message to work but can not get hello_world to work. The code just shuts itself down. Basically I need hello_world to become its own function so that total reads the correct number and returns the correct number. Thank you so much.
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>
    using namespace std;
    double hello_world();
    void Jedi_message ()
        {


         cout << "Welcome to my fabulous Jedi power level calculator!" << endl
         << "This program will take your age, weight, and" << endl
         << "midichlorean count and return your Jedi power level!"
         << endl << endl;
        }

    int main()
    {
        double total;
        total = hello_world();
        double jedi_level;

        int age;
        int weight;
        int mcc;

        Jedi_message();
        hello_world();

        // TODO - write a function that will prompt the user for his/her age,
        // weight, and midicholrean count. Then calculate and return their
        // jedi level (returns a double). Remember to assign the retuned value
        // to the variable 'jedi_level'.



        // this should remain inside your main function
        cout << "Your Jedi Level is : " << total;

        return 0;
}

        double hello_world()
        {
        double total;
        total = hello_world();
        double jedi_level;

        int age;
        int weight;
        int mcc;
        cout << "please enter your age : ";
        cin >> age;
        cout << "please enter your weight : ";
        cin >> weight;
        cout << "please enter your midicholrean count : ";
        cin >> mcc;
        total = static_cast <double>(mcc * age) / (weight * weight);
        return total;
        }
1
2
3
4
double hello_world()
{
        double total;
        total = hello_world();
¿what value do you think that `total' should have there?
Topic archived. No new replies allowed.