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

  Cross-cultural opportunities and conflicts in canada

Short Paper on Cross-cultural Opportunities and Conflicts in Canada.

  Sociology theory questions

Sociology are very fundamental in nature. Role strain and role constraint speak about the duties and responsibilities of the roles of people in society or in a group. A short theory about Darwin and Moths is also answered.

  A book review on unfaithful angels

This review will help the reader understand the social work profession through different concepts giving the glimpse of why the social work profession might have drifted away from its original purpose of serving the poor.

  Disorder paper: schizophrenia

Schizophrenia does not really have just one single cause. It is a possibility that this disorder could be inherited but not all doctors are sure.

  Individual assignment: two models handout and rubric

Individual Assignment : Two Models Handout and Rubric,    This paper will allow you to understand and evaluate two vastly different organizational models and to effectively communicate their differences.

  Developing strategic intent for toyota

The following report includes the description about the organization, its strategies, industry analysis in which it operates and its position in the industry.

  Gasoline powered passenger vehicles

In this study, we examine how gasoline price volatility and income of the consumers impacts consumer's demand for gasoline.

  An aspect of poverty in canada

Economics thesis undergrad 4th year paper to write. it should be about 22 pages in length, literature review, economic analysis and then data or cost benefit analysis.

  Ngn customer satisfaction qos indicator for 3g services

The paper aims to highlight the global trends in countries and regions where 3G has already been introduced and propose an implementation plan to the telecom operators of developing countries.

  Prepare a power point presentation

Prepare the power point presentation for the case: Santa Fe Independent School District

  Information literacy is important in this environment

Information literacy is critically important in this contemporary environment

  Associative property of multiplication

Write a definition for associative property of multiplication.

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