Please note that I am not asking for an answer to the exercise just abit more explanation
I have this question that I do not understand.
Using a class to wrap simple stream input (InputWrapper.cs) modify following program to
calculate area of a triangle given base and height
using System;
class Triangle
{
static void Main()
{
//Sample code to calculate area of triangle
double Base = 15;
double height = 5;
double area = Base * height / 2;
Console.WriteLine("Area = {0}", area);
Console.Read();
}
}
// InputWrapper.cs
// Class to wrap simple stream input
// Datatype supported:
// int
// double
// decimal
// string
using System;
class InputWrapper
{
public int getInt(string prompt)
{
Console.Write(prompt);
string buf = Console.ReadLine();
return Convert.ToInt32(buf);
}
public double getDouble(string prompt)
{
Console.Write(prompt);
string buf = Console.ReadLine();
return Convert.ToDouble(buf);
}
public decimal getDecimal(string prompt)
{
Console.Write(prompt);
string buf = Console.ReadLine();
return Convert.ToDecimal(buf);
}
public string getString(string prompt)
{
Console.Write(prompt);
string buf = Console.ReadLine();
return buf;
}
Could someone who may understand what is asked please give me abit of a clearer explanation?
Thankyou