From f5e26961a609464482e03eeb884c187caeebb763 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Mon, 30 May 2022 01:38:54 -0700 Subject: fix(ellipse): move variable declrations --- ellipse/ellipse.cc | 5 ++--- ellipse/test.cc | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/ellipse/ellipse.cc b/ellipse/ellipse.cc index 0437d28..514b262 100644 --- a/ellipse/ellipse.cc +++ b/ellipse/ellipse.cc @@ -60,7 +60,7 @@ void ellipse::calculate() { ((1 + ((3 * h)) / (10 + std::sqrt(4 - (3 * h))))); } - // This belongs to the two calculates below. + // This belongs to the two calculations below. // std::function factorial; // // factorial = [&factorial](double n) -> double { @@ -89,8 +89,7 @@ void ellipse::calculate() { // this->circumference = 2 * this->major * pi * (1 - h); // } - // Or this either... however, it is not complete enough to guarantee 100% - // accurate results. + // Or this either... // { // double limit = std::numeric_limits::infinity(); // double infinite_sum = 0; diff --git a/ellipse/test.cc b/ellipse/test.cc index 6c1b86a..222d9ea 100644 --- a/ellipse/test.cc +++ b/ellipse/test.cc @@ -10,17 +10,17 @@ int main() { // Create one ellipse object immediately and ... ellipse e; + double major; + double minor; // call the get_ellipse_description function. e.get_ellipse_description(); for (;;) { - double major; - double minor; - std::cout << "major: "; std::cin >> major; + // For testing and responsiveness if (major < 0) { break; } -- cgit v1.2.3