using System;
namespace Questions
{
class Program
{
static void Main()
{
Console.Write("Weight of a water: ");
double weightOfWater = double.Parse(Console.ReadLine());
Console.Write("\nInitial temperature: ");
double initialTemperature = double.Parse(Console.ReadLine());
Console.Write("\nFinal temperature: ");
double finalTemperature = double.Parse(Console.ReadLine());
double energy = weightOfWater * (finalTemperature - initialTemperature) * 4184;
Console.WriteLine(
string.Format("\nThe energy {0} joules needed to heat {1}kg of a water from a {2} to {3} Celsius",
energy, weightOfWater, initialTemperature, finalTemperature));
Console.ReadKey();
}
}
}
Comments
Leave a comment