Skip to content
Snippets Groups Projects
Forked from Configs / EC327 / Labs / Current
97 commits behind the upstream repository.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
LabZero_ChapterTwo.h 1.09 KiB
// CHAPTER 2

/**
 * @input  read in three integers, one per line, from the user relating to a triangle:
 *   a - the length of one side
 *   b - the length of a neighboring side
 *   gamma - the angle between the sides corresponding to a and b.
 * @output the length of the the third side of the triangle, as a floating-point
 *    number, using the law of cosines.
 *
 * @example
 * Side a: 1
 * Side b: 2
 * gamma: 90
 * 2.236
 */
void labZero_pZero();



/**
 * @input  read in two times in military format (e.g., 0900, 1730).
 * @output the number of hours and minutes between the two
 * times, in the format "[h] hours [m] minutes" for appropriate
 * values [h] and [m].
 *
 * @example 1
 * Please enter the first time: 0900
 * Please enter the second time: 1730
 * 8 hours 30 minutes
 *
 * @example 2
 * Please enter the first time: 1730
 * Please enter the second time: 0900
 * 15 hours 30 minutes
 */
void labZero_pOne();


/**
 * @input  read in an integer with up to 6 digits.
 * @output the sum of the digits of the number.
 *
 * @example:
 * Please enter the number:  123456
 * 21
 */
void labZero_pTwo();