@marjanahmed/shape-finder
v2.1.0
Published
This CLI app can find the shpes's ares
Downloads
1
Readme
Classes:
- Define TypeScript classes (
Shape
,Square
,Circle
,Rectangle
) representing geometric shapes. - Each class encapsulates properties (side, radius, length, width) and methods (
calculateArea
,displayArea
) for area calculation and output.
Inquirer Prompts:
- Use
inquirer.prompt
to interactively ask the user to choose a shape and provide necessary dimensions (side length, radius, length, width).
Switch Statement:
- Implement a
switch
statement to handle user choices (sq
,cr
,rt
, etc.). - Depending on the choice, prompt for specific inputs, create an instance of the corresponding shape class, calculate its area, and display the result.
Validation:
- Validate user inputs (numeric values greater than zero) using validation functions within
inquirer.prompt
.
Display:
- Output the calculated area of the selected shape using
console.log
and thedisplayArea
method defined in each shape class.
Contributing
Contributions are welcome! If you'd like to enhance this CLI tool, feel free to fork the repository and submit a pull request. Here are a few ideas for contributions:
- Adding more shapes (e.g., Triangle, Rhombus) with their respective calculations.
- Improving user interface and error handling.
- Enhancing documentation or adding more examples.
git clone
Please ensure any contributions align with the project's coding standards and include tests where appropriate. Thank you for considering contributing to this project!