starting with GUI

Carlos checoimg at gmail.com
Tue Apr 30 10:13:01 PDT 2013


Another version of the CLI which tries to keep 1440 minutes for a 
complete day ( this is desired on the GUI ) is :

"
import std.stdio;
import std.c.stdlib;
void main()
{
immutable sitc = 1.66;
immutable sleepc = 1.08;
float tcsleep, tcsit, tc;
int minsleep, minsit;
write("Input minutes sit : \n");
readf(" %d", &minsit);
write("Input minutes sleep : \n");
readf(" %d", &minsleep);
while (minsit+minsleep != 1440){
write("Error 1 \n");
write("Input minutes sit : \n");
readf(" %d", &minsit);
write("Input minutes sleep : \n");
readf(" %d", &minsleep);
}
if (minsit+minsleep == 1440){
tcsit = minsleep*sleepc;
tcsleep = minsit*sitc;
tc = (tcsleep + tcsit);
write("Your calories per day is : ", tc, "\n");
exit (0);
}
}
"


More information about the Digitalmars-d-learn mailing list