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.)
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)
Similarly do one to input double values:
public static int getRangedDouble(Scanner pipe, String prompt, double low, double high)
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)
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!
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.
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.