-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dba65e6
commit 1b116fb
Showing
1 changed file
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# TemperatureConverter Class | ||
|
||
**A static class providing methods for converting temperatures between Celsius, Fahrenheit, and Kelvin.** | ||
|
||
## Class Members | ||
|
||
```csharp | ||
CelsiusToFahrenheit<T>(T temperature) | ||
``` | ||
|
||
Converts a temperature from Celsius to Fahrenheit. | ||
|
||
### Parameters | ||
|
||
- `temperature` (Type: `T`): The temperature in Celsius to convert. `T` should implement the `IConvertible` interface. | ||
|
||
### Returns | ||
|
||
- Type: `double` | ||
- Description: The converted temperature in Fahrenheit. | ||
|
||
### Example | ||
|
||
```csharp | ||
double celsius = 25; | ||
double fahrenheit = TemperatureConverter.CelsiusToFahrenheit(celsius); | ||
Console.WriteLine(fahrenheit); | ||
``` | ||
|
||
### Remarks | ||
|
||
The `CelsiusToFahrenheit` method converts a temperature from Celsius to Fahrenheit. | ||
|
||
--- | ||
|
||
```csharp | ||
CelsiusToKelvin<T>(T temperature) | ||
``` | ||
|
||
Converts a temperature from Celsius to Kelvin. | ||
|
||
### Parameters | ||
|
||
- `temperature` (Type: `T`): The temperature in Celsius to convert. `T` should implement the `IConvertible` interface. | ||
|
||
### Returns | ||
|
||
- Type: `double` | ||
- Description: The converted temperature in Kelvin. | ||
|
||
### Example | ||
|
||
```csharp | ||
double celsius = 25; | ||
double kelvin = TemperatureConverter.CelsiusToKelvin(celsius); | ||
Console.WriteLine(kelvin); | ||
``` | ||
|
||
### Remarks | ||
|
||
The `CelsiusToKelvin` method converts a temperature from Celsius to Kelvin. | ||
|
||
--- | ||
|
||
**Note:** There are many more methods available in the `TemperatureConverter` class. Please refer to the reference API documentation for more details. |