The Westland Game Fair is the premier event of its kind for kids interested in some intellectual and cognitive brain games. Exciting games were organized for kids between the ages of 8 and 10.One such game was called the "Triangle game", where different number boards in the range of 1 to 180 are available. Each kid needs to select three number boards, where the numbers on the boards correspond to the angles of a triangle.If the angles selected by a kid form a triangle, he/she would receive Prize 1. If the angles selected by a kid form a right triangle, he/she would receive Prize 2. If the angles selected by the kids form an equilateral triangle, he/she would receive Prize 3. If the angles selected by a kid do not form even a triangle, then he/she will not receive any prizes.Write a program for the organizers to fetch the result based on the number of boards selected by the kids.Input format :There are 3 lines in the input, each of which corresponds to the numbers on the boards that the kids select.Refer to the sample input for formatting specifications.Output format :The output should display Prize 1 or Prize 2 or Prize 3 or No Prize based on the conditions given.Refer to the sample output for formatting specifications.Sample test cases :Input 1 :606060Output 1 :Prize 3Input 2 :904545Output 2 :Prize 2Input 3 :806040Output 3 :Prize 1Input 4 :806080Output 4 :No Prize
Question
The Westland Game Fair is the premier event of its kind for kids interested in some intellectual and cognitive brain games. Exciting games were organized for kids between the ages of 8 and 10.One such game was called the "Triangle game", where different number boards in the range of 1 to 180 are available. Each kid needs to select three number boards, where the numbers on the boards correspond to the angles of a triangle.If the angles selected by a kid form a triangle, he/she would receive Prize 1. If the angles selected by a kid form a right triangle, he/she would receive Prize 2. If the angles selected by the kids form an equilateral triangle, he/she would receive Prize 3. If the angles selected by a kid do not form even a triangle, then he/she will not receive any prizes.Write a program for the organizers to fetch the result based on the number of boards selected by the kids.Input format :There are 3 lines in the input, each of which corresponds to the numbers on the boards that the kids select.Refer to the sample input for formatting specifications.Output format :The output should display Prize 1 or Prize 2 or Prize 3 or No Prize based on the conditions given.Refer to the sample output for formatting specifications.Sample test cases :Input 1 :606060Output 1 :Prize 3Input 2 :904545Output 2 :Prize 2Input 3 :806040Output 3 :Prize 1Input 4 :806080Output 4 :No Prize
Solution
Here is a Python program that will solve the problem:
# Function to check if the angles form a triangle
def is_triangle(a, b, c):
if a + b + c == 180:
return True
else:
return False
# Function to check if the angles form a right triangle
def is_right_triangle(a, b, c):
angles = sorted([a, b, c])
if
Similar Questions
A task where participants push coloured triangles around a board, playing a game that can win them up to £100, is likely to be a good example of high:Question 10Answera.Systematic errorb.Ecological validityc.Experimental realismd.Random error
In a triangle game show, participants are given the three angles of a triangle and they need to guess the type of triangle they form. Your task is to write a program that takes the three angles as input and determines the type of triangle based on the following rules:If the sum of the angles is equal to 180 degrees: If all three angles are equal, the triangle is an equilateral triangle, and the participant wins Prize 3.If any one of the angles is a right angle (90 degrees), the triangle is a right-angled triangle, and the participant wins Prize 2.Otherwise, the triangle is a regular triangle, and the participant wins Prize 1.If the sum of the angles is not equal to 180 degrees, the triangle is invalid, and the participant wins no prize.Complete the program to find the participant's prizes.Input format :The input consists of three integers, angle 1, angle 2, and angle 3, representing the three angles of the triangle.Output format :The output prints a single line containing the corresponding prize.
In a triangle game show, participants are given the three angles of a triangle and they need to guess the type of triangle they form. Your task is to write a program that takes the three angles as input and determines the type of triangle based on the following rules:If the sum of the angles is equal to 180 degrees: If all three angles are equal, the triangle is an equilateral triangle, and the participant wins Prize 3.If any one of the angles is a right angle (90 degrees), the triangle is a right-angled triangle, and the participant wins Prize 2.Otherwise, the triangle is a regular triangle, and the participant wins Prize 1.If the sum of the angles is not equal to 180 degrees, the triangle is invalid, and the participant wins no prize.Complete the program to find the participant's prizes.Input format :The input consists of three integers, angle 1, angle 2, and angle 3, representing the three angles of the triangle.Output format :The output prints a single line containing the corresponding prize.Refer to the sample output for formatting specifications.Code constraints :0 ≤ angle1, angle2, angle3 ≤ 180Sample test cases :Input 1 :605070Output 1 :Prize 1Input 2 :904050Output 2 :Prize 2Input 3 :606060Output 3 :Prize 3Input 4 :606070Output 4 :No prizeNote :The program will be evaluated only after the “Submit Code” is clicked.Extra spaces and new line characters in the program output will result in the failure of the test case.
Five children – A through E – were playing a game. In each round of the game, each child independently picked a digit from 0 to 9 and after each of the five children had picked a digit, the five digits were used to form the largest possible number that can be made with the five digits (by placing them next to each other). This number is labelled as the Ceiling Number of that round. After exactly four rounds, the child who picked the leftmost digit of the highest Ceiling Number across the four rounds is declared the winner of the game. No child can pick the same number across any two rounds.The Ceiling Number of each round are 98551, 75311, 98765 and 76544, not necessarily in any particular order.It is also known thatB picked consecutive digits across the four rounds, but not necessarily in any order, and in none of the rounds did the digit that he picked become the leftmost digit of the Ceiling Number.In each round, the digit that B picked was higher than the one that D picked, while, in the second round, C and E picked the same digit.The child who was declared the winner picked the least digit of the Ceiling Number in only one round, which was the third round.For only one child was the difference between the highest digit that he picked and the lowest digit that he picked 8, and this child picked his least digit in the first round.No one picked the same digit as D in any round and D and E did not pick consecutive digits in any round.Question No. 6DIRECTIONS for question 6: Select the correct alternative from the given choices.Who was the winner of the game? A C E
Five children – A through E – were playing a game. In each round of the game, each child independently picked a digit from 0 to 9 and after each of the five children had picked a digit, the five digits were used to form the largest possible number that can be made with the five digits (by placing them next to each other). This number is labelled as the Ceiling Number of that round. After exactly four rounds, the child who picked the leftmost digit of the highest Ceiling Number across the four rounds is declared the winner of the game. No child can pick the same number across any two rounds.The Ceiling Number of each round are 98551, 75311, 98765 and 76544, not necessarily in any particular order.It is also known thatB picked consecutive digits across the four rounds, but not necessarily in any order, and in none of the rounds did the digit that he picked become the leftmost digit of the Ceiling Number.In each round, the digit that B picked was higher than the one that D picked, while, in the second round, C and E picked the same digit.The child who was declared the winner picked the least digit of the Ceiling Number in only one round, which was the third round.For only one child was the difference between the highest digit that he picked and the lowest digit that he picked 8, and this child picked his least digit in the first round.No one picked the same digit as D in any round and D and E did not pick consecutive digits in any round.Question No. 7DIRECTIONS for question 7: Type in your answer in the input box provided below the question.Which digit did C pick in the first round?
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.