CMSC 104, Version 9/01 1 The Box Problem: Write an interactive program to compute and display the volume and surface area of a box. The program must also.

Slides:



Advertisements
Similar presentations
C Programming Technique – Firdaus-Harun.com
Advertisements

Technology Interactions ‹ Chapter Title Copyright © Glencoe/McGraw-Hill A Division of The McGraw-Hill Companies, Inc. Technology Interactions Computer-aided.
CMSC 104, Version 9/011 Arithmetic Operators Topics Arithmetic Operators Operator Precedence Evaluating Arithmetic Expressions In-class Project Incremental.
Al-Karma Language School Computer Department Prep. 3.
Chapter 1 Pseudocode & Flowcharts
LECTURE 1 CMSC 201. Overview Goal: Problem solving and algorithm development. Learn to program in Python. Algorithm - a set of unambiguous and ordered.
Chapter 2- Visual Basic Schneider
CS 1400 Chapter 1 Introduction and Background
Chapter 3 Planning Your Solution
Algorithms IV: Top-Down Design
Chapter 1 Pseudocode & Flowcharts
Adapted from slides by Marie desJardins
Computer Programming 12 Lesson 2 - Organizing the Problem By Dan Lunney.
PYTHON PROGRAMMING Week 10 – Wednesday. TERMS – CHAPTER 1 Write down definitions for these terms:  Computation  Computability  Computing  Artificial.
CS 0004 –Lecture 8 Jan 24, 2011 Roxana Gheorghiu.
Pseudocode algorithms using sequence, selection and repetition
Algorithmic Problem Solving CMSC 201 Adapted from slides by Marie desJardins (Spring 2015 Prof Chang version)
CMSC 104, Version 9/011 Incremental Programming Topics Review of Incremental Programming Example of Incremental Programming Reading None.
Starting screen for Google Sketchup Sketchup is used to make 3 dimensional objects 3 axis – Green is x axis Red is y axis Blue is z axis.
CMSC 104, Section 301, Fall Lecture 06, 9/18/02 Algorithms, Part 3 of 3 Topics Disk Quota Exceeded. Using Pine. More Algorithms Reading Read.
Arithmetic Operators Topics Arithmetic Operators Operator Precedence
More Algorithm Design CSIS 1595: Fundamentals of Programming and Problem Solving 1.
Volume Performance Task Rectangular Prisms
CMSC 1041 Algorithms II Software Development Life-Cycle.
PSEUDOCODE C Programming Technique – Firdaus-Harun.com.
Chapter 1 Pseudocode & Flowcharts
ITI 1120 Lab #5 Contributors: S. Boyd, R. Plesa, A. Felty, D. Inkpen, A. Williams, D. Amyot.
CMSC 104, Version 9/01 1 Functions, Part 3 of 3 Topics: Coding Practice o In-Class Project: The Box o In-Class Project: Drawing a Rectangle Reading: None.
How can you multiply a two digit by digit number using an area model?
1 Algorithms Practice Topics In-Class Project: Tip Calculator In-Class Project: Drawing a Rectangle.
CMSC 104, Version 8/061L10ArithmeticOps.ppt Arithmetic Operators Topics Arithmetic Operators Operator Precedence Evaluating Arithmetic Expressions In-class.
Warm-Up #1 11/30 1. Write down these 3 formulas:
The ‘while’ loop ‘round and ‘round we go.
Algorithms, Part 3 of 3 Topics In-Class Project: The Box
Exercise 1 #include int main() { printf(“Hello C Programming!\n”); return 0; } 1.Run your Visual Studio 2008 or Create a new “project” and add.
Intro to Loops 1.General Knowledge 2.Two Types of Loops 3.The WHILE loop 1.
Make a Model A box company makes boxes to hold popcorn. Each box is made by cutting the square corners out of a rectangular sheet of cardboard. The rectangle.
CMSC 2021 Software Development. CMSC 2022 Software Development Life Cycle Five phases: –Analysis –Design –Implementation –Testing –Maintenance.
+ Pyramids and Prisms. + Solid An object with 3 Dimensions Height, Width, Length.
Squared and Cubed Conversion Factors
CMSC 104, Version 8/061L16IncrementalProg.ppt Incremental Programming Topics Review of Incremental Programming Example of Incremental Programming Reading.
Arithmetic Operators Topics Arithmetic Operators Operator Precedence
2008/09/22: Lecture 6 CMSC 104, Section 0101 John Y. Park
Algorithms and Flowcharts
2.2 Multiply Polynomials Multiply a monomial and a polynomial
Solid Figures 7th Grade Standard
The while Looping Structure
Chapter 1 Pseudocode & Flowcharts
2008/11/12: Lab 5/Lecture 17 CMSC 104, Section 0101 John Y. Park
Objective - To identify how perimeter and area relate.
2.2 Multiply Polynomials Multiply a monomial and a polynomial
Pseudocode algorithms using sequence, selection and repetition
Incremental Programming
The while Looping Structure
Chapter 1 Pseudocode & Flowcharts
Algorithms, Part 3 of 3 Topics In-Class Project: The Box
Solutions to In-Class Problems
Algorithms Practice Topics In-Class Project: Tip Calculator
Question One Boxed In Question Two 25cm2 12cm2
Functions, Part 4 of 4 Topics: Coding Practice Reading: None
Programming Concepts and Database
Photoshop: Image size and resolution
Functions, Part 3 of 3 Topics: Coding Practice Reading: None
UMBC CMSC 104 – Section 01, Fall 2016
Use the Chain Rule to find {image} {image}
The while Looping Structure
Mod 38 F.
Chapter 1 Pseudocode & Flowcharts
Algorithms, Part 3 of 3 Topics In-Class Project: Tip Calculator
Functions, Part 3 of 4 Topics: Coding Practice Reading: None
Presentation transcript:

