Concept explainers
Alphabetic Telephone Number Translator
Many companies use telephone numbers like 555-GET-FOOD so the number is easier for their customers to remember. On a standard telephone, the alphabetic letters are mapped to numbers in the following fashion:
A, B, and C = 2
D, E, and F = 3
G, H, and I = 4
J, K, and L = 5
M, N, and O = 6
P, Q, R, and S = 7
T, U, and V = 8
W, X, Y, and Z = 9
Write an application that asks the user to enter a 10-character telephone number in the format XXX-XXX-XXXX. The application should display the telephone number with any alphabetic characters that appeared in the original translated to their numeric equivalent. For example, if the user enters 555-GET-FOOD the application should display 555-438-3663.
Want to see the full answer?
Check out a sample textbook solutionChapter 9 Solutions
Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
Additional Engineering Textbook Solutions
Starting Out with C++ from Control Structures to Objects (8th Edition)
Starting Out With Visual Basic (8th Edition)
Database Concepts (7th Edition)
Modern Database Management
Computer Systems: A Programmer's Perspective (3rd Edition)
Artificial Intelligence: A Modern Approach
- C++ Language Write a program that prints a custom conversion table from Celsius temperatures to Fahrenheit and Newton (Links to an external site.) temperatures. The formula for the conversion from Celsius to Fahrenheit is : F=9/5*C+32 F is the Fahrenheit temperature, and C is the Celsius temperature. The formula for the conversion from Celsius to Newton is C = 100/33*N N is the Newton Temperature and C is the Celsius temperature Your program should prompt the user for a lower value and upper value for a range of temperatures in Celsius. It should then prompt the user for the amount they want to increment by. Then use a loop to output to a file named conversion_table.txt a table of the Celsius temperatures and their Fahrenheit and Newton equivalents within the range of values using the increment given by the user. Make sure to format your output to 2 decimal places. INPUT VALIDATION: Ensure the second number is greater than the first number, and make sure the increment is greater…arrow_forwardWord Sleuth Puzzle Programarrow_forwardDiscrete Mathematics: Assignment details: Replace all the 0 (Zero) digits in your ID by 4. Example: If your ID is 38104680, it becomes 38144684 Take the first 6 digits and substitute them in this expression (( A + B) / C) * ((D-E)/F)-2) according to the following table; Letter Replace by Digit Example Digit A 1st 3 B 2nd 8 C 3rd 1 D 4th 4 E 5th 4 F 6th 6 After substitution your expression will be similar to this (( 3 + 8) / 1) * ((4-4)/6)-2). Draw a rooted tree that represents your expression. What is the prefix form of this expression. 3.What is the value of the prefix expression obtained in step 2 above?arrow_forward
- message-passing (MPI) libraries Triangular number Series: A triangle number counts the objects that can form an equilateral triangle. The nth triangle number is the number of dots or balls in a triangle with n dots on a side; it is the sum of the n natural numbers from 1 to n. • The formula for the nth triangular number can be expressed as: ?? = ∑ ? ? ?=1 = 1 + 2 + 3 + ⋯ + ? = ?(? + 1) 2 = ( ? + 1 2 ) • The first few triangular numbers are: 0, 1, 3, 6, 10, 15, …… • Pictorially, the triangular numbers can be represented as below: Write a program that generates the triangular number series from the first term up until the n th term. In your program, the user will enter the n number, choose a large number! The sequence should be printed in the correct order. Regarding the number of threads/processes, try at least three different numbers (e.g., 2, 4, 8).arrow_forwardMonty Hall Problem – Coding Lab In this lab, you will write a code that simulates the Monty Hall Game Show. Thegame host gives the participant the choice of selecting one of three doors. Twodoors has a goat behind them and one door has a prize. The set of choices arerandomized each round. The participant needs to select the door with the prizebehind it. When the participant selects a door, the game host reveals a door with agoat behind it. The game host opens a door (different from the one selected by theparticipant) that has a goat behind it. The participant is then given the option tochange their choice. When you run your code, the code would display a message prompting the user toinput their door choice, labelled as 1, 2, and 3. Then the code will display a doornumber (different from the one the user picked) with a goat behind it and ask theuser if they would like to change their choice. The code then displays a message onwhether the user guessed the correct door. The game then…arrow_forwardMatric Number: 2. Let x be the first three digits of your matric number, AND y be the last three digits of your matric number. If the first digit of y is 0, replace it with 2. Ехатple: If you matric number is 2013034, Thus, x = 201 and y = 234 a. Write the values of x and y based on your matric number. b. If a = x (mod 7) and b = (-1) + y (mod 7), find the integer(s) c with 10arrow_forwardPlease Use Visual Studio and C# ALPHABETIC TELEPHONE NUMBER TRANSLATOR Many companies use telephone numbers like 555-GET-FOOD so the number is easier for their customers to remember. On a standard telephone, the alphabetic letters are mapped to numbers in the following fashion: A, B, and C = 2 D, E, and F = 3 G, H, and I = 4 J, K, and L = 5 M, N, and O = 6 P, Q, R, and S = 7 T, U, and V = 8 W, X, Y, and Z = 9 Create an application that lets the user enter a 10-character telephone number in the format XXX-XXX-XXXX. The application should display the telephone number with any alphabetic characters that appeared in the original translated to their numeric equivalent. For example, if the user enters 555-GET-FOOD, the application should display 555-438-3663.arrow_forwardName Format - Use Javaarrow_forwardSkydiving Bibi is a skydiving instructor. Before carrying out skydiving activities, Bibi will always ask the name, height, and age of the participants. Bibi's participants is always 2 people. To make it easier to remember their identities, Bibi gave them a paper to write down their identity. But because they are very enthusiastic in doing skydiving, they write their identity in a single line only (for both of the participants), so it wasn't quite neat and it made difficult for Bibi to see it, and resulted in the skydiving process being disturbed. As one of the organizer committee, you do not want this activity to be disturbed and plan to provide a program that provides their identity neatly to Bibi. Format Input Input consists of 1 line. It contains the identity of 2 people in a row Ni, Ti, Ui - the name, height, and age of the i-th participant. Format Output The output consists of 6 lines. The first line, "Name 1: N1". The second line, "Height 1: T1". The third line, "Age: U1". For…arrow_forwardTreasure Hunter description You are in front of a cave that has treasures. The cave canrepresented in a grid which has rows numbered from 1to , and of the columns numbered from 1 to . For this problem, define (?, )is the tile that is in the -th row and -column.There is a character in each tile, which indicates the type of that tile.Tiles can be floors, walls, or treasures that are sequentially representedwith the characters '.' (period), '#' (hashmark), and '*' (asterisk). You can passfloor and treasure tiles, but can't get past wall tiles.Initially, you are in a tile (??, ). You want to visit all the treasure squares, andtake the treasure. If you visit the treasure chest, then treasurewill be instantly taken, then the tile turns into a floor.In a move, if you are in a tile (?, ), then you can move tosquares immediately above (? 1, ), right (?, + 1), bottom (? + 1, ), and left (?, 1) of thecurrent plot. The tile you visit must not be off the grid, and must not be awall patch.Determine…arrow_forwardCode in C++ Language STRING FLIP ALPHABET One of the simplest cryptography technique is to invert the characters such that the first character of the alphabet will be replaced to the last character, the second character be replaced to the second to the last, and so on. So all A's are turned into Z's, B to Y, C to X, and so on until X to C, Y to B, and Z to A. In a similar fashion, numeric characters will also be inverted such that 0 will become 9, 1 to 8, 2 to 7 and so on until 7 to 2, 8 to 1, and 9 to 0. Given a string composed of uppercase and lowercase letters, numbers, and spaces, your task is to invert them. You also must keep the case of the letters as is. Input: A string composed of uppercase and lowercase letters, numbers, and spaces. The quick brown 1 Fox jumps over the 6 lazy Dogs Output: The inverted string Gsv jfrxp yildm 8 Ulc qfnkh levi gsv 3 ozab Wltharrow_forwardC++ languagearrow_forwardarrow_back_iosSEE MORE QUESTIONSarrow_forward_ios
- 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