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 - COBOL Tutorial
From the course: COBOL Essential Training
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
Set up a COBOL environment1m 39s
-
(Locked)
Download and install WSL2m 41s
-
(Locked)
Get started with Visual Studio Code4m 16s
-
Learn COBOL syntax2m 18s
-
(Locked)
Code a Hello World program3m 16s
-
Obtain input from the user4m 1s
-
(Locked)
Challenge: Calculate BMI2m 42s
-
(Locked)
Solution: Calculate BMI3m 42s
-
-
-
-
-
-
-
-
-
-