Create a Netbeans project called: GetMethodical

For each of the following method descriptions, develop the indicated method and then implement the indicated test programs using the filenames specified. All java main methods will be within the GetMethodical project. For each program complete series of sample test runs that reasonably tests it. Include screen shots for each one to support that you did this. (Note details of the program come after the description of the methods.)

Part A: getRangedInt

Create a method called getRangedInt that prompts the user to input an integer within a specified inclusive range. (inclusive means that low and high are valid inputs) Make sure that you bullet proof the input by using the hasNext methods, reading the trash, and clearing the pipe after reading the value (the fix).

public static int getRangedInt(Scanner pipe, String prompt, int low, int high)

  • Pipe is a Scanner object that you created in main in the usual way i.e. in
  • Prompt is the message to display as the prompt for the input
  • Low is the low value for the input range
  • High is the high value for the input range

Part B: getRangedDouble

Similarly do one to input double values:

public static int getRangedDouble(Scanner pipe, String prompt, double low, double high)

  • Pipe is a Scanner object that you created in main i.e. in
  • Prompt is the message to display as the prompt for the input
  • Low is the low value for the input range
  • High is the high value for the input range

Part C: getYNConfirm

This is an input method that gets a Yes or No [Y/N] returning true for yes and false for no. It should accept yYnN as valid responses and loop until it gets one of them. Read that carefully: it returns true or false not Y of N!

public static boolean getYNConfirm(Scanner pipe, String prompt)

  • Pipe is a Scanner object that you created in main i.e. in
  • Prompt is the message to display as the prompt for the input

Program 01: Date and Time of Birth (BirthDateTime.java)

Use the getRangedInt method to input the year (1965-2000), month (1-12), Day*, hours (1 24), Minutes (1-59) of a persons birth.

Note: use a switch() conditional selector structure to limit the user to the correct number of days for the month they were born in. For instance if they were born in Feb [1-29], Oct [1-31]. HINT: there are only a few groups here not 12 different ones!

Program 02: Check Out at the 10$ Store (CheckOut.java)

Use your other two functions for this program.

At the 10$ store nothing is more than $10.00. Prompt the user for the price of their item (.50 cents to $9.99 dollars) using the getRangedDouble method and continue to input items as long as they indicate that they have more using your getYNConfirm method. Display the total cost of the item(s) to 2 decimal places with printf.

Part D and Program 03: Pretty Header (PrettyHeader.java)

This program does not use any of the previous methods but requires you to write an additional one.

Create a method that creates a Pretty header like this:

*****************************************************************
*** Message Centered Here ***
*****************************************************************

public static void prettyHeader(String msg)

The output is always 60 characters wide for each line. Use loops to print out the lines. Long output statements of stars are not allowed! (Use loops instead.) Center the msg on the second line with 3 stars on either end. HINT: use msg.length() to determine the length in characters of the msg and then use this info to calculate how to center it within the 60 character wide header.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.