Add a contact phone number field to the rental class

Assignment Help Computer Engineering
Reference no: EM131938512

Assignment

Sammy's Seashore Supplies rents beach equipment to tourists. In previous chapters, you have developed a class that holds equipment rental information and an application that tests the methods using four objects of the class. Now modify the Rental and RentalDemo classes as follows:

• Modify the method that sets the contract number in the Rental class so that if the argument passed to the method is not a four-character String that starts with a letter followed by three digits, then the contract number is forced to "A000". If the initial letter in the contract number is not uppercase, force it to be so.

• Add a contact phone number field to the Rental class.

• Add a set method for the contact phone number field in the Rental class. Whether the user enters all digits or any combination of digits, spaces, dashes, dots, or parentheses for a phone number, store it as all digits. For example, if the user enters (920) 872-9182, store the phone number as 9208729182. If the user enters a number with fewer or more than 10 digits, store the number as 0000000000.

• Add a get method for the phone number field. The get method returns the phone number as a String constructed as follows: parentheses surround a three-digit area code, followed by a space, followed by the three-digit phone exchange, followed by a hyphen, followed by the last four digits of the phone number.

• Modify the RentalDemo program so that besides the contract number and minutes, the program also prompts the user for and retrieves a contact phone number for each of the sample objects. Display the phone number along with the other Rental details. Test the RentalDemo application to make sure it works correctly with valid and invalid contract and phone numbers.

Reference no: EM131938512

Questions Cloud

Estimate the mean life of the bulbs : You receive a request from a team of product engineers who are working on the design of a projector that your company manufactures.
What arbitrage would you take : Assume that the gama index spot price is at 12,000, the risk free rate is 3% and the continuous dividend yield on the index is 0%.
Why were the four components of this time bomb considered : Why were the four components of this time bomb considered ingenious? Name the two pieces of evidence you think are most damaging to this employee.
Determining the price of the bond : Suppose that you are considering investing in a four-year bond that has a face value of $1000 and a coupon rate of 5.5 %.
Add a contact phone number field to the rental class : Add a contact phone number field to the Rental class. Add a set method for the contact phone number field in the Rental class.
Determine the profit or loss on the contract : What is your profit or loss on the contract if the premium was $4000? Please explain.
Write a sales promotion plan : You have recently been assigned the task of developing promotional techniques to introduce your company's new product, a Cajun chicken sandwich.
How many students were taking just one or just two units : How many individual/unique students are in the file? How many students were taking just one or just two units? Which unit had the largest enrolment?
Retain valued employees and alleviate : What are you going to do to both retain valued employees and alleviate the excessive conflict and negative feelings in these departments?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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