Description
Objectives:
1) Learn basic input with scanf
2) Learn printf formatting
3) Learn basic computation using operators
Description
In this programming assignment you will code a basic body mass index calculator
(BMI). The calculator will prompt for the user’s first and last name, the user’s height in
inches, and the user’s weight in pounds.
Tasks:
1. The program will prompt for the user’s first and last name.
2. The program will prompt for the user’s height in inches, and weight in pounds.
These values will be whole numbers
3. The program will compute the user’s BMI. This will include some metric
conversion and you will have to research the formula for BMI.
4. The program will display the results as shown in the following example. You
must include the “number” bar which will assist in grading.
5. Field widths and formatting for all output values must match the following output
exactly. For example, the BMI must have one significant decimal place, there
should be no space between the feet and inches output (5’9”), and the first and last
names have opposite justification.
$ ./a.out
Enter your first and last name
Barak Obama
Enter (int) height in inches and (int) weight in lbs
72 190
01234567890123456789012345678901234567890123456789
Barak , 72 inches is 6’0″
Obama, Your BMI is 25.8
Deliverables:
1) Submit the C source code as an attachment to the TA Fernando Cervantes:
fcervantes@miners.utep.edu. Name your program firstinitiallastname_bmi.c.
Thus, if President Barak Obama were taking this class he would name his file
“bobama_temp.c”.
2) The subject line must be “EE 2372 Assignment 2” (don’t include the quotes).
Scoring:
Your grade for this assignment will be determined by three criteria. The first criterion
determines if your program compiles and runs producing the correct result. The correct
result must adhere to what is specified in the Tasks section. The second criterion is
whether the program follows the interface specification outlined in the Tasks section.
The third criterion determines if your source code is well documented. Your source code
must include (at the top) your name, class section, due date, assigned date, and a small
description of your program. For this assignment, each line of code should have a
descriptive comment.
Operation/Successful Demonstration 60%
Was a C source file submitted? 10%
Does the program compile on Linux? 15%
Does the program run correctly on Linux? 35%
Adherence to Interface Specification 30%
Does the program adhere to the interface specification
in the tasks section? 30%
Comments 10%
Is the source code well-documented? 10%
Lateness 10% per day (including
weekends and holidays)