Question: please write using python, detailed and with steps Write a Python algorithm that takes as input a 14-digit national ID number (NID) and number representing

please write using python, detailed and with steps
please write using python, detailed and with steps Write a Python algorithm

Write a Python algorithm that takes as input a 14-digit national ID number (NID) and number representing the Adult Dose in mg. The algorithm should print the dose this patient should have, specifically, according to the user's age by using Young's rule: Adult Age Childs Dose Age + 12 Dose Hints: According to Young's rule the patient is considered a child if age is less than 12 years. Otherwise, the Adult dose is given. The NID starts with the digit "2" for 19xx years or digit "3" for 20xx years. Next, comes two digits for year of birth, then two digits for month of birth. For simplicity, consider years and months for the age but neglect days. To get the current year and month you may need to use: import datetime current_year=datetime date, today().year current_month = datetime.date.today().month Examples: 1) Input: Enter NID: 29601020201559 Enter Dose: 1000 Output: Current date: 20221 Birth date: 1996 1 Age: 26 years Dose: 1000 mg 2) Input: Enter NID: 31401150291101 Enter Dose: 100 Output: Current date: 20221 Birth date: 2014 1 Age: 8 years Dose: 40.0 mg

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!