PRG 211 Week 5 Final -Calorie Management.docx
PRG 211 Week 5 Final -Calorie Management.docx PRG211
Popular in Computer Programming
This 8 page Study Guide was uploaded by Topseller Notetaker on Friday November 6, 2015. The Study Guide belongs to PRG211 at Ashford University taught by in Fall 2015. Since its upload, it has received 44 views. For similar materials see in Computer Programming at Ashford University.
Reviews for PRG 211 Week 5 Final -Calorie Management.docx
Report this Material
What is Karma?
Karma is the currency of StudySoup.
You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!
Date Created: 11/06/15
Running Head: Calorie Management 1 Week 5 Final Project: Calorie Management PRG/211 Calorie Management 2 Introduction Development teams and programmers possess the knowledge of writing code to educe the power of computers to solve problems and perform various tasks. Proper communication with customers and organizations ensures a thorough understanding of a particular problem so a program can be designed to meet needs and expectations of customers and organizations. Successfully solving problems with program software requires planning and analyzing to ensure all aspects of the problem meet the required expectations. “Planning your program using a sequence of steps referred to as the program development cycle, will enable you to use your time efficiently and will help you design errorfree programs that produce the desired output” (INFORMATION TECHNOLOGY Focus Program). A programmer needs to first understand the problem or need to be addressed so a viable plan can be created to solve the issue. The programmer then needs to analyze the problem using the information given to provide the results needed. The programmer would then design a program to solve the problem based on the needs of the organization. The program then needs to be coded by writing statements in computer language to carry out the program design. After the program has been implemented it needs to be tested to ensure the program solves the problem it was intended to resolve. Problem Statement An organization has awarded our program development team a contract to develop a program to manage daily calorie intake. The organization wants to identify if whether a person is balancing calories consumed with those being expended. Our programmers are to take into account the balance of calories daily by gaining knowledge of what foods and beverages contain Calorie Management 3 what number of calories. Using this information the program will give an account if a user took in to many calories or to little which could result in weight gained or lost. Inputs/Outputs The input for a program is the variable information needed by the computer in order to produce a result. The computer produces a result in the form of an output. In regards to a program that performs a calculation on calories, the input needed is the caloric intake of the user, the amount of calories the user burned during exercise, and the calories the user burned while resting or the user’s Basal Metabolic Rate (BMR) (National Heart Lung and Blood Institute). The computer then adds the BMR to the calories expended during exercise and subtracts them from the calories consumed. If the number is positive then the user consumed more calories than they expended, and if the number is negative the user has a deficit of calories. The variable output is displayed with text as well as the result. The pseudocode for a program provides the plain English description of the steps a program will execute. Pseudocode is created before the coding begins and is used by the programmer in order to gain a greater understanding of the steps of the program. Below is the pseudocode for as calorie counter and BMI program: Program begins. Create an array that will house five elements for the calorie intake amounts. Create a procedure that contains outputs that informs the user about the purpose of the program. o Message: Hello and welcome to team A’s Calorie Management Calculator. This calculator is used as a screening tool to identify possible weight and calorie intake issues. Now let’s get started. The first input is the BMR or the number of calories burned while resting. o User enters their BMR The second input is the total number of calories the user burned during exercising. Calorie Management 4 o User enter the calories burned during exercise The program then calls a procedure for calorie intake. This uses a “for” statement that asks the user to input their calories for 5 different meals or snacks they had throughout the day. The values are placed in the Calorie array and then totaled together. The output is a message of their total calories consumed and the total is displayed. Next an assignment adds the BMR input to the Exercise input and then subtracts that total from the total calories consumed and divides that total by 3,500 calories: o Total = (calories consumed – (BMR + calories burned))/3500 The output of the calculation uses an If/Then statement to tell the user how many pounds they lost. If the calculation returns a positive number the user gained that number in pounds and if the user returns a negative number the user lost that number in pounds. Following the calorie portion of the program, a Body Mass Index procedure or BMI is called. This procedure gives the user an opening statement regarding the next step. The first input is the user’s height then the user is asked for their weight. An assignment then calculates the BMI using the formula (weight*703)/ (height^2). The program now uses a series of “If/Then” statements to determine which BMI category the user falls under. o If the user’s BMI is less than 18.5 then the user is underweight. o If the user’s BMI is between 18.6 and 24.9 then the user is normal. o If the user’s BMI is between 25 and 29.9 then the user is overweight. o If the user’s BMI is greater than 30 then the user is obese. o With each statement an output displays if they fall into that range. When the BMI procedure is complete the program ends. Pseudocode Begin program Write “***Hello and welcome to team A’s Write “Calorie Management Calculator***” Write “This calculator is used as a screening” Write “tool to identify possible weight and” Calorie Management 5 Write “calorie intake issues.” Write “Now let’s get started.” Declare Calorie as string Declare C as integer Declare total as float Declare bmi as float Write “How many calories did you burn” Write “today simply resting? ” Input Calories Write “How many calories did you burn” Write “exercising today? ” Input Calories Set sum = 0 For (C = 5; Calorie; C ++) Write “How many calories did you consume at meal”, + C Input Meals Set sum + calorie(C) Set total = sum End For Write “The total calories you consumed for the day is: ”, + total Set Grand = (total – (BMR + Exercise)) / 3500 IF Grand < 0 then Set Grand = Grand Write “You lost “, + Grand + ,“lbs today” Else Set Grand = Grand Write “You gained “, + Grand +,”lbs today.” End IF Write “And now lets calculate your Body Mass Index, BMI. ” Write “Please enter your height in inches: ” Calorie Management 6 Input height Write “Please enter your weight: ” Input weight Set bmi = (weight * 703) / (height^2) If bmi < 18.5 then Write “Your BMI is: ”, + bmi + ,”and you are considered to be” Write “underweight for your height and weight.” Else IF bmi < 24.9 then Write “Your BMI is: ” + bmi +, “and you are considered” Write “to be normal for your height and weight.” Else IF bmi < 29.9 then Write “Your bmi is: “, + bmi +, “and you are” Write “considered to be overweight for your” Write “height and weight” Else Write “Your bmi is: ”, + bmi + ,” and you are” Write “considered to be obese for your height” Write “and weight.” End IF End IF End IF End program Desk Check In the chart below you will see how the process will go when individuals have imputed their information. One example in the chart below shows a person who consumed a total of 1877 calories. The next column shows how many calories were burnt in exercise and resting. The Calorie Management 7 amount gained/lost shows if the user lost or gained weight. The excess column shows if the user has calories in excess or lost excess calories. The final column is the user’s body mass index (BMI) to determine if the user is over, under, normal or obese according to their height and weight. Check Calories Exercise/Calories Amount Excess BMI Burnt Gained/Lost Calories Check 1 1877 1285 +.49 592 Calories 27.12 Check 2 2325 1100 +.35 1225 Calories 24.1 Check 3 1195 1400 .059 205 Calories 23.63 Conclusion To tailor a program to an organizations specific need a problem statement helps to analyze and guide developers to reach the results the organization is expecting. Using pseudo code provides a roadmap to what is needed for the program to run successfully and a layout of each part of the program that needs to be executed for a simpler understanding for modification. Testing a program ensures that each function of the program is coded to perform its required process. Testing also enables the programmer to have the confidence that each module is accurate and produces its desired result. Calorie Management 8 Reference INFORMATION TECHNOLOGY Focus Program. (n.d.). Retrieved 2011, from Advanced Programming Languages: http://itfp.lps.org/progPlan.html National Heart Lung and Blood Institute. (n.d.). Retrieved 2011, from Nutrition Academic Award ProgramAdvancing nutrition, medical education, and clinical practice: http://www.nhlbi.nih.gov/funding/training/naa/curr_gde/b1_principles.htm U.S. Department of Health & Human Services. (n.d.). Retrieved 2011, from National Heart Lung and Blood Institute: http://www.nhlbisupport.com/bmi/
Are you sure you want to buy this material for
You're already Subscribed!
Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'