Monday, February 10, 2014

Section 3.3 Input and Output: Displaying Variables






40305:  Given an integer variable count, write a statement that writes the value of count to standard output.

MessageBox.Show(count)

40306:  Given a floating-point variable fraction, write a statement that writes the value of fraction to standard output.  Do not write anything else to standard output -- just the value of fraction.

MessageBox.Show(fraction)

40898:  Write a statement that prints the following to standard output:  "i=".  Just write one statement that generates the message above:  do not generate any extraneous spaces.  Do not declare variables, do not write a main() function, do not write a whole program.

MessageBox.Show("i=")

40307:  Given an integer variable i and a floating-point variable f, write a statement that writes both of their values to standard output in the folowing format: i=value-of-i f=value-of-f.  Thus, if i has the value 25 and f has the value 12.34, the output would be i=25 f=12.34.  But if i has the value 187 and f has the value 24.06, the output would be: i=187 f=24.06

MessageBox.Show("i=" & i & "f=" & f)

No comments:

Post a Comment