Solution: Fix the Code
This lesson provides a solution to the challenge given in the previous lesson.
We'll cover the following...
You were given the following code to fix:
Press + to interact
import std.stdio;void main() {bool existsLemonade = true;if (existsLemonade) {writeln("Drinking lemonade");writeln("Washing the cup");} elsewriteln("Eating pie");writeln("Washing the plate");}
Solution #
Here is the fixed code that generates the desired output.
Press + to interact
import std.stdio;void LemonadeOrPie() {bool existsLemonade = true;if (existsLemonade) {writeln("Drinking lemonade");writeln("Washing the cup");} else {writeln("Eating pie");writeln("Washing the plate");}}
...