homework3

# homework3 - ECE 1574 Homework Set #3 Engineering Problem...

This preview shows pages 1–2. Sign up to view the full content.

ECE 1574 Homework Set #3 Engineering Problem Solving with C++ Due date: 2/7/10 by 11:55PM Beware of the Super Bowl time sink on Sunday This assignment is to be done individually Solve problems 2, 3, 4, 5, 6, and 7 during the lab session. Work the additional exercises later. Potentially useful information: The cmath library provides the function atan2( double y, double x ), which returns the arctangent of the ratio y/x, where y is a “rise” and x is a corresponding “run.” The arctangent of 1.0/1.0 is 45 degrees, which in radians is π/4. This fact implies one good way of getting the computer to calculate the value of π. Problem 1 Use Einstein’s mass-energy equivalency to determine the energy of a mass of 5, 10, and 20 kilograms. Perform your calculations using integers and a second set of calculations using float values. Explain why the two sets of results are different. What are the units of energy? You lab instructor will show you how to create a global symbolic constant named DOUBLE_FEED that is defined to be two new line feeds. Use this constant to create spacing between screen output from each problem below. Once you complete problem 7, you should be able to display all of the results of problems 2-7 in succession on your screen separated by line double line spaces. #include

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 02/15/2011 for the course ECE 1574 taught by Professor Rpbroadwater during the Spring '08 term at Virginia Tech.

### Page1 / 6

homework3 - ECE 1574 Homework Set #3 Engineering Problem...

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

View Full Document
Ask a homework question - tutors are online