Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CS 2351 Programming Assignment Stage 1 (3 points) Given two inputs, intFile that contains a line of integers and target, write a script that determines

image text in transcribed

CS 2351 Programming Assignment Stage 1 (3 points) Given two inputs, intFile that contains a line of integers and target, write a script that determines if target exists in intFile Your program shall first check if all integers in intFile are valid. If an invalid integer is found in the file, your program shall issue an error message and exit Your script shall be executed as: yourScript intFile target . Stage 2 (3 points) Modify your script in the stage 1 such that if both intFile and target are missing, the script shall prompt user to input a line of integers and a target integer to be found .Your program shall now be executed as: yourScript intFile target or yourScript You do not need to consider the situation where only one argument is provided Stage 3 (4 points) Modify your script in the stage 2 such that the user could also specify an output file to save the result. .Your program shall now be executed as: yourScript intFile target or yourScript or yourScript intFile target -o outputFile or yourScript-o outputFile Your program shall check if outputFile already exists. If it exists, it shall prompt user if s/he would like to overwrite the file. If a "y" is provided, vour program shall proceed and overwrite the file with the result. If a "n" is provided, your program shall prompt user for another filename and check its existence. CS 2351 Programming Assignment Stage 1 (3 points) Given two inputs, intFile that contains a line of integers and target, write a script that determines if target exists in intFile Your program shall first check if all integers in intFile are valid. If an invalid integer is found in the file, your program shall issue an error message and exit Your script shall be executed as: yourScript intFile target . Stage 2 (3 points) Modify your script in the stage 1 such that if both intFile and target are missing, the script shall prompt user to input a line of integers and a target integer to be found .Your program shall now be executed as: yourScript intFile target or yourScript You do not need to consider the situation where only one argument is provided Stage 3 (4 points) Modify your script in the stage 2 such that the user could also specify an output file to save the result. .Your program shall now be executed as: yourScript intFile target or yourScript or yourScript intFile target -o outputFile or yourScript-o outputFile Your program shall check if outputFile already exists. If it exists, it shall prompt user if s/he would like to overwrite the file. If a "y" is provided, vour program shall proceed and overwrite the file with the result. If a "n" is provided, your program shall prompt user for another filename and check its existence

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

Knowledge Discovery In Databases

Authors: Gregory Piatetsky-Shapiro, William Frawley

1st Edition

0262660709, 978-0262660709

More Books

Students also viewed these Databases questions