User Tools

Site Tools


faq

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
faq [2011/03/17 21:58] aanfaq [2011/03/18 16:29] (current) aan
Line 5: Line 5:
 ===I have trouble solving Question 5. Could you give us more hints?=== ===I have trouble solving Question 5. Could you give us more hints?===
  
-There are a few ways to write this program. I assume you have no problem +There are a few ways to write this program. I assume that you have no problem 
 reading the input file into a matrix. One way to write the rest of the program is reading the input file into a matrix. One way to write the rest of the program is
 to use a loop to go through all the rows in the matrix. In each pass of the loop, you  to use a loop to go through all the rows in the matrix. In each pass of the loop, you 
 take the information in one row of the matrix (which contains a person's height in inches and weight in pounds), call the IPtoCK function to convert these two numbers into cm and kg, calculate the person's BMI based on the converted cm and kg, and then determine this person's BMI category and output a line in the output file (which shows this person's take the information in one row of the matrix (which contains a person's height in inches and weight in pounds), call the IPtoCK function to convert these two numbers into cm and kg, calculate the person's BMI based on the converted cm and kg, and then determine this person's BMI category and output a line in the output file (which shows this person's
-height in cm, weight in kg, BMI value and BMI category). +height in cm, weight in kg, BMI value and BMI category).
  
 +=== To answer the second question, can we change our answer to the first question so that it can take a vector as the input? ===
  
-** The first question asks us to write a function that takes a scalar input argument.  +No, you cannot change your function for the first question in order to answer the second 
-In the second question, we are asked to use this function. However, in the second question  +
-we need to check 50 numbers. Can we change our answer to the first question so that it +
-can take a vector as an input? ** +
- +
- +
-No, you cannot change your function for the first question in order to solve the second +
 question. Your program for the second question has to call the function that only  question. Your program for the second question has to call the function that only 
-takes a scalar as the input argument. This should easily done by using a loop.+takes a scalar as the input argument. This can be easily done by using a loop.
  
  
faq.1300399120.txt.gz · Last modified: 2011/03/17 21:58 by aan

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki