+ All Categories
Home > Documents > Introduction to PASS, and Exercises on Operators and Basic I/O.

Introduction to PASS, and Exercises on Operators and Basic I/O.

Date post: 12-Jan-2016
Category:
Upload: branden-terry
View: 222 times
Download: 0 times
Share this document with a friend
Popular Tags:

of 11

Click here to load reader

Transcript

Introduction to Programming

Introduction to PASS, and Exercises on Operators and Basic I/OLab 3

32. Exercises on Operators and Basic I/OQ1a. Download area.cpp file from the course website. There are syntax/logical errors in this area.cpp file, please correct them.

Program reads the width and height of a rectangle. The program computes and output the area of the rectangle. Is the program easy to understand? Why?

52. Exercises on Operators and Basic I/OQ1b. Revise program to print notes for the input and output of the program

Test your program using PASS

Q1c: Improve the programming style of the programMore meaningful variable name to reflect the purpose of the variableIndentation (use the tab character to indent)Add comments;62. Exercises on Operators and Basic I/OQ2a: Body Mass Index (BMI)Read the weight and height of a person

Calculate and print the Body Mass Index (BMI)

Test your program using PASS72. Exercises on Operators and Basic I/O

- Consider the data type needed, int or double? - To print to 2 decimal places, you may use cout


Recommended