Modify your handling of the quantity of items

Assignment Help Basic Computer Science
Reference no: EM13956086

Modify your handling of the quantity of items to include the following:

Only values in the range 1-99 are accepted. Illegal or out-of-range values cause a reprompt for a valid input. Up to 3 such requests for valid input are made, and the program terminates if a valid numeric in-range quantity is not entered by the customer. Exception handling is used to accomplish this.

  • You should bundle all of this as a new method, such as getNumericInput( ), and then use a call to this new method in place of your existing quantity request code.
  • Modify your code that validates string input (like returning customer, color, crust, etc.) so that only correct responses are accepted.
  • Check for yes or no, regular or deep dish, and so forth.
  • Modify your display of the cost of the product so that it appears properly formatted with a dollar sign and exactly two digits to the right of the decimal point.
  • Add a phone number to the collection of customer or product attributes. The phone number must be entered in the form (###), where "#" is any digit (0-9) and the parentheses and hyphen are required.
  • The space after the closed parentheses may or may not be present. You must create a method that handles the input and the validation of the phone number. You should use the Java java.util.regex.* pattern matching capabilities to validate the phone number.
  • A file (named "order.txt") must be written that contains each of the above data items that constitute an order. The items must be written on separate lines in the file. No other information may be written to the file. You must be able to view the file using Notepad to verify that the information that it contains is complete and correct.
  • The order file only should be written if there are no validation errors whatsoever.
  • You should create a method (named "writeOrderFile( )") that handles file output.

Reference no: EM13956086

Questions Cloud

Different approaches to systems analysis : There are many different approaches to systems analysis. Despite these different approaches, what is the universally accepted definition of systems analysis?
What is the net force acting on the automobile : An automobile with a mass of 100 kg is moving north on a level highway with a constant velocity of 80 km/h. What is the net force acting on the automobile?
What velocity did the bullet exit the barrel : A gun fires a bullet of mass 22 grams out of a barrel 36 cm long. The gun is attached to a spring. From the recoil of the spring and the masses of the gun and the spring we determine that the gun recoiled with a total momentum of 4.7 kg m/s. With ..
What was its change in kinetic energy : An applied force of 6 Newtons acts in the direction of motion of a block of mass 9 Kg, with the mass being pulled across the floor against a frictional force of .6 Newtons. Assume that the block moved the distance 'y' in this process. What is the ..
Modify your handling of the quantity of items : Only values in the range 1-99 are accepted. Illegal or out-of-range values cause a reprompt for a valid input. Up to 3 such requests for valid input are made, and the program terminates if a valid numeric in-range quantity is not entered by the cu..
How long it takes to drive to work each day. : You draw 13 cards and not one of them is Saddam Hussein [note: this is a tough one, remember to show your work so you can get partial credit. Grading will be lenient on this one].
To develop and verify system administration procedures : Access controls are an important part of identity & authorization management business processes. There are three primary types of access controls which are used for desktop computing: mandatory access controls, discretionary access controls, and r..
What is the sum of these probabilities and why is the number : What is the sum of these probabilities and why is the number less than 1?
What is the incremental profit over the profit earned : At the price calculated in part a, what is the incremental profit over the profit earned before the introduction of the Jacques EllesCD?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Benefits and three negative effects workplace automation

Write at least three benefits and three negative effects brought about by workplace automation. Multinational corporation transfers a foreign employee to the United States on an L-1 visa.

  Presenter notes section of the presentation

Note: The slides in your presentation should include only the main points you wish to make, with more extensive information included in the presenter notes section of the presentation.

  Which must be populated in the code-behind file

which must be populated in the code-behind file. The values of the new controls must be output when a postback is done.

  Write an appropriate me expression

Write an appropriate ME expression capturing the essence of each of the following topics:

  Type and topology of lan

Type and topology of LAN

  Create a 64mb encrypted file system

Write an instruction sheet for the user so that she can make the modi cations to her home machine so that she can access the le on the ash drive containing the encrypted le system.

  Differentiate computer data state of computer-s electrical

Differentiate between computer data represented by the state of a computer's electrical switches and the meaningful information that is displayed to the user.

  Writing user requirements

Writing User Requirements

  How much would it have cost to have corrected fault

How much would it have cost to have corrected the fault during the specification phase? What should be the best answer to this question by a software engineering?

  Show the background on the layer beneath

show the background on the layer beneath

  Problems a team may encounter during a project life cycle

Discussion, consider some of the problems a team may encounter during a project life cycle: Question: What are some of the typical problems a project team may encounter during a project's life cycle?

  A change to my coin tossing program

A change to my Coin Tossing program

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