mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
changed svn layout
git-svn-id: svn://ultimatepp.org/upp/trunk@281 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
commit
263ff5f895
2665 changed files with 642923 additions and 0 deletions
36
reference/EscApp/script.esc
Normal file
36
reference/EscApp/script.esc
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
getnumber()
|
||||
{
|
||||
for(;;) {
|
||||
h = InputNumber();
|
||||
if(h > 0)
|
||||
return h;
|
||||
Print("Please enter a positive number!\n");
|
||||
}
|
||||
}
|
||||
|
||||
main() {
|
||||
Print("What is your name?\n");
|
||||
name = Input();
|
||||
Print("Hi " + name + "!\n");
|
||||
Print("How tall are you? (in cm please!)\n");
|
||||
h = getnumber();
|
||||
Print("What is your weight? (in kg please!)\n");
|
||||
w = getnumber();
|
||||
bmi = w / (h * h / 10000);
|
||||
Print("Your body mass index is " + to_string(bmi) + "\n");
|
||||
Print(name + ", ");
|
||||
if(bmi >= 35)
|
||||
Print("you are morbidly fat!!!");
|
||||
else
|
||||
if(bmi >= 30)
|
||||
Print("you are fat!!!");
|
||||
else
|
||||
if(bmi >= 25)
|
||||
Print("you are overweight!");
|
||||
else
|
||||
if(bmi >= 18.5)
|
||||
Print("your weight is OK.");
|
||||
else
|
||||
Print("your are too slim!");
|
||||
Print("\nThanks for a nice chat!\n");
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue