Simple Python! Determine if a caller should be answered or ignored. Prompt the user for the first digit of a telephone number and store in a variable as a string. Prompt the user for the second digit of a telephone number and store in a variable as a string. Prompt the user for the third digit of a telephone number and store in a variable as a string. Prompt the user for the fourth digit of a telephone number and store in a variable as a string. Using the if-else Decision Structure, if the following conditions are met, the caller should be ignored: The first digit is "8" or "9". The fourth digit is "8" or "9". The second and third digits are the same. Display a message stating whether the caller should be answered or ignored and the four digits. To receive full credit: Only one if-statement can be used. The Boolean condition in the one if-statement can use any combination of AND and OR operators to test for the three conditions.
Simple Python! Determine if a caller should be answered or ignored. Prompt the user for the first digit of a telephone number and store in a variable as a string. Prompt the user for the second digit of a telephone number and store in a variable as a string. Prompt the user for the third digit of a telephone number and store in a variable as a string. Prompt the user for the fourth digit of a telephone number and store in a variable as a string. Using the if-else Decision Structure, if the following conditions are met, the caller should be ignored: The first digit is "8" or "9". The fourth digit is "8" or "9". The second and third digits are the same. Display a message stating whether the caller should be answered or ignored and the four digits. To receive full credit: Only one if-statement can be used. The Boolean condition in the one if-statement can use any combination of AND and OR operators to test for the three conditions.
Chapter4: Making Decisions
Section: Chapter Questions
Problem 7E: Write a program named GuessingGame that generates a random number between 1 and 10. (In other words,...
Related questions
Question
Simple Python!
Determine if a caller should be answered or ignored.
- Prompt the user for the first digit of a telephone number and store in a variable as a string.
- Prompt the user for the second digit of a telephone number and store in a variable as a string.
- Prompt the user for the third digit of a telephone number and store in a variable as a string.
- Prompt the user for the fourth digit of a telephone number and store in a variable as a string.
- Using the if-else Decision Structure, if the following conditions are met, the caller should be ignored:
- The first digit is "8" or "9".
- The fourth digit is "8" or "9".
- The second and third digits are the same.
- Display a message stating whether the caller should be answered or ignored and the four digits.
To receive full credit:
- Only one if-statement can be used.
- The Boolean condition in the one if-statement can use any combination of AND and OR operators to test for the three conditions.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 2 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,