Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Project 6: Files and Functions Purpose: ● Gaining technical skills using Python specifically reading and writing files ● Understanding the importance of writing code in functions to do one thing...

2 answer below »
Project 6: Files and Functions
Purpose:
● Gaining technical skills using Python specifically reading and writing files
● Understanding the importance of writing code in functions to do one thing well so
they can be reused.
Directions:
● Scenario: A class roster formatted as a CSV file contains the following
information about classes in the following order with the first line of the file
containing these column headings: Last Name, First Name, Prefe
ed Name,
Prefe
ed Pronoun, SF ID#, Program Code, Phone and Email. Given the
filename student roster example.csv, extract the program code for each of the
students and convert each to the actual program name as indicated below,
writing each one on its own line in an output file. Once this program is complete,
it will allow the user to be able to import the file to create a word cloud (this part is
not programmed). Remember your program should work for ANY co
ectly
formatted CSV file with the specified filename. A sample file to be able to see
what the file can look like:
https:
en.wikipedia.org/wiki/Comma-separated_values
● Note: It will look differently if you open it with notepad as compared to using
Excel. Notepad will show the commas in it (i.e. the comma-separated values
(CSV) file type).
● What the output file should look like from using the student roster example.csv
file.
● If the program doesn't put the code appropriately into functions, the grade will
automatically be a 0.
● The following program codes are required to be used. However, bonus points
will be awarded for co
ectly importing the program codes from the file. Using the
file will also likely ensure you have them written co
ectly and take less time than
trying to type them all co
ectly or copy and paste them.
Required program codes:
Program
Code
Program Name
1002 Computer_Science
1018 General_Transfe
1023 Physics
1030 Business_Admin
1055 Engineering
3504 Computer_Information_Technology
3624 Programming
3650
Server_Administration
3651 Infrastructure
3652 Network_Security
3840 IT_Security__Infrastructure
3841 IT_Security__Healthcare
3842 IT_Security__Risk Management
1031 Accounting
1115 Agribusiness/Food_Econ
1013 Animal_Sciences
1059 Anthropology
1051 Architecture
1065 Art_Education
1057 Art_History
1061 Art_Studio
1068 Astronomy
1021 Biological_Sciences
1063 Botany
1052 Building_Construction
1022 Chemistry
1086 Clinical_Lab_Sci/Med_Tech
1005 Comm_and_Leadership_Dev
1089 Communications_And_Disorders
1131 Criminal_Justice
1066 Dance
1205 Dietetics
1136 Economics
1041 Elementary_Education
1055 Engineering
1081 English
1054 Environmental Science
1042 Exercise_and_Sport_Science
1016 Exploring_Arts_And_Humanities
1119 Exploring_General_Studies
1070 Exploring_Health_Programs
1017 Exploring_Science
1015 Exploring_Social_Science
1114 Family_Youth_and_Community
1123 Fashion_Merchandising
1083 Film_Studies
1200 Food_Science
1012 Forestry
1092 French
● Bonus points if your program only uses the file below (i.e. doesn't have the
program codes hard-coded into the code) and displays the co
ect output.
Program Codes.csv
Download Program Codes.csv
● Create the python program that solves the problem in the scenario. Make
sure to format it as seen in the screenshot below. Formatting means the
prompts for the user should be spelled and written the same way as seen in
the screenshot as well as the spacing between outputs (single-spaced,
double-spaced, etc.) should also match. Make sure variable values are
formatted the same way as seen in the screenshot.
https:
en.wikipedia.org/wiki/Hard_coding
https:
courses.sfcollege.edu/courses/453126/files/ XXXXXXXXXX?wrap=1
https:
courses.sfcollege.edu/courses/453126/files/ XXXXXXXXXX/download?download_frd=1
● This is an example of what the program running looks like using the specified
filename.
● Make sure to follow good programming practices as mentioned in Good and
Bad Programming Practices.
● You should only use modules/li
aries we have covered thus far. That is, you
are not allowed to use Python's csv module. If you do, the project will be an
automatic 0.
Grading:
https:
courses.sfcollege.edu/courses/453126/pages/good-and-bad-programming-practices
https:
courses.sfcollege.edu/courses/453126/pages/good-and-bad-programming-practices
● Make sure to review the grading ru
ic prior to submitting your assignment to
ensure you have completed everything to the appropriate standard. The
grading ru
ic is below this assignment's directions.
● If the program doesn't put the code appropriately into functions, the grade will
automatically be a 0.
● Make sure to test your program to ensure it works for all possible test cases
(assuming appropriately formatted CSV files). Your instructor will run you
program against different test data and part of your grade will be based upon
how your program performs on these test cases.
Submission:
● Upload your .py file here
Notes/Hints:
● Consider reading in the file of program codes as well and use Python Docs
for string
● to delete the "\n". Look at methods starting with "r" to find one that will work.
:)
● Consider what kind of variable type (i.e. data structure) we've talked about
earlier in the semester to use to store the program codes to make it easy to
find values. Make want to think about how to print it while you're debugging
it.
● If you want to see if you can create a word cloud with your text file, try using
WordClouds.com
● . Once there, click on the menu Word Lists and then choose the option
Extract Words from Text. Click the link that says Browse and find the file you
created. Once selected, choose Apply.
BELOW IS THE GRADING RUBRIC PLEASE FOLLOW IT:
https:
docs.python.org/3/li
ary/stdtypes.html#string-methods
https:
docs.python.org/3/li
ary/stdtypes.html#string-methods
https:
www.wordclouds.com
Processing student input file...
*3504*
*3651%
*3840%
*3841%
*3842%
*3650%
£3624*
Writing to the file...
Computer_Information_Technology
Infrastructure
IT_Security_ Infrastructure
IT Security Healthcare
IT_Security_ Risk Management
server Administration
Programming

Program finished.
Answered 3 days After Oct 24, 2022

Solution

Nidhi answered on Oct 27 2022
49 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here