Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. (4 points) In the United States, phone numbers are comprised of a 3-digit area code followed by a 7-digit number. Area codes of


image text in transcribed

1. (4 points) In the United States, phone numbers are comprised of a 3-digit area code followed by a 7-digit number. Area codes of 800, 888, 877, 866, 855, 844, and 833 denote toll-free numbers. Write a program named toll free numbers.py that allows the user to enter a 10-digit U.S. phone number as a single integer. Your program should then print whether or not that number is toll-free. You may assume that the user will always enter a valid phone number. Hint: Since the 10-digit phone number is stored into a single variable, can you use integer division and/or mod to get the area code by itself? Example program run (underlined parts indicate what the user enters) Enter a 10-digit phone number (no spaces or dashes): 8778675309 That number is toll-free! Example program run (underlined parts indicate what the user enters) Enter a 10-digit phone number (no spaces or dashes): 9018675309 That number is not toll-free!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Computer Performance Engineering 10th European Workshop Epew 2013 Venice Italy September 17 2013 Proceedings

Authors: Maria Simonetta Balsamo ,William Knottenbelt ,Andrea Marin

2013 Edition

3642407242, 978-3642407246

Students also viewed these Programming questions

Question

Illustrative Discriminatory Employment Practices LOP8

Answered: 1 week ago

Question

LG2 Explain the initial public offering (IPO) process.

Answered: 1 week ago