Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Lab6 (10pts) Example Program Run (No exception): Write a program that prompts the user to enter a line number. The program will search the acme_customers_updated.csv
Lab6 (10pts) Example Program Run (No exception): Write a program that prompts the user to enter a line number. The program will search the acme_customers_updated.csv file for the line number and display the customer (first name, last name, city, state) at that line. Enter a line number: 1 The program should handle the following error scenarios using exception handling: James Butt New Orleans LA 1. If the user enters a non-numeric value, display a message letting the user know the value entered is invalid Example Program Run (Invalid line number entered): 2. If the line number entered is not a valid line in the file, display a message indicating the line was not found in the file 3. If the file (acme_customers_updated.csv) is not found, display a message to the user Enter a line number: q Note: Invalid line number entered 1. Students are not required to use functions in the program solution, but adding functions would be the code more readable and better organized Example Program Run (Line not found in the file) General Program flow Enter a line number: 34567 1. Load data from the file 2. Prompt the use for a line number 3. Search for the line in the file and display the customer at the target line Required items: Example Program Run (File not found) 1. Program prompts for a line number 1pt 2. Handle exception that may arises due to the user entering a non-numeric value 1.5pt 3. Handle exception that may arises if the line number is not in the file 1.5pts Enter a line number: 5 4. Handle file not found exception 1.5pt Error encounter while opening the file 5. Read the file 2.5pts 6. Display customer at the target line 2pts
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started