From the course: COBOL Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Solution: Calculate BMI

Solution: Calculate BMI - COBOL Tutorial

From the course: COBOL Essential Training

Start my 1-month free trial

Solution: Calculate BMI

(upbeat music) - [Instructor] Welcome back, how did you make out? I hope you were able to add the code to correctly calculate the BMI of a person using their height in inches and their weight. Let me show you how I'd approach this problem. I'm going to start by adding my code in the procedure division. Remember we have to start in the B margin, which starts in column 12. So let me move over to column 12, seven, eight, nine, 10, 11, 12. The first thing I'm going to do is display a message. IntelliSense is really nice, and that's enabled since I added the COBOL extension in Visual Studio. So here, I'm just going to say, enter height in inches. Remember to include a period at the end of the statement. Let me move my mouse so you can see the line better. And I'm going to accept the value of the user typed into the variable height inches. Next I'll display another message that says enter weight in pounds, period, and the same…

Contents