HW02 - Control Structures BEE 1510: Introduction to...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Control Structures BEE 1510: Introduction to Computer Programming Homework Exercise 02 Timothy Lin Cornell University due: October 2, 2008
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Executive Summary This exercise was meant to do two things: to calculate specific heat of soil based on its components of soil and water and to classify mineral soil based on its components of sand, silt and clay. The specific heat (c p ) is the heat required to change the temperature of one kilogram of mass by one degree Celsius. The total heat capacity is the ability of a volume of a material to store heat. Two objects of the same material can have identical specific heat values but different heat capacity values if they are not the same mass. Soil has a relatively high heat capacity because of the water that is in it. Water has a very high specific heat. Mineral soils, in contrast to the organic, muck soils, consist of four major components: mineral components (rock dust), organic components, water and air. Soils are grouped into different classes by their textures based on the relative amounts of three constituents: sand, silt and clay. These three components are graphically defined by the “soil triangle,” which maps out the type of soil based on the percentages of each of the components. Problem The problems that are faced are why does soil remain at a relatively stable temperature as the weather changes from day to day and how do we classify types of soil based on entered percentages of each component? Objective The objective of this program is to smoothly input values for a soil fraction and water fraction for a chosen type of soil (mineral or organic) and for the program to output a value of specific heat if and only if the values for soil and water fraction are appropriate and meet certain criteria. In addition, for mineral soils only, the user will input values of silt, sand, and clay percentages, and the output will be which type of soil it is based on those inputted percentages. Materials and Methods The first equation used is to determine the specific heat of both organic and mineral soils. It is the specific heat of moist soil = ((specific heat of water)(water fraction)(density of water) + (specific heat of dry soil)(soil fraction)(density of soil))/((water fraction)(density of water) + (soil fraction)(density of dry soil)). The specific heat of dry soil differs if the soil is mineral or organic so those differences are taken into account in each function file. The same goes for the density of the different soils. The second part of this exercise reviews the different percentages of the inputted sand, silt and clay components and uses the soil triangle to choose which type of mineral soil it is. Materials and Methods – algorithm for script 1. Enter Comments Homework Exercise 02: Control Structures
Background image of page 2
Timothy Lin Original Code: September 23, 2008 Last Revision: September 24, 2008 2. Inputs i. Define Inputs ask user whether organic, mineral, mineral skipping specific heat commands through menu command
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 11

HW02 - Control Structures BEE 1510: Introduction to...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online