
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
thumb_up100%
please here is a screenshot of my lab phone number break down , python

Transcribed Image Text:# 4.16 LAB: Phone number breakdown
## Objective
Given an integer representing a 10-digit phone number, you need to output the area code, prefix, and line number using the format `(800) 555-1212`.
### Example
**Input:**
```
8005551212
```
**Output:**
```
(800) 555-1212
```
### Hints
- **Hint 1:** Use `%` to get the desired rightmost digits.
- Example: The rightmost 2 digits of `572` is obtained by `572 % 100`, which yields `72`.
- **Hint 2:** Use `//` to shift right by the desired amount.
- Example: Shifting `572` right by 2 digits is accomplished with `572 // 100`, resulting in `5`. (Recall that integer division discards the fraction).
**Note:** For simplicity, assume any part starts with a non-zero digit. Thus, `0119998888` is not considered valid.
## Lab Activity
**Task:** Complete the following code in `main.py`.
```python
phone_number = int(input())
''' Type your code here. '''
```
Complete the code to achieve the desired output format.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images

Knowledge Booster
Similar questions
- Write in python pleasearrow_forwardThe file winning_numbers.txt contains the winning numbers for the Powerball lottery since the beginning of the year. Below is a partial listing of the file winning_numbers.txt: Drawing Date Winning Numbers Prize 1/1/2022 6 12 39 48 50 7 2 500000000 1/3/2022 2 13 32 33 48 22 2 540000000 1/5/2022 6 14 25 33 46 17 2 630000000 1/8/2022 20 21 36 60 65 13 10 20000000 1/10/2022 14 17 18 21 27 9 2 27000000 1/12/2022 12 21 22 30 33 24 4 38000000 1/15/2022 3 18 37 51 59 13 2 48000000 1/17/2022 9 24 35 46 65 22 2 53000000 1/19/2022 11 15 43 55 61 10 3 62000000 1/22/2022 8 14 33 36 67 17 2 76000000 The winning numbers for the date 1/1/2022 are: 6 12 39 48 50 7 2 The numbers 6 12 39 48 50 are considered the 5 white balls (ping pong balls with numbers on them), 7 is considered the Powerball (color is a red ping pong ball with a number on it), and 2 is considered the Powerball Multiplier. A player of the game wants to know which white balls have been selected with the greatest frequency and which…arrow_forwardPython please Use map(s) to program this formula: Σ [ (xi – x)(yi – y) ] / Σ [ (xi – x)^2] Note the Σ symbol means "SUM" where the sum goes from 0 to a limit. And the ^2 at the end of the equation means 'squared'.arrow_forward
- Please help (on jupyter note in python) Homecoming Shopping ListWe bought the following souvenirs for homecoming gathering: 5 shirts ( $ 10/item), $ 10 Polo Shirts ( $ 20.75/item), 5 trousers ( $ 29.95/item), 10 caps ( $ 11.95/item), 20 pens ( $ 1.99/item), 20 hoodies ( $ 24.95/item), and 30 chocoloates ( $ 2.95/item). Use Dot Product and NumPy arrays to compute the total cost of Homecoming.arrow_forwardplease answer the image using python codearrow_forwardThe answer is incomplete, please provide full code with output. TYSM.arrow_forward
- Please help me code in python. Include screenshots of your code for better understanding. Thank you!arrow_forwardFor the code shown below,1. Add comments for each line. In the comments, explain what the code intends to do, and assemble the code by hand2. What is the content of %r4 after the program has been executed successfully?arrow_forwardCreate a python code: hint: "while loop" The population of Rhode Island is 1.09 Million as of January 1 2023 and is growing at the rate of 0.3% each year. Assuming that the population continues to grow at the same rate, approximately when will the population reach 1.2 million?arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education