QMCS 230: Today in Class - PowerPoint PPT Presentation

1 / 6
About This Presentation
Title:

QMCS 230: Today in Class

Description:

Boat Problem: Almost Lab 5. Custom boat: collect the length and width, number of seats ... Boat's cost is L x W x $87 cost of seats. March 2005. 5 /18 ... – PowerPoint PPT presentation

Number of Views:14
Avg rating:3.0/5.0
Slides: 7
Provided by: ricks6
Category:
Tags: qmcs | boat | class | parts | seats | today

less

Transcript and Presenter's Notes

Title: QMCS 230: Today in Class


1
QMCS 230 Today in Class
  • IF Statement
  • Revisiting assignment statements
  • Prep for Lab 5

2
IF Statements
  • Whats the idea? Skipping steps
  • Syntax if (test) thing-to-do
  • If test fails, thing-to-do is skipped
  • If it succeeds, its executed
  • Relational operators
  • lt and gt and lt and gt
  • and !

3
Examples
  • Rectangle x and y values
  • make them the right order to calculate lengths
  • Solving the problem
  • Identify what you have to calculate
  • Create one result variable for each calculation
  • Decide if you have to accumulate results
  • Step through the calculation, filling in the
    variables

4
Boat Problem Almost Lab 5
  • Custom boat collect the length and width, number
    of seats
  • Length is at least 3x width, fix width if wrong
  • Length is no more than 5x width, fix width if
    wrong
  • Number of seats is no more than 1/3 length
  • Cost per seat is 53
  • Boats cost is L x W x 87 cost of seats

5
Overview of Lab 5
  • Calculating size and cost of custom shelving
  • Collect shelf length and total length
  • Fix the shelf length to meet the constraints
  • Calculate the parts you need, rounding up

6
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.
Write a Comment
User Comments (0)
About PowerShow.com