Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started