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

Premix carpet - road pavements, Premix Carpet: An open graded premix ...

Premix Carpet: An open graded premix carpet, commonly called premix carpet (PC), is an open graded premixed material laid to a thickness of 20 mm and rolled, followed by a se

Similarity between post and pre tensioned concrete, Similarity between post...

Similarity between post and pre tensioned concrete In the case of  pre-tensioned concrete members, a pattern of  small length and  small width cracks which are more in numbers

Fore bearing, find out the interior angleS with diagrame LINE AB, BC, CD, D...

find out the interior angleS with diagrame LINE AB, BC, CD, DE, EA Fore bearing 60''30" , 122'' , 46'' , 205''30" , 300''

Torsional pendulum, define rigidity modulus and mention its units?

define rigidity modulus and mention its units?

Bending moment , The internal forces in any cross-section of a symmetric me...

The internal forces in any cross-section of a symmetric member in pure bending are equivalent toa couple M The moment of the couple is referred to as the bending moment in the s

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:

What are dissimilar applications of draglines, Question: What are dissi...

Question: What are dissimilar applications of draglines, backhoes and shovels? Answer: An excavator is distinct as a power-operated digging machine and it includes di

Damp proofing, how to remove dampness in mud houses?

how to remove dampness in mud houses?

What depth is the intensity of pressure zero, A retaining wall with a smoot...

A retaining wall with a smooth vertical back retains a purely cohesive fill. Height of wall is 12 m. Unit weight of fill is 20 kN/m 3 . Cohesion is 1 N/cm 2 . What is the total act

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