March R. 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
March R. 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
March R. 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
March R. 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 sa/3.0/us/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.