Nesting of conditional statements

Nesting of conditional statements

Ok the first thing I did here was setting a variable to store the input given by the user, depending on the user’s answer is the course of action of the program, basically if the user says they do want pizza they get sent to the first if statement, which then asks them which flavour of pizza they prefer, after that the program responds as I’d probably react, because pepperoni pizza is way too overrated in my opinion, else hawaiian pizza is for cool risk takers like me to be honest, and I need more people who can handle pineapple on a pizza in my life. Finally, if the user says they don’t want any pizza in the first place they get sent to the else statement that asks them if they’re okay.

Pretty simple way of understanding the logic of nesting conditionals, so you’re welcome I guess.

Nesting of conditional statements

CC BY 4.0 Nesting of conditional statements by tywins is licensed under a Creative Commons Attribution 4.0 International License.

Comments are closed.