Program Scope
In the Main Program
Create a java program to ask the user://Questions to ask userPlease enter a range of positive, non decimal numbers no smaller than one and no greater than 100 for lottery numbers.Please enter a range of positive, non decimal numbers no smaller than one and no greater than 100 for bonus balls.Please provide a data file name to store your data results in as well as a path to where the datafile should be written.//EXAMPLE "c:\Combos5June2020"//the entries should positive, non-decimal numbers only, or their entry will be rejected and the question repeated.
VARIABLE NAMESPicks - this should be a string which will contain the 5 sorted lottery numbers with dashes between the numbers. Example: 1-2-3-4-5Consecs - this should be a positive integer1st - this should be a positive, non-decimal integer which will be the 1st lotterball out of the 5 after the 5 lottery numbers have been sorted.Example: the five lottery numbers generated might be 7,5,8,2,1. After sort they would be 1,2,5,7,8. So, 1st = 1 in this case2nd - this should be a positve, non-decimal integer and would be the 2nd number after sorting.3rd - this should be a positve, non-decimal integer and would be the 3rd number after sorting.4th - this should be a positve, non-decimal integer and would be the 4th number after sorting.5th - this should be a positve, non-decimal integer and would be the 5th number after sorting.Bonus - this should be a positve, non-decimal integer. EXAMPLE: say 1,2,3,4,5,1 was generated, five lottery numbers and the bonus ball. Bonus = 1 , the last number in this caseSUM - this should be a positve, non-decimal integer summing the five generated lottery balls 1st, 2nd, 3rd, 4th, 5th.TSUM - this should be a positve, non-decimal integer summing the five generated lottery balls 1st, 2nd, 3rd, 4th, 5th and the bonus ball.WKDay - this should be a string value with a default value of "TBD"Status - this should be a string value with a default value of "TBD"Month - this should be a string value with a default value of "TBD"Year - this should be a positive, non-decimal integer with a default value of 0 (zero)Wks - this should be a positive, non-decimal integer with a default value of 0 (zero)Record - this should be a positive, non-decimal integer. This should count all lottery combination records.EXAMPLES: 1,2,3,4,5,1 would have Record = 1 (the first combination record would be equal to: Record = 1) 1,2,3,4,5,2 would have Record = 2 , and so onMin - should be a positive, non-decimal integer value.HR - should be a positive, non-decimal integer value.Days - should be a positive, non-decimal integer value.Mths - should be a positive, non-decimal integer value.Years - should be a positive, non-decimal integer value.Decades - should be a positive, non-decimal integer value.TimeStamp - should be a string variable which will be a date and time. Example: January 1, 1980 00:00:01
//after the range has been selected for the lottery numbers and bonus balls the following operations and calculations should begin.//1 - Generate all possible unique lottery ball combinations without repeating and assign all possible bonus balls to each combination.//2 - Sort the 5 lottery numbers from smallest to largest, this will not include the bonus ball
/EXAMPLE DATAIf the lottery range is 1 to 5 and the bonus ball range is 1 to 3, the data would appear as://The first thing the program should do at this point is sort the 5 lottery numbers in ascending order from smallest to largers number1,2,3,4,5,11,2,3,4,5,21,2,3,4,5,3 and so on
//3 - The program should determine how many consecutive numbers there are in each combination following the logic below.
//EXAMPLE DATA1,2,3,4,5,1,5 //where the last number 5 shows that 1,2,3,4,5 are 5 consecutive numbers in a rowthe first 5 numbers (1,2,3,4,5) are the lottery numbersthe next number (1) is the bonus ball numberthe next number (5) is how many consecutive numbers in a row there are
//EXAMPLES DATA - consecutive numbers1,2,3,4,5 for this there would be 5 consecutive numbers in a row. So the vaule would be 51,2,3,4,6 for this there would be 4 consecutive numbers in a row. So the value would be 41,2,3,6,9 for this there would be 3 consecutive numbers in a row. So the value would be 31,2,4,5,7 for this there would be 2 sets of two numbers in a row. So the value would be 221,2,4,6,9 for this there would be 2 numbers in a roow. So the value would be 2.1,3,5,7,9 for this there would be one number in a row. So the value would be 1.1,2,4,5,6 for this there would be 1 set of two numbers in a row and 1 set of 3 numbers in a row. So the value would be 231,2,3,5,6 for this there would be 1 set of 3 numbers in a row and 1 set to 2 numbers in a row. So the value would be 32
//4 - The program should sum the 5 lottery numbers after sorting them in ascending order//EXAMPLE DATA1,2,3,4,5,1,5 The first 5 numbers are the lottery numbers which should be summed, so the value would be 15. //5 - The program should sum the 5 lottery numbers as well as the bonus ball.//EXAMPLE DATA1,2,3,4,5,1,5 The first 5 numbers and the bonus ball number would be 1,2,3,4,5,1 which should be summed equaling 16.
//7 - The program should create an initial, default Date value of "TBD".//8 - The program shoudl create an initial, default Status value of "Available".//9 - The program should create an initial, default Month value of "TBD".//10 - The program should create an initial, default Year value of 0.//11 - The program should create an initial, default WK value of 0.//12 - The program should create a Record number for each unique combination starting with the number 1 and increment by 1 for each, next unique combination.
ok, so if you were using a set of lottery numbers from 1 to 69 and a range or bonus balls from 1 to 26, there should a a total of 292,201,338 unique non-repeating combinations. Each record number from 1 to 292,201,338 should represent a second in time starting on January 1 1980 on the first second of the day. So the first combination would be the following.1,2,3,4,5,1 with a date and time of January 1 1980 00:00:00 AM
The datafile created would be populated after making all of the calculations in the following way.
1-2-3-4-5,1,1,2,3,4,5,1,15,16,TBD,Available,TBD,0,0,1,0,0,0,0,0,0,0, January 1, 1980 00:00:01
1-2-3-4-5 is the first combiniation with lottery numbers only1 is the Consecs value1 is the value of the first lottery number after the numbers in the lottery combination have been sorted in ascending order2 is the value of the 2nd lottery number3 is the value of the 3rd lottery number4 is the value of the 4th lottery number5 is the value of the 5th lottery number1 is the value of the bonus ball15 is the SUM of the lottery numbers16 is the TSUM, the sum of the lottery numbers and the bonus ballTBD is the value of WKDayAvailable is the value of StatusTBD is the value of Month0 is the value of Year0 is the value of Wks1 is the value of Record0 is the value of Min0 is the value of HR0 is the value of Days0 is the value of Mths0 is the value of Years0 is the value of DecadesJanuary 1, 1980 00:00:01 is the value of TimeStamp
The calculation of how many consecutive numbers there are should be calulated in a Consecutives methodThe calculation of translating what date and time the TimeStamp should be based on how many total seconds there are should be calcualted in a TimeStamp methodLeap year considerations should be taken into consideration to make sure there is an extra day calculated for February 29 1980, 1984, 1988Error Exceptions should also be in its own method