Question: Write program with functions and Arrays to Implement the following. Miles Driven Application using Arrays and Functions. Not using functions will cost you 25% of




Write program with functions and Arrays to Implement the following. Miles Driven Application using Arrays and Functions. Not using functions will cost you 25% of the grade. Create two arrays 1. Monthname This array contains month names such as 'January. "February, etc. 2 MilesDriven This array contains the miles driven for the month. It should be of size Write a program to display the menu with the following options and ask for the user input Type P to populate miles and month name. Type S to search for Month. Type M to search for Month name with smallest Miles Type L to search for Month Name with Largest Miles Type E to exit. e It the user types P Populate all the arrays. Collect 12 month names and miles driven for each month if the user types S then: . Ask the user for the Month Name Search the array for that Month Name and find its position in the Monthname array Display the MonthName, and MilesDriven at the position found during the above search. . If the user types M then Search the array tor the smallest miles in MilesDriven array and find its position. Display the MonthName, and MilesDriven at the position found during the above search e If the user types L then: Search the array for the largest Miles in MilesDriven array and find its position. Display the MonthName, and MilesDriven at the position found during the above search . . . If the user types E. then: Terminate the program after displaying the message shown in the test case scenario below . if the user types any other option. e Display the message "Invalid Choice. Try againt and go back and display the menu. PS: You program must keep displaying the menu until the user types the option E, to exit the program. For exact Input and output messages, please refer to the test case scenario
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
