subject

Write a basic program that performs simple file and mathematical operations. a. Write a program that reads dates from input, one date per line. Each date's format must be as follows: March 1, 1990. Any date not following that format is incorrect and should be ignored. Use the find() method to parse the string and extract the date. The input ends with -1 on a line alone. Output each correct date as: 3/1/1990.
b. After the program is working as above, modify the program so that it reads all dates from an input file "inputDates. txt" (an Example file is attached).
c. Modify your program further so that after parsing all dates from the input file "inputDates. txt", it writes out the correct ones into an output file called: "parsedDates. txt".
Ex: If the input is:
March 1, 1990
April 2 1995
7/15/20
December 13, 2003
-1
then the output is:
3/1/1990
12/13/2003

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 21:30, khikhi1705
What elements related to the release and success of the nes console do you see in modern console releases? what elements are no longer relevant to modern console gaming?
Answers: 3
image
Computers and Technology, 23.06.2019 22:30, delawdermia27
The output voltage of a power supply is assumed to be normally distributed. sixteen observations are taken at random on voltage are as follows: 10.35, 9.30, 10.00, 9.96, 11.65, 12.00, 11.25, 9.58, 11.54, 9.95, 10.28, 8.37, 10.44, 9.25, 9.38, and 10.85
Answers: 1
image
Computers and Technology, 24.06.2019 10:00, lashaunahard
Each time you save a document, you will need to type in the file type in which it should be saved you can select the save button to save it with the same file name if it has been previously saved you will need to select the location to save the file you will need to use the save as dialog box
Answers: 1
image
Computers and Technology, 24.06.2019 17:40, finedock
Anewly established internet company with 40 employees needs your advice. they are looking for a collaboration tool and have narrowed their choices to gotomeeting, webex, and my web conferences. after reading the information presented in this chapter and other sources, prepare a two- page document ( double spaced) that includes two advantages and two disadvantages of each tool. which one is your final recommendation? why did you choose that tool over the other two?
Answers: 3
You know the right answer?
Write a basic program that performs simple file and mathematical operations. a. Write a program tha...

Questions in other subjects:

Konu
History, 04.01.2021 19:30