Introduction to programming and the unix environment


Assignment: Introduction to Programming and the UNIX Environment Programming Task

Assignment Objective:

1) Develop a Python program to solve a problem.

2) Follow good program development and coding style practices.

3) Use loops and selection statements.

Assignment 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.

Our Programming and the UNIX Environment Assignment Help service have professional tutors, experienced proofreaders and skilled editors, who work altogether and fulfill the academic requirements of the university students in the most possible manner.

Tags: Programming and the UNIX Environment Assignment Help, Programming and the UNIX Environment Homework Help, Programming and the UNIX Environment Coursework, Programming and the UNIX Environment Solved Assignments, Python Programming Assignment Help, Python Programming Homework Help, Python Programming Coursework

Attachment:- Programming and the UNIX Environment.rar

Request for Solution File

Ask an Expert for Answer!!
Python Programming: Introduction to programming and the unix environment
Reference No:- TGS03027129

Expected delivery within 24 Hours