Updating!!

Hey, could any one possibly help me with;

updating say, a users weight.?
Feed them lots of chocolate?

You'll need to provide a bit more context and, preferably, a bit of code as well.
Haha!

im creating a BMI calculator which i need to display and also to update the users weight.

im using
if (myChoice ==2) {

}
im just uncertain on what code to use to make this work
What do you want if choice 2 is entered?

Do you want the user to enter a new weight? Or a weight to be calculated from some existing variables? Or something else?
oh yeah sorry.

I want the user to be able to enter a new weight
Something like this, then?

1
2
3
4
5
6
if( choice == 2 )
{
    std::cout << "Enter new weight: ";
    std::cin >> weight_lbs;
    std::cout << "New weight is " << weight_lbs << "lbs\n";
}


Assuming that weight_lbs has already been declared. Note, there's no validation there, either. There's nothing to stop the user from typing 'bananas' and the program accepting it.
okay thank you for that. i'll try it out!

thanks again!
Topic archived. No new replies allowed.