Search the whole station

医疗保健计算机编程代写 HIM3002代写 Healthcare代写

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.

Task 医疗保健计算机编程代写

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:

1) 医疗保健计算机编程代写

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 patientsAge of patientsAccount holder
MYounger than or equal to 30John
M31 – 40Peter2
MOlder than 40Mary
FYounger than or equal to 30Sam
F31 – 40Kathy
FOlder than 40Mandy

3) 医疗保健计算机编程代写

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

“” 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”.


更多代写:Java代写推荐  gmat枪手  英国Electronics作业代写  Essay Proofreading代写  Finance金融论文代写  案例分析论文代写

合作平台:essay代写 论文代写 写手招聘 英国留学生代写

The prev: The next:

Related recommendations