Write a program that calculates the energy neededto heat water from an initial temperature to a final temperature. Your programshould prompt the user to enter the amount of water in kilograms and the initialand final temperatures of the water. The formula to compute the energy isQ = M * (finalTemperature – initialTemperature) * 4184where M is the weight of water in kilograms, initial and final temperatures are indegrees Celsius, and energy Q is measured in joules. Here is a sample run:   Enter the amount of water in kilograms: 55.5Enter the initial temperature: 3.5Enter the final temperature: 10.5The energy needed is 1625484.0

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter4: Making Decisions
Section: Chapter Questions
Problem 7E: Write a program named GuessingGame that generates a random number between 1 and 10. (In other words,...
icon
Related questions
Question

Write a program that calculates the energy needed
to heat water from an initial temperature to a final temperature. Your program
should prompt the user to enter the amount of water in kilograms and the initial
and final temperatures of the water. The formula to compute the energy is
Q = M * (finalTemperature – initialTemperature) * 4184
where M is the weight of water in kilograms, initial and final temperatures are in
degrees Celsius, and energy Q is measured in joules. Here is a sample run:

 

Enter the amount of water in kilograms: 55.5
Enter the initial temperature: 3.5
Enter the final temperature: 10.5
The energy needed is 1625484.0

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Constants and Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,