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.
#include <iostream>
usingnamespace 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;
}