Skip to content

Commit

Permalink
Create spaces in help massage for a easy reading.
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel-de-Oliveira committed Nov 13, 2022
1 parent a1e5950 commit 91d0c10
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
26 changes: 13 additions & 13 deletions lib.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <sstream>

const float Pi {3.1415926535897}; // I conseidered this value for π.
const char Version[10] {"1.0.1"}; // Version's number.
const char Version[10] {"1.1"}; // Version's number.

// Help message
void helpMessage() {
Expand All @@ -22,19 +22,19 @@ std::cout <<
"\n"
"_*_ List of commands _*_\n"
"\n"
"rectangle: Calculate the area of a rectangle (b x h) [easarea rectangle [\"b\" value here] [\"h\" value here]]\n"
"square: Calculate the area of a square (s²) [easarea square [s value here]]\n"
"triangle: Calculate the area of a tringle ((b x h) / 2) [easarea triangle [\"b\" value here] [\"h\" value here]]\n"
"circle: Calculate the area of a circle (πr²) [easarea circle [\"r\" value here]]\n"
"trapezium: Calculate the area of a trapezium ((B + b) * h / 2) [easarea trapezium [\"B\" value here] [\"b\" value here] [\"h\" value here]]\n"
"diamond: Calculate the area of a diamond ((D * d) / 2) [easarea diamond [\"D\" value here] [\"b\" value here]]\n"
"hypotenuse: Calculate the hypotenuse of a triangle (X² = Y² + Z²) [easarea hypotenuse [\"Y\" value here] [\"Z\" value here]]\n"
"regular_polygon: Calculate the area of a regular polygon ((P * A) / 2) [easarea regular_polygon [\"P\" value here] [\"A value here\"]]\n"
"cube: Calculate the volume of a cube (s³) [easarea cube [\"s\" value here]]\n"
"parallelepiped: Calculate the valume of a parallelepiped (b * h * w) [easarea parallelepiped [\"b\" value here] [\"h\" value here] [\"w\" value here]]\n"
"semicircle: Calculate the area of a semicircle ((r² * π) / (360 / angle)) [ easarea semicircle [\"r\" value]] [\"angle\" value]]\n"
"rectangle: Calculate the area of a rectangle (b x h) [easarea rectangle [\"b\" value here] [\"h\" value here]]\n\n"
"square: Calculate the area of a square (s²) [easarea square [s value here]]\n\n"
"triangle: Calculate the area of a tringle ((b x h) / 2) [easarea triangle [\"b\" value here] [\"h\" value here]]\n\n"
"circle: Calculate the area of a circle (πr²) [easarea circle [\"r\" value here]]\n\n"
"trapezium: Calculate the area of a trapezium ((B + b) * h / 2) [easarea trapezium [\"B\" value here] [\"b\" value here] [\"h\" value here]]\n\n"
"diamond: Calculate the area of a diamond ((D * d) / 2) [easarea diamond [\"D\" value here] [\"b\" value here]]\n\n"
"hypotenuse: Calculate the hypotenuse of a triangle (X² = Y² + Z²) [easarea hypotenuse [\"Y\" value here] [\"Z\" value here]]\n\n"
"regular_polygon: Calculate the area of a regular polygon ((P * A) / 2) [easarea regular_polygon [\"P\" value here] [\"A value here\"]]\n\n"
"cube: Calculate the volume of a cube (s³) [easarea cube [\"s\" value here]]\n\n"
"parallelepiped: Calculate the valume of a parallelepiped (b * h * w) [easarea parallelepiped [\"b\" value here] [\"h\" value here] [\"w\" value here]]\n\n"
"semicircle: Calculate the area of a semicircle ((r² * π) / (360 / angle)) [ easarea semicircle [\"r\" value]] [\"angle\" value]]\n\n"

"version: Show the version of program [easarea version]\n"
"version: Show the version of program [easarea version]\n\n"
"help: Show this message [easarea help]\n\n";

}
Expand Down
10 changes: 5 additions & 5 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ int main( int argc, char** argv ) {
std::cout << "You digit a invalid argument! Digit 'easarea help' for more info.\n";
return 0;
}
}

if (calculateValue <= 0) {
std::cout << "\033[31;1mWarning\033[m: The area or volume of a shape should be a positive rational number!\n" << "Or else it's will be illogical mathematically.\n\n";
}

if (calculateValue <= 0) {
std::cout << "\033[31;1mWarning\033[m: The area or volume of a shape should be a positive rational number!\n" <<
"Or else it's will be illogical mathematically.\n\n";
std::cout << calculateValue << '\n';

}

std::cout << calculateValue << '\n';
return 0;

}

0 comments on commit 91d0c10

Please sign in to comment.