Writejava class take a seven-letter return the phone numbers

Assignment Help Basic Computer Science
Reference no: EM13230629

this week you are required to use concepts learned in this week: strings and the Java library method contains. Write a Java class PhoneNumber that will take in a seven-letter word and return the phone number that corresponds to it. In the United States, the digits on a phone pad are mapped to letters by the following table: digit letter 1 2 A B C 3 D E F 4 G H I 5 J K L 6M N O 7 P Q R S 8 T U V 9 W X Y Z 0 Hence a 7 digit phone number like HAIRCUT would map to 424-7288; NEWCARS would map to 639-2277. Submit a Java program PhoneNumber.java which has just one method decode and behaves as below PhoneNumber pn = new PhoneNumber(); pn.decode( "HAIRCUT") => "4247288" pn.decode("NEWCARS") => "6392277" Implementation Requirement: If s is a variable of type String, that holds the phone number to be decoded (e.g. "HAIRCUT") then you should structure your program around a nested if-else statement and use the contains method of the String class to check for the condition below: if ("ABC".contains(""+s.charAt(i))) { ...; } else if ("DEF".contains(""+s.charAt(i))) { ...; ... }

Reference no: EM13230629

Questions Cloud

What is the manufacturers price : What is the retailer's markup in dollars and what is the wholesale price, what is the manufacturer's price?
Audit committees and fraud risk management : Audit committees and fraud risk management.
Determine the percentage speed regulation : A 120 V separately excited DC Motor is operated at a fixed field current. It has an armature resistance Ra = 10 ohms, and a machine constant K = 0.1 V/rpm. The armature current is 0.5 amps with no load, and 3.0 amps at full load.
Evaluate potential transportation providers : A Chicago-based manufacturer is looking for someone to handle its shipments to the West Coast. In order to evaluate potential transportation providers
Writejava class take a seven-letter return the phone numbers : this week you are required to use concepts learned in this week: strings and the Java library method contains. Write a Java class PhoneNumber that will take in a seven-letter word and return the phone number that corresponds to it.
Choose one of the potential business owners listed : A middle-management corporate refugee desiring a business of her own after frustration with bureaucratic red tape.
What weight of sodium formate : What weight of sodium formate must be added to 400mL of 1M formic acid to produce a buffer solution that has a pH of 3.50
Explain the mole fraction of oxygen in the atmosphere : The mole fraction of oxygen in the atmosphere is .21. If the barometric pressure is 0.975 atm, what is the concentration of oxygen in water? Kh=1.3 x10^-3 M/atm
Explain frozen temperature : What occurs with the plasma membrane so that frozen temperatures hurts a cell? I know crystals form and the cell bursts but WHAT actually occurs so that this happens

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Develop monthly claim status summary report

Dr. Jones has asked you to develop a monthly Claim Status Summary report. He wishes you to write the insurance company number, patient number and name.

  Intelligent systems for health maintenance organization

Aacquiring a company in the health maintenance organization (HMO) field. DSS, ES, ESS, or intelligent systems can be used in such a situation.

  Why are you normally required to bind a service

What steps need to be taken by a network service to be ready to receive TCP/IP connections? Why are you normally required to bind a service to a specific port?

  The head office of kkae

The head office of KKAE is located in Australia/Sing/India. Documents and reports must be displayed/printed in English. Grammar and spelling in all the documents and output reports follow the English version. For example, some of the foreign salutati..

  Develop a web-based application to improve development

Develop a Web-based application to improve development and delivery of products and services. There are currently several incompatible systems related to the development and delivery of products and services to customers.

  Explaining software maintenance service to customers

Service Consultants, a software service company, provides software maintenance service to customers of a software vendor. Which side do you think should have won? why?

  Cost data incurred in processing lot quality cost data

What conclusions can be drawn from cost data incurred in processing lot, as found in the Excel workbook Quality Cost Data? Customer returns are simply scrapped and replaced.

  Write a calculator program that is able to process an input

Write a calculator program that is able to process an input in postfix notation and give the result. You are free to use the built in stack class or create your own ones.

  Calculate and display height and cost of container

Compute and display the height and cost of the container. Use the following formulas, where V is the volume, r is the radius, h is the height, and C is the cost.

  Secure windows-unix-linux servers from known shortcoming

The CIO has asked you to explain why you suggest it is so significant to secure your Windows and Unix/Linux servers from known shortcomings/vulnerabilities.

  Compute probability distribution and conditional probability

Write down solution this question in cryptographic. Assume encryption function is defined compute probability distribution and conditional probability distribution.

  Probability-first game joe enters is fourth game of season

Joe Coledge is the third-string quarterback for the University of Alatoona. What is the probability that the first game Joe enters is the fourth game of the season?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd