Computational Tools1 Structured Programming Spreadsheets.

Slides:



Advertisements
Similar presentations
Exercise 7.5 (p. 343) Consider the hotel occupancy data in Table 6.4 of Chapter 6 (p. 297)
Advertisements

FORMULAS & FUNCTIONS EXCEL 2. Excel Input – a collection of informational data typed into the spreadsheet Output – worksheet results Information to be.
FORMULAS & FUNCTIONS EXCEL. Input A collection of information Data typed into the spreadsheet Output Worksheet Results.
Excel – Study Guide #2.
Relative Addresses: After I enter =B2/52 in cell C2 and then drag it down the C column to the last row what formula would I see in cell C5 if I clicked.
1 Chapter 7 My interest is in the future because I am going to spend the rest of my life there.— Charles F. Kettering Forecasting.
Introduction to Flowcharting
Introduction to Flowcharting
Introduction to Flowcharting
Introduction to Flowcharting A Supplement to Starting Out with C++, 4th Edition by Tony Gaddis Published by Addison-Wesley.
Microsoft Excel Setting up Constants; the Payment, Present Value, and Conditional functions; What-If analysis.
Factoring trinomials ax² + bx +c a = any number besides 1 and 0
Assignment 3 Excel Tutorial IS for Management2 Content –Accurate –Relevant –Complete –Concise Time –Timely –Frequent (enough) Form –Easy to read –Appropriately.
Raptor Mr. Lau Ka Lun Lai King Catholic Secondary School.
Review Algorithm Analysis Problem Solving Space Complexity
Sensitivity Analysis A systematic way of asking “what-if” scenario questions in order to understand what outcomes could possibly occur that would affect.
General Purpose Packages Spreadsheets. What is a Spreadsheet? A Spreadsheet is a computer program used mainly for recording mathematical data such as.
CSC103: Introduction to Computer and Programming
9.1 Adding and Subtracting Polynomials
C How to Program, 6/e © by Pearson Education, Inc. All Rights Reserved.
Exploring Engineering Chapter 3, Part 2 Introduction to Spreadsheets.
Advanced Excel. Objectives Explore ways to create more intelligent spreadsheets using advanced elements such as: –Naming –Functions Logical Mathematical.
Working with Spreadsheets S S T : S P R E A D S H E E T S SST 2 Objectives 1.Perform data entry tasks 2.Use formulae and functions in worksheet calculations.
Engineering Fundamentals Decision Matrix Spreadsheet Tutorial 1.
1 Introduction to Flowcharting. 2 Writing a program Defining the problem –Write down what the program will do Planning –Write down the steps, draw a flowchart.
1 Introduction to Flowcharting. 2 Writing a program Defining the problem –Write down what the program will do Planning –Write down the steps, draw a flowchart.
Flowcharts! January 13, 2005 These are today’s notes! Do you think we will get more snow?
1 Microsoft Excel An Introduction to Spreadsheets Lecture 18.
Numeric and Functional. A cell is the intersection of a row and column Each cell in the spreadsheet has a name – The column-name followed by the row-name.
Copyright © Cengage Learning. All rights reserved. Factoring Polynomials and Solving Equations by Factoring 5.
Computer Science & Engineering 2111 Lecture 2 Basic Functions, Common Excel Errors, Cell Addressing 1 CSE 2111 Lecture 2-Basic Functions and Cell Addressing.
Chapter 3: Referencing and Names Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University Name.
Understanding Formulae ©. End Next Quit Next If for any reason you want to exit from the test, click the Quit.
(C)opyright 2000 Scott/Jones Publishers Introduction to Flowcharting.
Lesson - 2. Introduction When we make a program we must follow some steps, called Programming Development Life Cycle (PDLC). Programming steps are five:
PERFORMING CALCULATIONS Microsoft Excel. Excel Formulas A formula is a set of mathematical instructions that can be used in Excel to perform calculations.
Sensitivity Analysis A systematic way of asking “what-if” scenario questions in order to understand what outcomes could possibly occur that would effect.
Components of Spreadsheets Computer Applications 1 Obj. 4.01: Understand spreadsheets used in business.
Chapter 3: Referencing and Names Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University Name.
Copyright © 2005 by Nelson, a division of Thomson Canada Limited 14-0 EXCEL CHAPTER 14 PHILIP BEDIENT.
Factoring trinomials ax² + bx +c a = any number besides 1 and 0.
24 Mar 04 1 Application Software Practical 3/4 Excel (Spreadsheet)
1 Introduction to Flowcharting Computer Science Principles ASFA.
CS Class 04 Topics  Selection statement – IF  Expressions  More practice writing simple C++ programs Announcements  Read pages for next.
Microsoft Excel.
The Basics of Formulas & Functions
Numeric and Functional
Understanding Spreadsheets Used in Business
The Selection Structure
Excel Formulas & Functions.
Introduction to Flowcharting
Excel 2013 Formulas & Functions.
Control Structure Senior Lecturer
Technology Mrs. Huddleston
Structured Program Design
Excel 2013 Formulas & Functions.
EXCEL Study Guide #2.
4.01 Spreadsheet Formulas & Functions
Absolute and Relative cell referencing
Excel 2013 Formulas & Functions.
4.01 Spreadsheet Formulas & Functions
Introduction to Spreadsheets
3-Variable K-map AB/C AB/C A’B’ A’B AB AB’
CSCI N207 Data Analysis Using Spreadsheet
Intro to Excel CSCI-150.
Find: AreaABCD [acres]
Spreadsheets A How To!.
Mathematical operators
Introduction to Spreadsheet Terminology
Introduction to Flowcharting
Presentation transcript:

Computational Tools1 Structured Programming Spreadsheets

Structured Programming Flowcharts Flow control Functions Computational Tools2

Start/Stop Operation Decision Input/Output Flowchart Symbols Computational Tools3

start Example Flowchart Computational Tools4 y = 4 y > 4? end print y y = f(x) no yes read x

start Flowchart with Iteration Computational Tools5 sum = 0 n = 0 n=5? end print sum n = n + 1 sum = sum + n no yes

When the program represented by the following flowchart is run, what is the resulting sum? A.10 B.15 C.20 D.21 sum = 15 B Computational Tools6 start sum = 0 n = 0 n=5? end print sum n = n + 1 sum = sum + n no yes nsum

Structured Programming Flowcharts Flow control Functions Computational Tools7

8 In this program, if a value of 0.5 is read for x, what value is assigned to y? read x if x < 0 then y = 0 else if x > 1 then y = 1 else y = x*x end A.0.25 B.0.5 C.0.75 D.1 A

Computational Tools9 In this program, what is the final value of x? x = 1 y = 2*x x = x + y*y if x > 4 then x = x/5 A.1 B.5 C.6 D.8 x = 1 y = 2 x = 5 x = 1 A

Computational Tools10 In this program, if a value of 0.5 is read for x, what is the final value of x? read x if x > -1 and x < 1 then x = 0 else x = x*x A.0 B.0.25 C.0.5 D.1 A

Computational Tools11 In this program, if a value of 3 is read for n, what value is assigned to x? read n switch n case 1 x = 2 case 2 x = 4 case 3 x = 6 otherwise x = 8 end A. 3 B. 4 C. 6 D. 8 x = 6 C

In this program, what is the final value of y? x = 1 y = 1 for n = 1 to 3 x = x + 2 y = y*x end A. 7 B. 15 C.105 D.945 Computational Tools12 xy y = 105 C

A. 8 B.10 C.12 D.20 Computational Tools13 xy y = 20 D

read x, m s = 1 t = 1 for k = 1 to m t = t*x/k s = s + t end A.s = 1 + x + x/2 + x/3 + … + x/m B.s = 1 + x/1! + x/2! + x/3! + … + x/m! C.s = 1 + x/1 + x 2 /2 + x 3 /3 + … + x m /m D.s = 1 + x/1! + x 2 /2! + x 3 /3! + … + x m /m! s = 1 + … k = 1; t = x; s = 1 + x + … k = 2; t = x 2 /2; s = 1 + x + x 2 /2 + … k = 3; t = x 3 /(2·3); s = 1 + x + x 2 /2 + x 3 /3! + … D Computational Tools14 What formula is implemented by this program?

Structured Programming Flowcharts Flow control Functions Computational Tools15

Function Main Program:Function: a = 0; x = 1; y = 2function y = special(x) d = special(a)y = x + 1 Print dreturn y Notice that: The function input is named a in the main program and x in the function. The function output is named d in the main program and y in the function. The variables x and y in the function do not affect the variables x and y in the main program. The only effect of the function is to set d equal to a + 1. Computational Tools16

The following program is run. It uses the function simplefunction, which is also shown below. What is the value of h at the end of the program? g = 3; h = 5 p = simplefunction(g) function y = simplefunction(x) h = 7 y = x + h return y The function simplefunction returns 10 to the main program. The fact that the function uses h as the name of a local variable does not affect the h in the main program. The variable h in the main program remains 5. C A.12 B.10 C. 5 D. 7 Computational Tools17

The following program is run. It uses the function squareof, which is also shown below. What is the value of s at the end of the program? read x s = 1 y = squareof(x) s = s + y function s = squareof(x) s = x*x return s A.x B.x 2 C.2x 2 D.This program will result in an error message. The function squareof returns x 2 to the main program. The fact that the function uses the name s for the square does not affect the s in the main program. The assignment statement s = s + y produces x A Computational Tools18

Spreadsheets Formulas Copying and Pasting Formulas Computational Tools19

Formulas in Cells ABCD 123C2 2A1 3A1-C2 4A1*D3 ABCD Computational Tools20

Colon ABCD SUM(B1:B3) ABCD ABCD SUM(A3:C3) 4 ABCD Computational Tools21

Spreadsheets Formulas Copying and Pasting Formulas Computational Tools22

Absolute and Relative Addresses ABCD 18A1 2$A$1 3$A1 4A$1 ABCD Computational Tools23

Copy and Paste a Cell: $A$1 ABCD $A$1 4 ABCD ABCD Computational Tools24

Copy and Paste a Cell: A1 ABCD A1 4 ABCD C2 ABCD Computational Tools25

Copy and Paste a Cell: $A1 ABCD $A1 4 ABCD $A2 ABCD Computational Tools26

Copy and Paste a Cell: A$1 ABCD A$1 4 ABCD C$1 ABCD Computational Tools27

Copy and Paste a Column ABCD 185A1 2$A$1 3$A1 4A$1 ABCD 185A1B1 2$A$1 3$A1 4A$1B$1 ABCD Computational Tools28

Copy and Paste a Row ABCD A1$A$1$A1A$1 4 ABCD A1$A$1$A1A$1 4A2$A$1$A2A$1 ABCD Computational Tools29

In a spreadsheet, the number in cell A3 is 4. Cell A4 contains the formula A3 + $A$3. This formula is copied into cells A5 and A6. What is the value of cell A6? A. 4 B. 8 C. 16 D. 32 A A A A C Computational Tools30

In a spreadsheet, the formula $A$3 + $B3 + D2 is entered into cell C2. The contents of cell C2 are copied and pasted into cell D5. The formula in cell D5 is: A. $A$3 + C$2 + C4 B. $B$6 + $C4 + C4 C. $A$3 + $B6 + E5 D. $A$3 + $B2 + B2 cell C2: $A$3 + $B3 + D2 cell D5: $A$3 + $B6 + E5 C Computational Tools31

A spreadsheet contains the series of numbers 5,10,15,… in cells C2:C7. Cell D3 contains the formula (2*C2)+7. If the formula is copied and pasted into cells D4:D8, what is the numeric value in cell D8? A.67 B.55 C.93 D.77 The formula (2*C2)+7 in cell D3 employs the number in the cell one column to the left and one row up. C A In cell D8, this formula employs the number in the cell one column to the left and one row up (cell C7). This number is 30. (2*30)+7 = 67 Computational Tools32

In this spreadsheet, the contents of column B are copied and pasted into columns C and D. What numeric value will cell D4 have? ABCD 12$A$1 24A2 30A3+B2 45A$3*B3 ABCD 12$A$1 24A2B2C2 30A3+B2B3+C2C3+D2 45A$3*B3B$3*C3C$3*D3 ABCD A. 32 B. 64 C. 96 D.128 C Computational Tools33

In this spreadsheet, the cell D1 contains the formula (A1+B1+C1)/3. This formula is copied into the range of cells D2:D3. Cell D4 contains the formula SUM(D1:D3). What is the numeric value in cell D4? ABCD A.15 B.12 C.14 D.18 ABCD ABCD A Computational Tools34