Presentation is loading. Please wait.

Presentation is loading. Please wait.

March 2005 1R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Lab Status, Paper StatusLab Status, Paper Status Comments on Ints vs.

Similar presentations


Presentation on theme: "March 2005 1R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Lab Status, Paper StatusLab Status, Paper Status Comments on Ints vs."— Presentation transcript:

1 March 2005 1R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Lab Status, Paper StatusLab Status, Paper Status Comments on Ints vs DoublesComments on Ints vs Doubles Lab 7Lab 7

2 March 2005 2R. Smith - University of St Thomas - Minnesota Ints versus Doubles Ints are integers, no more or lessInts are integers, no more or less –CPU stores the whole number part, no more Doubles are “scientific notation”Doubles are “scientific notation” –CPU keeps a separate exponent and mantissa Issues with scanf() and int vs doubleIssues with scanf() and int vs double –If you scanf(“%i”, &db) and db is a double, it’s wrong –It converts the text into a plain integer, no exponent

3 March 2005 3R. Smith - University of St Thomas - Minnesota Overview of Lab 7 Calculating size and cost of custom shelvingCalculating size and cost of custom shelving Collect shelf length and total lengthCollect shelf length and total length Fix the shelf length to meet the constraintsFix the shelf length to meet the constraints Calculate the # parts you needCalculate the # parts you need Use “%” (remainder) to see if you must round the number of shelves upUse “%” (remainder) to see if you must round the number of shelves up

4 March 2005 4R. Smith - University of St Thomas - Minnesota Creative Commons License This work is licensed under the Creative Commons Attribution-Share Alike 3.0 United States License. To view a copy of this license, visit http://creativecommons.org/licenses/by- sa/3.0/us/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.


Download ppt "March 2005 1R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Lab Status, Paper StatusLab Status, Paper Status Comments on Ints vs."

Similar presentations


Ads by Google