Write an app that tests whether the examples of the Math class actually produce the indicated results.
```
// Solution: MathTest.cs
// Testing the Math class methods.
using System;
class MathTest
{
static void Main()
{
Console.WriteLine($"Math.Abs(23.7) = {Math.Abs(23.7)}");
Console.WriteLine($"Math.Abs(0.0) = {Math.Abs(0.0)}");
Console.WriteLine($"Math.Abs(-23.7) = {Math.Abs(-23.7)}");
Console.WriteLine($"Math.Ceiling(9.2) = {Math.Ceiling(9.2)}");
Console.WriteLine($"Math.Ceiling(-9.8) = {Math.Ceiling(-9.8)}");
Console.WriteLine($"Math.Cos(0.0) = {Math.Cos(0.0)}");
Console.WriteLine($"Math.Exp(1.0) = {Math.Exp(1.0)}");
Console.WriteLine($"Math.Exp(2.0) = {Math.Exp(2.0)}");
Console.WriteLine($"Math.Floor(9.2) = {Math.Floor(9.2)}");
Console.WriteLine($"Math.Floor(-9.8) = {Math.Floor(-9.8)}");
Console.WriteLine($"Math.Log(Math.E) = {Math.Log(Math.E)}");
Console.WriteLine($"Math.Log(Math.E * Math.E) = {Math.Log(Math.E * Math.E)}");
Console.WriteLine($"Math.Max(2.3, 12.7) = {Math.Max(2.3, 12.7)}");
Console.WriteLine($"Math.Max(-2.3, -12.7) = {Math.Max(-2.3, -12.7)}");
Console.WriteLine($"Math.Min(2.3, 12.7) = {Math.Min(2.3, 12.7)}");
Console.WriteLine($"Math.Min(-2.3, -12.7) = {Math.Min(-2.3, -12.7)}");
Console.WriteLine($"Math.Pow(2.0, 7.0) = {Math.Pow(2.0, 7.0)}");
Console.WriteLine($"Math.Pow(9.0, 0.5) = {Math.Pow(9.0, 0.5)}");
Console.WriteLine($"Math.Sin(0.0) = {Math.Sin(0.0)}");
Console.WriteLine($"Math.Sqrt(900.0) = {Math.Sqrt(900.0)}");
Console.WriteLine($"Math.Tan(0.0) = {Math.Tan(0.0)}");
}
}
```
Math.Abs(23.7) = 23.7
Math.Abs(0.0) = 0
Math.Abs(-23.7) = 23.7
Math.Ceiling(9.2) = 10
Math.Ceiling(-9.8) = -9
Math.Cos(0.0) = 1
Math.Exp(1.0) = 2.71828182845905
Math.Exp(2.0) = 7.38905609893065
Math.Floor(9.2) = 9
Math.Floor(-9.8) = -10
Math.Log(Math.E) = 1
Math.Log(Math.E * Math.E) = 2
Math.Max(2.3, 12.7) = 12.7
Math.Max(-2.3, -12.7) = -2.3
Math.Min(2.3, 12.7) = 2.3
Math.Min(-2.3, -12.7) = -12.7
Math.Pow(2.0, 7.0) = 128
Math.Pow(9.0, 0.5) = 3
Math.Sin(0.0) = 0
Math.Sqrt(900.0) = 30
Math.Tan(0.0) = 0
You might also like to view...
What does the acronym VLSI stand for? How did the development of VLSI technology contribute to the personal computer revolution of the late 1970s?
What will be an ideal response?
When saving colors in the Swatches panel, the pointer changes to a paint bucket icon.
Answer the following statement true (T) or false (F)
Which of the following shortcut menu commands, shown in the accompanying figure, creates a navigation menu with different text links?
A. Call Script B. Set Text C. Jump Menu D. none of the above
What are the benefits of using analysis patterns during the analysis modeling process?
What will be an ideal response?