2.3 Lab: What Shape is That?
 Due Jul 10 by 11:59pm
 Points 10
 Submitting a website url
 Available Jul 6 at 12am  Jul 17 at 11:59pm 12 days
Tutorial Video:
In this lab, you will use user input and conditional statements to identify shapes based on the number of sides and some other properties as given by the user.
Part 1  Triangle...or no triangle?

Write a SNAP program that asks the user to think of a shape and input how many sides it has. Then, IF the user is thinking of a triangle, tell him or her so. Regardless of whether or not the shape was a triangle, thank the user for playing.

Modify your program to give an appropriate message both when the user is thinking of a triangle and when he or she is not thinking of a triangle. Give the same thank you message afterward in either case.
Part 2  Name That Polygon!
You will now expand your program from above so that instead of just deciding if a shape is a triangle or not, your program will be able to name the specific polygon. Your program must be able to identify at least the following shapes:
Number of sides  Polygon name 

3  Triangle 
4  Quadrilateral 
5  Pentagon 
6  Hexagon 
any other number  Unknown 

(Optional  it might help!) In your notebook or in a word document, sketch out the logic for the above program. Make sure you consider all aspects of the program carefully.

Write the program. Be sure that your program works correctly in all cases.
Part 3  Quadrilateral Fever!
Quadrilaterals come in many different varieties. Add code to your program so that, if the user is thinking of is a quadrilateral, you ask more questions to find out which type of quadrilateral it is. Each question should ask about a single property of the shape. For example, one question could be: "Are all four sides the same length?" Your program should give the most specific name that applies. The following table describes the quadrilaterals you should know about from most to least specific:
Property  Quadrilateral name 

All four sides have the same length and all four angles have the same measure  Square 
All four angles have the same measure and not all sides have same length  Rectangle 
All four sides have the same length and not all angles have the same measure  Diamond 
Not a rectangle and each side is parallel to the opposite side  Parallelogram 
Not a parallelogram and two sides are parallel to each other  Trapezoid 
Not a trapezoid  Unknown quadrilateral 

In your notebook or in a word file, sketch out the logic for the above program. Make sure you consider all aspects of the program carefully.

Write the program. Be sure that your program works correctly in all cases.
This Venn Diagram may help:
Rubric
Criteria  Ratings  Pts  

The program asks the user for a number of sides.
threshold:
pts


pts



The program determines if the user is thinking of a triangle or not based on the number of sides the user put in.
threshold:
pts


pts



The program can correctly identify  Triangle, Quadrilateral, Pentagon, Hexagon, or Unknown based on the number of sides the user put in.
threshold:
pts


pts



If the user specifies 4 sides the program asks questions to find out the most specific name that applies (Square, Rectangle, Parallelogram, Trapezoid, Unknown).
threshold:
pts


pts



The program uses 'if' blocks and input blocks.
threshold:
pts


pts



Total Points:
10.0
out of 10.0
