Answered step by step
Verified Expert Solution
Link Copied!

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
image text in transcribed
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro Oracle Fusion Applications Installation And Administration

Authors: Tushar Thakker

1st Edition

1484209834, 9781484209837

More Books

Students also viewed these Databases questions

Question

Ty e2y Evaluate the integral dy

Answered: 1 week ago