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

Formwork, slabs and beam formwork

slabs and beam formwork

Surveying, define traverse.purpose of traverse, procedures of traverse, tak...

define traverse.purpose of traverse, procedures of traverse, taking linner measurment, types of traverse, convert the following quardnatal bearing to wcb. 1.OA= N15 deg10mins ''E,

#high way engineering about road pavements.., what is the function of longi...

what is the function of longitudinal joints in concrete road pavements?

Mechanism of formation of soil plugs, Question What is main mechanism o...

Question What is main mechanism of formation of soil plugs in marine driven steel piles with reinforced concrete infill? Answer Throughout initial driving process, ope

Horizontal curves - geometric design of roads, Horizontal Curves: Whe...

Horizontal Curves: When a vehicle of mass m moves on a curve of radius R with a speed of v (m/sec) (as shown in Figure 1) it is subjected to a centrifugal force equal to:

Calculate the aisc lrfd strength criteria, Check if the given beam and load...

Check if the given beam and loading satisfy the AISC LRFD strength criteria. The beam section is a W 16*31 of A36 steel and it is laterally supported at the ends at the load points

Define unit hydrograph - hydrology, Define Unit Hydrograph UNIT HYDROGR...

Define Unit Hydrograph UNIT HYDROGRAPH: The hydrograph developed for a drainage basin (watershed) from the runoff of a 1 in or 1 cm storm. It is the base hydrograph from which

Determine the loss of fluid energy, Determine the loss of fluid energy as 3...

Determine the loss of fluid energy as 310 gallons per minute (gpm) of water flows through 1,000 ft of 4 inch, schedule-40 welded and seamless steel pipe. The fluid temperature is 5

Advantages of unbonded post-tensioning systems, Advantages of unbonded post...

Advantages of unbonded post-tensioning systems Similarly, some advantages of unbonded post-tensioning systems over bonded post-tensioning ones may be written as under :  (a)

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