国外一些编程专业的作业难写吗？programming代写老师经验丰富吗? 国外programming代写 现在计算机专业越来越吃香，因为现在是互联网时代，很多岗位都需要计算机能力，因此很多大学生会选择学习相关计算机专业...View details
HIM3002: Computer Programming for Healthcare
Lab Assignment 1: Basic Programming (10%)
医疗保健计算机编程代写 Background In Lecture 1 to Lecture 4, we learned the python programming skills to compose programs using container types, functions,
In Lecture 1 to Lecture 4, we learned the python programming skills to compose programs using container types, functions, flow control structure, file handlers and exception handlers. In this assignment, you are required to write a python program that can efficiently handle patient records using the skills that you learned.
Suppose you are given a text file, named “all_patients.txt”, storing the name, the gender and the age of patients, in the format below.
Abby Branch F 34
Alejandro Glover M 34
Allen Goldstein M 41
Amy Pearson F 36
The name, the gender and the age of each row are delimited by a tab (‘\t’) character, while each line ends with the newline (‘\n’) character.
Your task is to write a program that can read the file “all_patients.txt”, process each record to complete the following requirements:
Formulate an account name for each patient, with format “<first letter of a given name><surname>”, where all characters in the account name are lower case letters. For example, if the name of the patient is “Abby Branch”, the account name is “abranch”.
Assign an account holder for each patient based on the following rules:
|Gender of patients||Age of patients||Account holder|
|M||Younger than or equal to 30||John|
|M||31 – 40||Peter2|
|M||Older than 40||Mary|
|F||Younger than or equal to 30||Sam|
|F||31 – 40||Kathy|
|F||Older than 40||Mandy|
Write a file named “account_info.txt” that contains lines as shown below, with the account name and the account holder appended to the record of each patient. Use “\t” as the delimiter and “\n” as the newline character.
Abby Branch F 34 abranch Kathy
Alejandro Glover M 34 alejandro Peter
Allen Goldstein M 41 agoldstein Mary
Amy Pearson F 36 apearson Kathy
If the file “all_patients.txt” is not found in the same directory of the program, the program should print a message “File Not Found!”.
You can re-use any codes you learned from Week 1 to Week 5. Name your script
“HIM3002_Lab1.py” and submit it through the Blackboard.
*Bonus Part* 医疗保健计算机编程代写
You will get 2% bonus on completing the following requirement.
For the account name above, if an account name already exists, use an account name appended with an integer to distinguish different account names. For example, if there are three patients with the same account name “abranch”, the second one should be named as “abranch1” and the third one should be named as “abranch2”.