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

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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