Order ID:89JHGSJE83839 | Style:APA/MLA/Harvard/Chicago | Pages:5-10 |
Instructions:
Process Promotional Credits for Customers Program
For this programming assessment, you will write a program to process promotional credits for customers.
Due to a recent weather event, Sunnyside Scenic Sailings has had to cancel numerous reservations for its customers. To persuade customers to reschedule their travel plans for a future date, Sunnyside would like to give customers a promotional credit.
You will be working on some of the back-end processing for Sunnyside. Your program should read in the customer information from a text file, add one new customer record, append the new promotional credit, and write out the new records to a CSV file. A CSV file is a comma-separated values file that allows data to be saved in a tabular format. Sunnyside can use this .csv file to import the records into their spreadsheet or database management applications.
Program Instructions—Part 1B:
First, you will create the starting data text file.
Open Notepad (or any other plain text editor) and add the following data to the file (exactly as shown):1,Morrison,Marion,1313 Mockingbird Lane,Atlanta,GA
2,Jane,Mary,1640 Riverside Drive,Hill Valley,CA
3,Rubble,Barney,84 Beacon Street,Boston,MA
4,Davis,Betty,10 Stigwood Avenue,New York,NY
Save the file as IT244_U5_Data.txt.
Reference: Refer back to your readings from Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 7: Lists.
Define a file handle and open your text data file for reading.
Hint: If you want to reference the file by its name using a relative file path like “IT244_U5_Data.txt”, this file must exist in the same folder with your Python source code (.py) file. Otherwise, you will need to include the full file path, such as C:/MyFolder/MySubFolder/MySubSubFolder/MyFile.txt
Reference: Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 9: Defining a Path to a File / Reading From and Writing to a File / File Handle.
Use a for loop to access each record in the file and append each record to the list variable each iteration.
Hint: Use strip to remove any line breaks like recordsList.append(line.strip())
Reference: Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 9: Writing and Reading a Line at a Time With a File.
Close the file.
Reference: Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 9: Defining a Path to a File / Reading From and Writing to a File/File Handle.
Append the following string of data to the list (exactly as shown):
5,Brady,Bobby,4222 Clinton Way,Los Angeles,CA
Hint: recordsList.append(“5,Brady,Bobby,4222 Clinton Way,Los Angeles,CA”)
Open a new csv file for writing. Name this file IT244_U5_PromoCredit.csv.
Reference: Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 9: Defining a Path to a File / Reading From and Writing to a File / File Handle.
Write a record to the file that contains the following values that will serve as the header record in your csv file:
Customer ID, Last Name, First Name, Address, City, State, Promo Credit
Hint: add \n to the end of this string to force a new line.
Reference: Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 9: Defining a Path to a File / Reading From and Writing to a File / File Handle.
Use another for loop to process the list data.
With each iteration through the loop, write out a record.
Append the $500 promotional credit.Hint: This can be done by simply adding the value in a string like file.write(“,$500\n”). Don’t forget the newline character at the end.
Increment the record count variable.
Close the file.
Conclude the program by printing a statement that includes the record count:
There were 5 records written to the promo credits csv file.
Summary of files used in this program:
INPUT: IT244_U5_Data.txt
1,Morrison,Marion,1313 Mockingbird Lane,Atlanta,GA
2,Jane,Mary,1640 Riverside Drive,Hill Valley,CA
3,Rubble,Barney,84 Beacon Street,Boston,MA
4,Davis,Betty,10 Stigwood Avenue,New York,NY
OUTPUT: IT244_U5_PromoCredit.csv
(This table represents the .csv file opened in a spreadsheet application)
Customer ID
Last Name
First Name
Address
City
State
Promo Credit
1
Morrison
Marion
1313 Mockingbird Lane
Atlanta
GA
$500
2
Jane
Mary
1640 Riverside Drive
Hill Valley
CA
$500
3
Rubble
Barney
84 Beacon Street
Boston
MA
$500
4
Davis
Betty
10 Stigwood Avenue
New York
NY
$500
5
Brady
Bobby
4222 Clinton Way
Los Angeles
CA
$500
RUBRIC |
||||||
Excellent Quality 95-100%
|
Introduction
45-41 points The background and significance of the problem and a clear statement of the research purpose is provided. The search history is mentioned. |
Literature Support 91-84 points The background and significance of the problem and a clear statement of the research purpose is provided. The search history is mentioned. |
Methodology 58-53 points Content is well-organized with headings for each slide and bulleted lists to group related material as needed. Use of font, color, graphics, effects, etc. to enhance readability and presentation content is excellent. Length requirements of 10 slides/pages or less is met. |
|||
Average Score 50-85% |
40-38 points More depth/detail for the background and significance is needed, or the research detail is not clear. No search history information is provided. |
83-76 points Review of relevant theoretical literature is evident, but there is little integration of studies into concepts related to problem. Review is partially focused and organized. Supporting and opposing research are included. Summary of information presented is included. Conclusion may not contain a biblical integration. |
52-49 points Content is somewhat organized, but no structure is apparent. The use of font, color, graphics, effects, etc. is occasionally detracting to the presentation content. Length requirements may not be met. |
|||
Poor Quality 0-45% |
37-1 points The background and/or significance are missing. No search history information is provided. |
75-1 points Review of relevant theoretical literature is evident, but there is no integration of studies into concepts related to problem. Review is partially focused and organized. Supporting and opposing research are not included in the summary of information presented. Conclusion does not contain a biblical integration. |
48-1 points There is no clear or logical organizational structure. No logical sequence is apparent. The use of font, color, graphics, effects etc. is often detracting to the presentation content. Length requirements may not be met |
|||
You Can Also Place the Order at www.collegepaper.us/orders/ordernow or www.crucialessay.com/orders/ordernow
Process Promotional Credits for Customers Program |
Process Promotional Credits for Customers Program