Write a program to help a travelling sales person keep up withtheir daily mileage driven for business. In your main method, theprogram should first ask the user how many days of mileage theywant to enter and then collect the user input for each day’s miles,storing the values entered in an appropriately sized array.
After collecting the user input for the miles, the main methodshould use a do…while loop to present a menu to the user as shownin the example below. The main method should take the user’s pickfrom the menu and use a switch statement to call the appropriatemethod(s) to carry out the requested task and output any returneddata to the user. The menu should keep being presented to the useruntil the Exit option is chosen by the user. If the user types in awrong menu item number, they should be told they entered an invalidchoice and then given another chance to choose an option.
User Menu Example:
Find the number of days with 0 miles driven.
Find the day(s) with the highest number of miles driven.
Find the average miles driven.
Print the miles entered by day.
Choose an option from the menu:
All input and output for this program should be done through aScanner object and the console.
Answer to Write a program to help a travelling sales person keep up with their daily mileage driven for business. In your main met…