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.

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
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,...
icon
Related questions
Question

Simple Python!

Determine if a caller should be answered or ignored.

  1. Prompt the user for the first digit of a telephone number and store in a variable as a string.
  2. Prompt the user for the second digit of a telephone number and store in a variable as a string.
  3. Prompt the user for the third digit of a telephone number and store in a variable as a string.
  4. Prompt the user for the fourth digit of a telephone number and store in a variable as a string.
  5. Using the if-else Decision Structure, if the following conditions are met, the caller should be ignored:
    1. The first digit is "8" or "9".
    2. The fourth digit is "8" or "9".
    3. The second and third digits are the same.
  6. Display a message stating whether the caller should be answered or ignored and the four digits.

To receive full credit:

  1. Only one if-statement can be used.
  2. 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
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Random Class and its operations
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,