Skip to content

update the result and exception error format. #3820

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions docs/get-started/tutorial-console-cpp.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ If you build and run the code again at this point, it will still exit after aski
{
cin >> x >> oper >> y;
result = c.Calculate(x, oper, y);
cout << "Result is: " << result << endl;
cout << "Result "<<"of "<< x << oper << y <<" is : "<< result << endl;
}

return 0;
Expand Down Expand Up @@ -599,7 +599,7 @@ If you build and run the code again at this point, it will still exit after aski
{
cin >> x >> oper >> y;
result = c.Calculate(x, oper, y);
cout << "Result is: " << result << endl;
cout << "Result"<<" of "<< x << oper << y <<" is : "<< result << endl;
}

return 0;
Expand Down Expand Up @@ -711,13 +711,14 @@ Let's handle division by zero more gracefully, so a user can understand the prob
if (oper == '/' && y == 0)
{
cout << "Division by 0 exception" << endl;
cout << "Math error: Attempted to divide by Zero! "<<endl;
continue;
}
else
{
result = c.Calculate(x, oper, y);
}
cout << "Result is: " << result << endl;
cout << "Result"<<" of "<< x << oper << y <<" is : "<< result << endl;
}

return 0;
Expand Down