Lab 3 Part 1

10 points



Each of three people tosses a coin. If all three tosses are heads or all three tosses are tails, the game is a draw. If two of the tosses are one type and the third one is different, the third one loses. Write a program to score this game. Your program should read the three tosses and print the outcome of the game. The input will be numbers with a 0 representing a head and a 1 representing a tail.



Save your program as file toss.cpp.



Example: A running program should produce the following dialogue in which we have indicated the parts typed by the user in italics. The rest is generated by the program.



Input the first player's toss:0

Input the second player's toss:1

Input the third player's toss:0

The loser is player 2.



A second example is :



Input the first player's toss:1

Input the second player's toss:1

Input the third player's toss:1

The game is a draw.









Lab 3 Part 2

10 Points





Consider the cross-section of a house:





























Write a program that prompts for and gets the Width, Height, and Roof and then displays the Area to two decimal places. Also display whether the roof angle is Acute, Right, or Obtuse. All variables are double. Name the program house.cpp.



The following formulas will help compute the results:



If Width 2 < 2 * Roof 2 , then the roof angle is Acute.

If Width 2 = 2 * Roof 2 , then the roof angle is Right.

If Width 2 > 2 * Roof 2 , then the roof angle is Obtuse.







DUE AT START OF LAB ON SEPTEMBER 29TH