0% found this document useful (0 votes)
115 views1 page

Assignment #9-10 (4%) : Driver - Name (String), License - Number (String), Number - of - Tickets (Integer)

The document provides instructions for two programming assignments involving sequential data files. Assignment 1 involves creating a program that prompts the user for a license number and displays the corresponding driver's name and number of tickets by searching parallel arrays loaded from a "licenses" file. Assignment 2 involves developing a program that reads transaction information from a file, calculates the total amount spent, and writes that total to the end of the file.

Uploaded by

prabh kaur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
115 views1 page

Assignment #9-10 (4%) : Driver - Name (String), License - Number (String), Number - of - Tickets (Integer)

The document provides instructions for two programming assignments involving sequential data files. Assignment 1 involves creating a program that prompts the user for a license number and displays the corresponding driver's name and number of tickets by searching parallel arrays loaded from a "licenses" file. Assignment 2 involves developing a program that reads transaction information from a file, calculates the total amount spent, and writes that total to the end of the file.

Uploaded by

prabh kaur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

CSD 1133 Problem Solving/Program Logic

Assignment #9-10 [4%]


Lecture 10 Sequential Data Files
For either of the exercises write:
1. Choice of Pseudo or Raptor
2. Python for both

Submit all files, Input file, .py, .rap if you chose Raptor instead of Pseudo. Two input files if needed separately
for Python and Raptor. Do not submit snapshots.

Question 1:
The Department of Motor Vehicles in the state of Euphoria has finally decided to computerize its list of
licensed drivers. Write a program that makes use of an existing file named "licenses" with records of the
following form:

driver_name (String), license_number (String), number_of_tickets (Integer)

The program will prompt the user to enter the license number, then it displays the corresponding driver’s
name and number of tickets.

Hint: load the "licenses" file into three parallel arrays and search one of these for the license number
input.

Question 2:

The information of credit card transactions are stored in file with the following format:
date, company, amount

Example:
15/1/2021, Best Buy, TV, $1200.54
20/1/2021, Costco, Chair, $220.37

Develop a program that reads the information of transactions from a file and calculates the total
amount of payments that are made. Then, adds the following sentence to the end of that file:

Total amount spent: $total calculated amount.

For example:
“Total amount spent: $1420.91.

You might also like