Calculates the energy required, Civil Engineering

Assignment Help:

Write a program called, A1Q1, that reads a single letter.   It will then display the corresponding ASCII code of the letter and prints the next character and the character which is corresponding to the "ASCII code + 3".  Comment on the unusual behaviour if you enter 'z' or 'Z' or '9' or '@'.  Shorthand operators and increment/decrement operators should be used in your code.

2. Write a program called A1Q2, 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 volume of water in gallons and the initial and final temperatures in Fahrenheit. The formula to compute the energy isenergy = mass * (temperatureFinal - temperatureInitial ) * 4184 where 'mass' is in Kg; temperatures are in degrees Celsius and  'energy' is in J.  You will need to convert the inputs to the proper units (1 gallon = 3.785 litres).  Use constants not numeric literals to define physical constants and conversion factors.  What happens if the user enters the values as octal or hexadecimal numbers?

Here is a sample run:

Enter the amount of water in gallons: 11.5 

Enter the initial temperature in F: 55.2 

Enter the final temperature in F: 78.5 

To heat the water of 43.5275 kg from 12.8889 C to 25.8333 C, the required energy is 2357.43 KJ.


Related Discussions:- Calculates the energy required

Break even point, Break even point: EM Electricals, Inc., contains fix...

Break even point: EM Electricals, Inc., contains fixed costs of Rs. 600,000 this period. Variable costs involved labour charges of Rs.100 per unit and material cost of Rs. 200

Determine the latitude and departure - transportation, Determine the latitu...

Determine the latitude and departure of each side of the closed traverse ABCDA.  Total the latitudes and departures. TIP: For Closed Traverse, Sum of Latitudes is Z

Sulphate-resisting cement not used in marine concrete, Question Explain...

Question Explain the reason why is sulphate-resisting cement not used in marine concrete ? Answer Major components of Portland cement are tricalcium silicate, dicalciu

Water quality analysis, Water quality analysis: This water quality ana...

Water quality analysis: This water quality analysis presents an overview of physical characteristics of water, chemical substances that are normally present in water and vario

Cement, manufacture of cement by dry process

manufacture of cement by dry process

Structural analysis_cantilever trusses, Obtain the values and direction of ...

Obtain the values and direction of the supporting reactions of the truss given below. Use the method of section to determine the forces in each member.

What is the force exerted by the tacoma narrows bridge, The force exerted t...

The force exerted to the Tacoma narrows bridge was initially the wind resistance. The wind resistance cause the entire bridge to act as a system with forced vibration with damping.

Pre-tensioned concrete elements, Pre-tensioned concrete elements It is ...

Pre-tensioned concrete elements It is the act of transferring the stress in prestressing tendons to the concrete member. In the case of pre-tensioned concrete elements, this st

Explain the ion exchange water softening, Explain the Ion Exchange water So...

Explain the Ion Exchange water Softening Softening is usually done using a resin (natural or synthetic long chain chemical with a sodium ion attached). When water containing ha

Concrete mix design, Concrete Mix Design: Concrete mix design is done...

Concrete Mix Design: Concrete mix design is done in a laboratory to achieve the desired strength and workability. The mix design is done to achieve strength slightly higher t

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd