← 2023 questions

2023 / INSTAGRAM / QUESTION 1

Restaurant reviews

Try the question in your own editor, then check your output below.

THE QUESTION

Finnick has an Instagram account where he posts restaurant reviews. For consistency, every post he makes follows the format (variables)

Restaurant Name:

Location:

Dish 1:

Dish 1 Rating:

Dish 2:

Dish 2 Rating:

Would I return:

Finnick recently visited a restaurant with the following details

Nobu

Four Seasons Hotel Kuala Lumpur

Kanpachi Sashimi Salad

7.5

Crispy Soft Shell Crab with Ponzu

8.3

Write a program that allows Finnick to input these details into the stated variables. For the "Would I return variable", it should output yes if the total rating of dish 1 and dish 2 is 12 or higher.

The final output should look like this:

Restaurant Name:Nobu
Location:Four Seasons Hotel Kuala Lumpur
Dish 1:Kampachi Sashimi Salad
Dish 1 rating:7.5
Dish 2:Crispy Soft Shell Crab with Ponzu
Dish 2 rating:8.3
Would I return? ???

(??? is to indicate that you have to find out what the correct output is

Question by Elena. Source: Girls In Code SEA — Behind the Screens, 2023, slide 15.

PRACTICE CHECK

Try your answer.

This checks the return decision; the full exercise also asks you to format the restaurant review.

Run your program in your own editor, then paste its output below. This checks the stated output or checkpoint; it does not assess your full program. Practice attempts do not affect competition scores.

Enter only yes or no.

Reveal worked answer

Would I return?

yes

7.5 + 8.3 = 15.8, which is at least 12.