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

Timber design, design of timber in flexural members in terms of extreme fib...

design of timber in flexural members in terms of extreme fibre stress in bending, maximum horizontal shear stress, deflection and bearing stress perpendicular to the grain. the ful

Determine the ultimate bearing capacity of a square footing, Determine the ...

Determine the ultimate bearing capacity of a square footing, 1 m × 1 m, resting on saturated clay of unconfined compression strength of 180 kN/m 3 and a bulk density of 18 kN/m 3

Can u give me a sample assignment, im newer to the courses so i would like ...

im newer to the courses so i would like to know about the assignment types. in this case can u please show me a sample assignment?

General about tests, 1. All testing shall be done at room temperature. 2...

1. All testing shall be done at room temperature. 2. No bearing shall be tested earlier than a week after vulcanization. 3. Bearing sections shall be cut from test bearings w

science and materials, the behaviour of structural materials using compara...

the behaviour of structural materials using comparative statement when they are formed into structural member

Design a 10 unit rapid sand filter system, Design a 10 unit rapid sand filt...

Design a 10 unit rapid sand filter system for a flow of 6.3 MGD with a filtration rate of 2 gpm/sq ft. and an L: W ratio of 1.3.   Design flow (Q) = 6.3 MGD = 6.3x106 gpd =

Strength of concrete at the transfer stage, Strength of Concrete at the Tra...

Strength of Concrete at the Transfer Stage Concrete strength in the member at the transfer stage should conform to the design requirements. The frequency of the sampling and t

Estimate the probable final settlement, A bed of sand 12 m thick is underla...

A bed of sand 12 m thick is underlain by a compressible stratum of normally loaded clay, 6 m thick. The water table is at a depth of 5 m below the ground level. The bulk densities

Define surface communication-underwater inspection of bridge, Define Surfac...

Define Surface Communication - Underwater Inspection of Bridge? It is not necessary to have voice communication in all situations, particularly for shallow dives where the dive

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