Nested Conditional Execution
📖 Scenario: You are creating a simple program to help a coffee shop decide the price of a coffee order based on the size and whether the customer wants extra syrup.
🎯 Goal: Build a program that uses nested if statements to determine the final price of a coffee order based on size and syrup option.
📋 What You'll Learn
Create a variable
size with the exact value "medium".Create a variable
extraSyrup with the exact value true.Use nested
if statements to set the price variable based on size and extraSyrup.Print the final price using
Console.WriteLine.💡 Why This Matters
🌍 Real World
Coffee shops and many other businesses use nested conditions to calculate prices based on options customers choose.
💼 Career
Understanding nested conditional execution is essential for programming tasks like pricing, form validation, and decision-making in software.
Progress0 / 4 steps