CMSC 104, Version 9/01 1 The Box Problem: Write an interactive program to compute and display the volume and surface area of a box. The program must also display the box dimensions. Error checking should be done to be sure that all box dimensions are greater than zero.

CMSC 104, Version 9/01 2 The Box - Inputs and Outputs Inputs: o height o width o depth Outputs o volume o surface area o height o width o depth

CMSC 104, Version 9/01 3 The Box - Rough Algorithm Get the height from the user, performing error checking Get the width from the user, performing error checking Get the depth from the user, performing error checking Compute the volume of the box Compute the surface area of the box Display the height, width, depth, volume, and surface area of the box

CMSC 104, Version 9/01 4 The Box - Final Pseudocode Display “Enter the height: “ Read While ( <= 0 ) Display “The height must be > 0” Display “Enter the height: “ Read End_while

CMSC 104, Version 9/01 5 The Box - Final Pseudocode (con’t) Display “Enter the width: “ Read While ( <= 0 ) Display “The width must be > 0” Display “Enter the width: “ Read End_while

CMSC 104, Version 9/01 6 The Box - Final Pseudocode (con’t) Display “Enter the depth: “ Read While ( <= 0 ) Display “The depth must be > 0” Display “Enter the depth: “ Read End_while

CMSC 104, Version 9/01 7 The Box - Final Pseudocode (con’t) = X X = X = 2 X ( + + )

CMSC 104, Version 9/01 8 The Box - Final Pseudocode (con’t) Display “Height = “, Display “Width = “, Display “Depth = “, Display “Volume = “, Display “Surface Area = “,

CMSC 104, Version 9/01 9 Drawing a Rectangle Problem: Write an interactive program that will draw a solid rectangle of asterisks (*). The program must also display the dimensions of the rectangle. Error checking must be done to be sure that the dimensions are greater than zero.

CMSC 104, Version 9/01 10 The Rectangle - Inputs and Outputs Inputs o height o width Outputs o height o width o the drawing of the rectangle

CMSC 104, Version 9/01 11 The Rectangle - Rough Algorithm Get the height from the user, performing error checking Get the width from the user, performing error checking Display the height and width Draw the rectangle

CMSC 104, Version 9/01 12 The Rectangle - Final Pseudocode Display “Enter the height: “ Read While ( <= 0 ) Display “The height must be > 0” Display “Enter the height: “ Read End_while

CMSC 104, Version 9/01 13 The Rectangle - Final Pseudocode (con’t) Display “Enter the width: “ Read While ( <= 0 ) Display “The width must be > 0” Display “Enter the width: “ Read End_while

CMSC 104, Version 9/01 14 The Rectangle - Final Pseudocode (con’t) Display “Height = “, Display “Width = “, Skip a line

CMSC 104, Version 9/01 15 The Rectangle - Final Pseudocode (con’t) = 1 While ( ) = 1 While ( ) Display “*” = + 1 End_while Place cursor on next line = + 1 End_while