{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

engineering 1 hw file - Name Smrithi Prem User ID smp312...

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

View Full Document Right Arrow Icon
Name: Smrithi Prem User ID: smp312 Date: 2 September 2008 Assignment Name: HW 1 Lab instructor: Gaurav Gulati Section:8 1. The output of the program is: a) c= 8.29 b) c= 2.32787 c) c= -8.36786 d) c= -12.2944 e) i2 = 9 f) i2= 1 g) i2= 4 h) c= 0.00328638 i) c= 2.37483 Press any key to continue… 2. State which of the following are valid C++ variable names. If they are not valid, explain why. a.) 2a : invalid variable name, since all C++ variables must begin with either an underscore or a letter. b.) k.4 : invalid variable name, since C++ may not contain characters other than numbers, letters, and the underscore. This variable contains a period and therefore is not valid. c.) pTxy1 : this is a valid C++ variable since it starts with a letter, and only contains letters and numbers.
Background image of page 1

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

View Full Document Right Arrow Icon
d.) _my_name_is : this is a valid C++ variable since it starts with an underscore and contains only letters, numbers and underscores. e.) theansweris() : invalid variable name since it contains () which isn’t an acceptable variable character. f.)
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}