(Phone keypads) The international standard letter/number mapping for telephones is given in
public static int getNumber(char uppercaseletter)
Write a test program that prompts the user to enter a phone number as a string. The input number may contain letters. The program translates a letter (uppercase or lowercase) to a digit and leaves all other characters intact. Here are sample runs of the program:
Want to see the full answer?
Check out a sample textbook solutionChapter 6 Solutions
Introduction to Java Programming and Data Structures Comprehensive Version (11th Edition)
Additional Engineering Textbook Solutions
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
SURVEY OF OPERATING SYSTEMS
Java: An Introduction to Problem Solving and Programming (8th Edition)
Modern Database Management
Problem Solving with C++ (10th Edition)
Concepts Of Programming Languages
- Java: Receives a phrase and returns the converted phrase to Pig Latin. A word is translated into Pig Latin according to the following rules: a. If there are no vowels in the word, then add “ay” to the end of it. (a, e, i, o, and u are all the vowels considered). b. If the word begins with a vowel, then add “yay” to the end of it. c. Otherwise, take all the letters up to the first vowel and move those letters to the end then add “ay”. Sample Input: System.out.println(toPigLatin("I am fluent in Pig Latin")); System.out.println(toPigLatin(“Hey”)); Sample Output: Iyay amyay uentflay inyay igPay atinLay Heyayarrow_forwardClass: Blocks Write a program that prompts for an integer (that a side length) and displays, using asterisks, a filled and hollow square, placed next to each other. For example if the side length is 5, the program should display: ***** ********** * ****** * ****** * ****** *****arrow_forwardWrite a function reverseString that takes in a string as input and returns the string with its characters reversed. Example: Input: "Hello, World!" Output: "!dlroW ,olleH" Write a function reverseString that takes a string as input and returns the reversed string. Note: You are not allowed to use any built-in reverse functions or methods. Constraints: The input string consists of printable ASCII characters. Hint: You can swap the characters from both ends of the string until you reach the middle.arrow_forward
- Pythonarrow_forwardХ3: inlTol0 Write a function in Java that implements the following logic: Given a number n, return true if n is in the range 1..10, inclusive. Unless "outsideMode" is true, in which case return true if the number is less or equal to 1, or greater or equal to 10. Your Answer: 1 public boolean in1To10(int n, boolean outsideMode) 2 { 3 } H N Marrow_forwardPython:Write a program that prompts you to type an integer value and indicates whether the number is: Positive torqueOdd positiveNegative torqueNegative oddFor this exercise, consider the value 0 as a positive pair.arrow_forward
- c++ code Note:- Do not provide handwritten solution. Maintain accuracy and quality in your answer. Take care of plagiarism.Answer completely.You will get up vote for sure.arrow_forwardPalindromes - “A palindrome” is a string that reads the same from both directions. For example: the word "mom" is a palindrome. Also, the string "Murder for a jar of red rum" is a palindrome. - So, you need to implement a Boolean function that takes as input a string and its return is true (1) in case the string is a palindrome and false (0) otherwise. - There are many ways to detect if a phrase is a palindrome. The method that you will implement in this task is by using two stacks. This works as follows. Push the left half of the characters to one stack (from left to right) and push the second half of the characters (from right to left) to another stack. Pop from both stacks and return false if at any time the two popped characters are different. Otherwise, you return true after comparing all the elements. Phrases of odd length have to be treated by skipping the middle element like the word "mom", your halves are "m" and "m". - Hint: (without using STL)arrow_forwardPalindromes - “A palindrome” is a string that reads the same from both directions. For example: the word "mom" is a palindrome. Also, the string "Murder for a jar of red rum" is a palindrome. - So, you need to implement a Boolean function that takes as input a string and its return is true (1) in case the string is a palindrome and false (0) otherwise. - There are many ways to detect if a phrase is a palindrome. The method that you will implement in this task is by using two stacks. This works as follows. Push the left half of the characters to one stack (from left to right) and push the second half of the characters (from right to left) to another stack. Pop from both stacks and return false if at any time the two popped characters are different. Otherwise, you return true after comparing all the elements. Phrases of odd length have to be treated by skipping the middle element like the word "mom", your halves are "m" and "m". - Hint: (without using STL)arrow_forward
- Part1: Java Programming Without using function 1. Write a program that reads in an integer and breaks it into a sequence of individual digits. For example, the input 16384 is displayed as 1 6 3 8 4arrow_forwardJAVAarrow_forward1- Write a java Program to read a number from user and print full pyramid using numbers which will repeat the number in the same row. Note : use JOptionPane class to read the number and print the pyramid . Test Data Input number of rows: 4 1 22 3 33 4444arrow_forward
- 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