← 2023 questions

2023 / TIKTOK / QUESTION 13

Playback speed

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

THE QUESTION

Sofea is scrolling through TikTok and wants to change the speed on the videos she watches. Write a program that prompts her to input either 0.75, 1.0, 1.25, 1.5, 2.0 and prints a success message.

Example of output:

Which speed? (0.75, 1.0, 1.25, 1.5, 2.0) 1.25
Speed change successful, now playing at 1.25x speed.

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

CHECK YOUR ANSWER

Try your answer.

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

Use the example input 1.25. Submit the success message only.

Reveal worked answer

Speed confirmation

Speed change successful, now playing at 1.25x speed.

Validate the speed against the allowed list, then insert 1.25 into the confirmation message.