Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Basic Beginning Computer Science Question- Write a method dateNight that takes an argument representing the amount of money in dollars in your pocket. You are

Basic Beginning Computer Science Question-

"Write a method dateNight that takes an argument representing the amount of money in dollars in your pocket. You are treating someone to a date at a restaurant. Entrees are $20 apiece, appetizers are $10, and desserts are $7.50. You want to buy two entrees, an appetizer, and a dessert. You won't buy anything and will leave the restaurant if you can't afford the two entrees. Otherwise, you will buy them. If you can also afford an appetizer, you will buy that, and if you can afford a dessert at that point, you will buy that (whether or not you could afford the appetizer). Return a number equal to how much money you will have remaining after following the above plan (assume no tax, tip, or other fees)."

I am a little confused on how to even start this question. The test says it must be a "public static double" but I wanted to use a bunch of if statements so I guess that wouldn't work. Thank you!

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_2

Step: 3

blur-text-image_3

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

Database Systems Design Implementation And Management

Authors: Peter Robb,Carlos Coronel

5th Edition

061906269X, 9780619062699

More Books

Students also viewed these Databases questions

Question

What were the issues and solutions proposed by each team?

Answered: 1 week ago

Question

Were all members comfortable brainstorming in front of each other?

Answered: 1 week ago

Question

5. What information would the team members need?

Answered: 1 week ago