Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Geometry Puzzle You are designing a simple geometry puzzle for children to learn more about shapes. The puzzle works by having the below functionalities 1
Geometry Puzzle
You are designing a simple geometry puzzle for children to learn more about shapes. The puzzle works by
having the below functionalities
Create a custom shape: Allow the user to create a custom shape by providing a minimum of xy
valid coordinates.
Validate input coordinates: Ensure coordinates input are valid and a convex shape can be formed by
joining the set of coordinates. Also ensures that points are not repeated.
Create a random shape: Randomly creates a custom shape with at least valid coordinates
Puzzle Section: Allow the user to key in different coordinates and check if the coordinate is within the
shape that has been created
User input and output can be from command line.
When launching the application, it prompts user for actions:
Welcome to the GIC geometry puzzle app
Create a custom shape
Generate a random shape
User should be able to enter or to select how they want the shape to be generated.
Create a custom shape
Upon selecting option application prompts user to key in coordinates Note that the custom shape is
created by joining coordinates to followed by coordinates to then coordinates to to coordinates
n to n and finally coordinates n back to At any point the application should validate if the new
coordinated is a valid coordinate, if not it should alert the user and ask the user to key in another coordinate.
Application prompts:
Please enter coordinates in x y format
User is then able to enter:
The system responds with:
Your current shape is incomplete
:
Please enter coordinates in x y format
README.md
User is then able to enter:
The system responds with:
Your current shape is incomplete
:
:
Please enter coordinates in x y format
User is then able to enter:
The system responds with:
Your current shape is valid and is complete
:
:
:
Please enter # to finalize your shape or enter coordinates in x y format
At this point the User can finalize the shape by pressing # or carry on adding additional points by keying in
coordinates in x y format Assuming the user chooses to finalize the shape.
User responds with # and proceed to the puzzle part of the game:
#
The system then responds with, user then proceeds to the puzzle section from this point on:
Your finalized shape is
:
:
:
Please key in test coordinates in x y format or enter # to quit the game
README.md
Validate input coordinates
The system should recognize when new coordinates are invalid and display the new coordinates invalid
message followed by the previous prompt.
Example If the user has created an incomplete shape with coordinates :: and tries to key in
again.
New coordinates is invalid!!!
Not adding new coordinates to the current shape.
Your current shape is incomplete
:
:
Please enter coordinates in x y format
Example If the user has created a triangle with coordinates ::: and tries to key in
New coordinates is invalid!!!
Not adding new coordinates to the current shape.
Your current shape is valid and is complete
:
:
:
Please enter # to finalize your shape or enter coordinates in x y format
Generate a random shape
Upon selecting option application proceeds to create a random shape with between to coordinates
Note that the shape created must be valid and similar to the custom shape creation scenario, the shape is
created by joining coordinates to followed by coordinates to then coordinates to to coordinates
n to n and finally coordinates n back to
Example random triangle created.
Application prompts the random shape created and user proceeds to the puzzle section:
Your random shape is
:
:
:
Please key in test coordinates in x y format or enter # to quit the game
Puzzle Section
README.md
At any point once the shape is finalized the system always responds with
Your finalized shape is
:
:
:
Please key in test coordinates in x y format or enter # to quit the game
At this point the User can choose to quit by entering # or play the game by keying in coordinates in x y
format Assuming the user chooses to play the game.
User enters:
System then responds with:
Your finalized shape is
:
:
:
Coordinates is within your finalized shape
Please key in test coordinates in x y format or enter # to quit the game
User enters another test coordinate:
System then responds with:
Your finalized shape is
:
:
:
Sorry, coordinates is outside of your finalized shape
Please key in test coordinates in x y format or enter # to quit the game
User chooses to quit:
README.md
#
System responds with:
Thank you
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started