Answered step by step
Verified Expert Solution
Link Copied!

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
image text in transcribed
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Probabilistic Databases

Authors: Dan Suciu, Dan Olteanu, Christopher Re, Christoph Koch

1st Edition

3031007514, 978-3031007514

More Books

Students also viewed these Databases questions

Question

9. Describe the characteristics of power.

Answered: 1 week ago

Question

3. Identify and describe nine cultural value orientations.

Answered: 1 week ago