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 amou
Assignment 1
Problem Description:
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. If water weight is negative number, the following message should be displayed: “Water amount cannot be negative number!”
The formula to compute the energy is:
result = waterWeight * (finalTemperature – initialTemperature) * 4184
Here is a sample run
Sample 1:
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
Sample 2:
Enter the amount of water in kilograms: -8
Water amount cannot be negative number!
Analysis:
(Describe the problem including input and output in your own words.)
Design:
(Describe the major steps for solving the problem.)
Coding: (Copy and Paste Source Code here. Format your code using Courier 10pts)
[Copy and Paste Your program here]
Testing: (Describe how you tested this program). Include Full Screen Shot(s).
Make Sure you Name the project as Computer programming and package Name As Assignment1.Use eclipse for the code execution.
Assignment 1
Problem Description:
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. If water weight is negative number, the following message should be displayed: “Water amount cannot be negative number!”
The formula to compute the energy is:
result = waterWeight * (finalTemperature – initialTemperature) * 4184
Here is a sample run
Sample 1:
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
Sample 2:
Enter the amount of water in kilograms: -8
Water amount cannot be negative number!
Analysis:
(Describe the problem including input and output in your own words.)
Design:
(Describe the major steps for solving the problem.)
Coding: (Copy and Paste Source Code here. Format your code using Courier 10pts)
[Copy and Paste Your program here]
Testing: (Describe how you tested this program). Include Full Screen Shot(s).
Make Sure you Name the project as Computer programming and package Name As Assignment1.
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.