Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

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

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions

Question

What does it mean to maximize value?

Answered: 1 week ago

Question

=+ Are unions company-wide, regional, or national?

Answered: 1 week ago

Question

=+j Explain the litigation risks in international labor relations.

Answered: 1 week ago