Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

RUN ONLY IN PYTHON 2!!!! DESCRIPTION Write program with functions and Arrays to Implement the following. Miles Driven Application using Arrays and Functions. Not using

RUN ONLY IN PYTHON 2!!!! image text in transcribed
image text in transcribed
image text in transcribed
DESCRIPTION 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. "Fepruary, 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. If the user types P. Populate all the arrays. Collect 12 month names and miles driven for each month. If the user types S then: o Ask the user for the Month Name. eo Search the array for that Month Name and find its position in the Monthname array. 0 Display the MonthName, and MilesDriven at the position found during the above search If the user types M then: 0 Search the array for the smallest miles in MilesDriven array and find its position. the MonthName, and MilesDriven at the position found during the above search. . If the user types L then o Search the array for the largest Miles in MilesDriven array and find its position 0 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: Display the message "Invalid Choice. Try again 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. Cortinuandoutnut me 305 TJ. Tu progla must keep uisplaying 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. Mimir Requirements: The file name must be CS902Module Homework3.py TEST Scenario: **** MENU OPTIONS **** 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 Please enter your choice: 'P Please enter a month name: 'JAN' Please enter miles driven for the month: 120 Please enter a month name: 'FEB Please enter miles driven for the month: 234 Please enter a month name: 'MARCH Please enter miles driven for the month: 542 Please enter a month name: "APRIL Please enter miles driven for the month: 743 Please enter a month name: 'MAY Please enter miles driven for the month: 283 Please enter a month name: 'JUNE Please enter miles driven for the month: 999 Please enter a month name: "JULY Please enter miles driven for the month: 731 Please enter a month name: 'AUG Please enter miles driven for the month: 777 Please enter a month name: 'SEPT Please enter miles driven for the month: 826 Please enter a month name: ' OCT Please enter miles driven for the month: 932 Please enter a month name: 'NOV Please enter miles driven for the month: 22 Cluss.mimib Please enter miles ariven for the month: 22 Please enter a month name: 'DEC Please enter miles driven for the month: 958 **** MENU OPTIONS **** 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 Please enter your choice: 'S Please enter the month name to search: 'JAN The month name is: JAN and the miles driven for the month is: 120 **** MENU OPTIONS 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 Please enter your choice: 'S Please enter the month name to search: 'OCT The month name is: OCT and the miles driven for the month is: 932 **** MENU OPTIONS **. 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 Please enter your choice: 'M' The result for searching the smallest miles: The month name is: NOV and the miles driven for the month is: 22 **** MENU OPTIONS **** 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 Please enter your choice: "L" The result for searching the largest miles: The month name is: JUNE and the miles driven for the month is: 999 *** MENU OPTIONS Type P to populate miles and month name. Type S to search for Month Type M to search for Month name with smallest Miles

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Upgrading Oracle Databases Oracle Database New Features

Authors: Charles Kim, Gary Gordhamer, Sean Scott

1st Edition

B0BL12WFP6, 979-8359657501

More Books

Students also viewed these Databases questions