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

  Develop a class diagram for a cardgame class

Develop a class diagram for a CardGame class. Include generalizations for child classes.

  Explain technologies you could use to present information

Explain two technologies you could use to present the information contained in this presentation in a more effective manner to this audience.

  Write pseucocode using two dimensional arrays

Write pseucocode using two dimensional arrays that will accept a header record name and grade file

  Discuss differences between a virus and a trojan horse

Describe the similarities and differences between a virus, a Trojan horse, and a worm

  What are the kinds of information systems

What are the kinds of information systems

  Distinguish between a ring and a commutative ring

Define a group and distinguish between a group and a commutative group. Define a ring and distinguish between a ring and a commutative ring.

  Why some companies may avoid beta releases

Cross (2007) discusses the benefits for a software company to release beta versions instead of final versions of products. What is Cross's reasoning? Do you agree with it? Explain why some companies may avoid beta releases from software companies.

  Lab - Exploring Recursion and the Stack Frame

Lab: Exploring Recursion and the Stack Frame. Download the file powers_rec.py from Moodle. Run the program in PyCharm. It should display a single line of text

  Morris-thompson protection scheme

The Morris-Thompson protection scheme with n-bit random numbers (salt) was de- signed to make it difficult for an intruder to discover a large number of passwords by encrypting common strings in advance.

  Determining the format of the number to be entered first

Determining the format of the number to be entered first - If the number entered cannot be expressed as 8 or 16 bits according to the selected bit value, the program - The sign bit varies depending on whether the count is positive or negative.

  Describe difference between println and draw string methods

Describe the difference between the println() and draw String() methods. Java looks for the _______ as the usual starting point for all standalone applications.

  Interview a person about a task he performs on his job

Based on the information you learned in Steps 1 and 2 of The Essential Guide to User Interface Design, interview a person about a task he/she performs on his/her job.

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