Title: AERO 220 Introduction to Aerospace Engineering Computation
1AERO 220 Introduction to Aerospace Engineering
Computation
Meetings Time Tuesdays and Thursdays,1110 AM
1225 PM Place SSC 102 B http//imechanica.org/n
ode/6727 10/15/09
2Homework 4 Q1
include ltiostreamgt using namespace std int
main() int k coutltlt"\nPlease enter an
integer " cin gtgt k while(k!11) coutltlt"\
nYou Entered "ltltkltltendl coutltlt"\nPlease enter
an integer " cin gtgt k return 0
3Homework 4 Q2
include ltiostreamgt using namespace std int
main() int k do cout ltlt "\nPlease
enter an integer " cingtgtk if(k!11)
coutltlt"\nYour number is "ltltkltltendl whi
le(k!11) return 0
4Homework 4 Q2
- include ltiostreamgt
- using namespace std
- int main()
-
- int k 0
- coutltlt"\nPlease enter an integer "
- cingtgtk
- for( k!11 )
-
- coutltlt"\nYour number is "ltltkltltendl
- coutltlt"\nPlease enter an integer "
- cingtgtk
- return 0
5structure
- A structure can hold items of more than one data
type - Unlike an array, which can hold values of only
one type, like a int array or a char array.
6Structure declaration
The tag becomes the name for the new type
The struct keyword
Structure members
Terminates the structure declaration
Declares an variable named body of type testbody
7The tag becomes the name for the new type
The struct keyword
Structure members
Terminates the structure declaration
Declares two variables of type triangle