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

  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