So, I am trying to work with a temperature converter that converts the temperature of a Fahrenheit, Celsius, Kelvin or Rankin source to Fahrenheit, Celsius, Kelvin or Rankin.
Now I am trying to do this (in C #) in accordance with the recommendations of OO best practices.
I came across a roadblock early on, though, and I need some advice on how to proceed.
I have a class TempConvertthat is currently processing the interface and implementation of the program.
Then I have a file Main.csthat will actually execute the method Main().
This will be a console program, mind you.
TempConvert.cs
using System;
namespace TempConverter
{
public class TempConvert
{
private double SourceTemp { get; set; }
private double TargetTemp { get; set; }
public TempConvert(double sourceTemp, double targetTemp)
{
SourceTemp = sourceTemp;
TargetTemp = targetTemp;
}
}
}
Main.cs
using System;
namespace TempConverter
{
class MainClass
{
public static void Main()
{
TempConvert converter = new TempConvert(10, 20);
}
}
}
Now I do not know if this is a good start or not.
, ( 4 , ) .
, , , , 10 SourceTemp 20 TargetTemp, , .
, , int, 1, 2, 3 4. , , , .