#C7665. Slot Machine Scoring Challenge
Slot Machine Scoring Challenge
Slot Machine Scoring Challenge
In this challenge, you are required to simulate a slot machine spin with three reels. Each reel displays one symbol that can be one of the following: cherry, lemon, orange, plum, bell, or bar. The scoring works as follows: if all three reels show the same symbol, the player wins a fixed number of points based on the symbol – otherwise, the score is 0.
The scoring rules are given by the following formulas in \( \LaTeX \) format:
- \( \text{if } reel1 = reel2 = reel3 = \text{'cherry'} \Rightarrow 50 \text{ points}\)
- \( \text{if } reel1 = reel2 = reel3 = \text{'bell'} \Rightarrow 30 \text{ points}\)
- \( \text{if } reel1 = reel2 = reel3 = \text{'plum'} \Rightarrow 20 \text{ points}\)
- \( \text{if } reel1 = reel2 = reel3 = \text{'orange'} \Rightarrow 10 \text{ points}\)
- \( \text{if } reel1 = reel2 = reel3 = \text{'lemon'} \Rightarrow 5 \text{ points}\)
Your task is to implement a program which reads the symbols from standard input and prints out the corresponding score to standard output.
inputFormat
The input consists of exactly three strings separated by whitespace (spaces or newlines). Each string represents the symbol on a reel.
outputFormat
Output a single integer which is the score computed based on the slot machine rules.
## samplecherry cherry cherry
50