1020: Introduction to Programming Winter 2014

Assignment 1

Due: Jan. 27, 2014 at noon

This assignment is to be done in pairs. Each pair of students should submit only one solution, but both names must be listed in the code.

In this assignment you will create a C++ program that implements a revised version of the displayBattery function, which was discussed in class, so that it outputs the battery level as a percentage of the acceptable range. We have provided the following files:

To complete this assignment, download the above files as for Assignment 0, and save them in the project directory. You must then create assign1.cpp and in it give the implementation for displayBattery, so that it outputs the battery voltage as a percentage of the functional range (3.5 - 6 V), and "Press B" on the second line, and then calls waitForB so that execution pauses until the B button is pressed and released. You must include appropriate commenting for your file and for the function.

After you have tested your program and are confident it is right, have a TA observe your robot functioning correctly and check you off, then submit only assign1.cpp using websubmit.

Last modified $LastChangedDate: 2014-01-27 10:09:11 -0330 (Mon, 27 Jan 2014) $