Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

MATLAB ONLY Problem 2 An elderly person living in a nursing home is taking the following medications on a weekly basis: Fosamar, 70 milligrams every

image text in transcribedimage text in transcribedMATLAB ONLY

Problem 2 An elderly person living in a nursing home is taking the following medications on a weekly basis: Fosamar, 70 milligrams every Tuesdays Vilamin D, 50,000 units, every Fridays Coumadin 5 milligrams every Mondays, Wednesdays, and Fridays and Coumadin 2.5 mil- ligrams all other days Lisinopril 5 milligrams everyday Synthroid 50 micrograms everyday before breakfast Lipilor 10 milligrams everyday before going to bed The purpose of this practice problem is to write a program to provide help for the pa- tient's supervisor with the medications schedule. The program should work as the following: First it should ask the user the day of the week: Please enter the number of the day in the week (1 for Monday, 2 for Tuesday, 3 for Wednesday, etc.): (a) Then, according to the schedule above, it should output the list of medication and the instruction for that day. For example, if the user enters 5 (i.e. Friday), the output should be: Medication list for Friday includes: Lisinopril 5 milligrams Synthroid 50 micrograms before breakfast Lipitor 10 milligrams before going to bed Vitamin D, 50000 units Coumadin 5 milligrams You have to use switch statement for this problem. If the user enters any number in- valid number, an error message should be outputted and the program should be finished. (b) Repeat part (a) but this time i the user enters an invalid number, an error mes- sage should be prompted and the user should be asked fo a new valid number. You are not allowed to use break command. This problem has 15 points (10 points for part (a) and 5 points for part (b)). Problem 2 An elderly person living in a nursing home is taking the following medications on a weekly basis: Fosamar, 70 milligrams every Tuesdays Vilamin D, 50,000 units, every Fridays Coumadin 5 milligrams every Mondays, Wednesdays, and Fridays and Coumadin 2.5 mil- ligrams all other days Lisinopril 5 milligrams everyday Synthroid 50 micrograms everyday before breakfast Lipilor 10 milligrams everyday before going to bed The purpose of this practice problem is to write a program to provide help for the pa- tient's supervisor with the medications schedule. The program should work as the following: First it should ask the user the day of the week: Please enter the number of the day in the week (1 for Monday, 2 for Tuesday, 3 for Wednesday, etc.): (a) Then, according to the schedule above, it should output the list of medication and the instruction for that day. For example, if the user enters 5 (i.e. Friday), the output should be: Medication list for Friday includes: Lisinopril 5 milligrams Synthroid 50 micrograms before breakfast Lipitor 10 milligrams before going to bed Vitamin D, 50000 units Coumadin 5 milligrams You have to use switch statement for this problem. If the user enters any number in- valid number, an error message should be outputted and the program should be finished. (b) Repeat part (a) but this time i the user enters an invalid number, an error mes- sage should be prompted and the user should be asked fo a new valid number. You are not allowed to use break command. This problem has 15 points (10 points for part (a) and 5 points for part (b))

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

Modern Database Management

Authors: Fred R. McFadden, Jeffrey Slater, Mary B. Prescott

5th Edition

0805360549, 978-0805360547

More Books

Students also viewed these Databases questions