Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Java program D(4 point) Suppose salty and spicy are variables of type boolean. Write an if-else statement that does two things if these variables are
Java program
D(4 point) Suppose salty and spicy are variables of type boolean. Write an if-else statement that does two things if these variables are both true: it outputs the String "I do not like spicy and salty food" and changes the value of tip to 0.0. Otherwise it checks to see if salty is false and spicy is true and outputs in this case the string "I do not like spicy food" and sets tip to 0.05. If this did not happen it then checks to see if salty is true and spiey is false and in this case it outputs the string "I do not like salty food" and again sets tip to 0.05. If neither spicy nor salty is true then it outputs the string "I like this food" and sets tip to 0.15 Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started