02-16-2021, 08:01 AM
(This post was last modified: 02-16-2021, 10:54 AM by Firebolt391d.)
This was a question asked at the beginning of my high school Computer Programming class.
//A subroutine to put Mayonnaise on one slice of the sandwich, with parameter of Mayo Density constant
Void PuttingMayoOnSandwich(int mayoDensityNum) {
if (mayo_is_on_bread == false) {
}
if (mayo_is_on_knife == false) {
dipKnifeIntoMayo();
mayo_is_on_knife = true;
} else {
while (mayoDesnity < mayoDensityNum) {
rubKnifeAcrossBread()
mayoDensity = checkMayoDensity()
}
} //end nested if
} //end main if
} //end subroutine
//A subroutine to put Mayonnaise on one slice of the sandwich, with parameter of Mayo Density constant
Void PuttingMayoOnSandwich(int mayoDensityNum) {
if (mayo_is_on_bread == false) {
}
if (mayo_is_on_knife == false) {
dipKnifeIntoMayo();
mayo_is_on_knife = true;
} else {
while (mayoDesnity < mayoDensityNum) {
rubKnifeAcrossBread()
mayoDensity = checkMayoDensity()
}
} //end nested if
} //end main if
} //end subroutine
