Only the first if statement if being fulfilled. How can I make the program check if all if statements are true and execute them if they are?

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Only the first if statement if being fulfilled. How can I make the program check if all if statements are true and execute them if they are?

private double Price()
{
double a = 0; double b = 0; double c = 0; doubled = 0; double e = 0; double f = 0; double g = 0; double h = 0; double i = 0;
if (radioButtonSmall.Checked) { a = 99.95; }
else if (radioButtonMedium.Checked) {b = 125.75; }
else if (radioButtonLarge.Checked) { c = 250.40; }
else if (radioButtonThick.Checked) { d = 25.50; }
else if (checkBoxExtraCheese.Checked) { e = 15.00; }
else if (checkBoxSausage.Checked) { f = 25.00; }
else if (checkBoxPepperoni.Checked) { g = 30.00; }
else if (checkBoxMushroom.Checked) { h = 40.00; }
else if (checkBoxOnion.Checked) { i = 10.00; }
double price
return price;
a + b + c + d + e + f + g + h + i;
Transcribed Image Text:private double Price() { double a = 0; double b = 0; double c = 0; doubled = 0; double e = 0; double f = 0; double g = 0; double h = 0; double i = 0; if (radioButtonSmall.Checked) { a = 99.95; } else if (radioButtonMedium.Checked) {b = 125.75; } else if (radioButtonLarge.Checked) { c = 250.40; } else if (radioButtonThick.Checked) { d = 25.50; } else if (checkBoxExtraCheese.Checked) { e = 15.00; } else if (checkBoxSausage.Checked) { f = 25.00; } else if (checkBoxPepperoni.Checked) { g = 30.00; } else if (checkBoxMushroom.Checked) { h = 40.00; } else if (checkBoxOnion.Checked) { i = 10.00; } double price return price; a + b + c + d + e + f + g + h + i;
! Menu
O X
Your pizza options?
Hot
PIZZA
Size
Crust
O Small
O Medium
O Large
O Thin
O Thick
Toppings?
Extra Cheese
Sausage
Рepperoni
Mushroom
Onion
V Delivery
Order Summary
No.
Size & Crust
Toppings
Deliver
Price
One small thin crust pizza
1
with extra cheese
for delivery
99.95
TOTAL COST (12% VAT included)
Clear
Add Order
Compute Order
Print Receipt
Back To Main
Transcribed Image Text:! Menu O X Your pizza options? Hot PIZZA Size Crust O Small O Medium O Large O Thin O Thick Toppings? Extra Cheese Sausage Рepperoni Mushroom Onion V Delivery Order Summary No. Size & Crust Toppings Deliver Price One small thin crust pizza 1 with extra cheese for delivery 99.95 TOTAL COST (12% VAT included) Clear Add Order Compute Order Print Receipt Back To Main
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY