Introduction to Programming and the Unix Environment

Assignment Help Other Subject
Reference no: EM132419397

Introduction to Programming and the Unix Environment Programming Task

Aims -

- Develop a Python program to solve a problem.

- Follow good program development and coding style practices.

- Use loops and selection statements.

Instructions - Write a Python program to solve the following problem. Your solution should include a readme.md file (which includes details of how to run your assignment) and your Python program in a file named diet_log.py , and be submitted as a single .tgz file named a2.tgz.

If each of the files in your solution are in the current working directory, you can create the .tgz file with the following command (see man tar for more details):

tar -zc readme.md diet_log.py > a2.tgz

To test your archive contains the correct files, copy it to an empty directory, change to that directory and run:

tar -zxf a2.tgz

This should result in readme.md and diet_log.py being extracted to the directory. You should ensure your solution works using the Python 3 interpreter on turing.

Problem -

Codetown Central Hospital has decided to get serious about nutrition. Patient-centred care is gaining more recognition as a vital part of a modern institution's healthcare mission, and the proper nutrition for a patient can both help speed recovery and also increase a patient's enjoyment of their healthcare stay. However, in order to make any useful changes, data are required. The manager of Codetown Central Hospital has contacted you to develop a program for use by hospital staff to collect this data, which will be used to help make informed decisions for future changes to the hospital's nutrition plan.

Your program is to first request the number of patient's dietary requirements that will be entered in the interaction with the program, and must then loop this number of times to collect the amount of protein, carbohydrates, and fat required for each patient. Once this data has been entered for each patient, your program must output the average amount of protein, carbohydrates, fat, and kilojoules required for all patients.

The average kilojoules can be calculated as kilojoules = 4.18 * (4*protein + 4*carbohydrates + 9.30*fat), where protein is the average amount of protein required (in grams), carbohydrates is the average amount of carbohydrates required (in grams), and fat is the average amount of fat required (in grams).

Your program should ensure that the number of patients being entered is a positive integer, and that all values for protein, carbohydrates, and fat are non-negative numbers. If this is not the case, your program should prompt the user to enter the information that was entered incorrectly again.

Note that program specifications are not always clear. If you are uncertain about any aspect, you are typically better off asking than making assumptions. Please use the appropriate discussion forum to ask for clarification, if required.

Attachment:- Assignment File.rar

Reference no: EM132419397

Questions Cloud

Describe the concept of continuity planning : Identify one aspect of big data and data mining that is interesting to you. Describe the concept of continuity planning. If you were the director or manager.
Brief history of computers-What computer scientists do : A brief history of computers. What computer scientists do. Your view of how the computer science profession will evolve over the next 10 years
What is the focus of your interview and product, service : What metrics will you use to understand the data and information received from the interview process?Who will you interview? Individuals or Families?
What types of food consists of the jamaican diet : Make sure you address each piece of the case study. What types of food consists of the Jamaican diet? How do Bush Tea effect diets and high blood pressure?
Introduction to Programming and the Unix Environment : Introduction to Programming and the Unix Environment Programming Task - Develop a Python program to solve a problem
What is known and what is not known in the evidence : While the implementation plan prepares students to apply their research to the problem or issue they have identified for their capstone change proposal project.
About cannabis industry assignment : About Cannabis Industry Assignment help and solutions:-How is Cannabis beneficial for Medical and Recreational use ?
How will you use the concepts in course to identify project : How will you use the concepts in this course to identify, guide, and evaluate your final MSN practicum project? Please share your topic or idea for your.
Discuss about the natural or manmade disaster : What spiritual considerations surrounding a disaster can arise for individuals, communities, and health care providers? Explain your answer in the context of.

Reviews

Write a Review

Other Subject Questions & Answers

  Why are drugs classified in the categories

Why are drugs classified in the categories they are and Give a description of the actions of drugs in each category - What is chemotherapy and which diseases

  Importance in the transition into adulthood

"The most widely used criteria for deciding whether a person has reached adulthood are role transitions, which involved assuming new responsibilities and duties. Certain role transitions have long been recognized in Western society as key markers for..

  Discuss the extent to which holding inmates

discuss the extent to which holding inmates in jail prior to his/her trial is or is unconstitutional

  Explain how are the assessments alike

How are the assessments alike. How are the assessments different. What are the strengths of your peer's chosen assessment

  Which areas of the hospital or clinic were most concerned

Write a 500-750-word essay on the Stages-of-Life and the influence of age in health care from a patient's perspective. Interview a friend or family member.

  Identify potential hazards in the department

Identify potential hazards in the department and develop a schedule when you will check on the performance of equipment to make sure these are being cleaned.

  Define economics trumps ideology

The story of the Populist movement is both ideological and economic. Can they be separated

  Explain why the issue poses a problem or concern

Describe the issue, being sure to identify the relevant age and/or grade levels. Explain why the issue poses a problem or concern, being sure to address human development and cognitive processes. Discuss at least one innovative teaching and/or learn..

  Describe the concept of externalizing the problem

Describe the concept of externalizing the problem using an example from your own work or life experience.

  Contrast the suicides of jocasta in oedipus

Compare and contrast the suicides of Jocasta in Oedipus with those of Antigone, Haemon, and Eurydice in Antigone.

  What kinds of questions were in your mind as you entered

What kinds of questions were in your mind as you entered your service-learning site? While there, what did you observe and what were your reactions to these observations?

  Mechanical properties of a metal

The mechanical properties of a metal may be improved by incorporating fine particles of its oxide. Given that the moduli of elasticity of the metal and oxide are, respectively, 60 GPa and 380 GPa, what is the (a) upper-bound, and (b) lower-bound modu..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd