Assignment #3 Programming Language, Spring 2003

Slides:



Advertisements
Similar presentations
More on Psuedo-Code Sangeetha Parthasarathy 1/23/01.
Advertisements

Write a program step by step. Step 1: Problem definition. Given the coordinate of two points in 2-D space, compute and print their straight distance.
CS107 Introduction to Computer Science Lecture 3, 4 An Introduction to Algorithms: Loops.
Introduction to Unix – CS 21 Lecture 11. Lecture Overview Shell Programming Variable Discussion Command line parameters Arithmetic Discussion Control.
Java Planning our Programs Flowcharts Arithmetic Operators.
Lesson 4: Formatting Input Data for Arithmetic
Introduction to Computers and Programming Lecture 4: Mathematical Operators New York University.
Operator. Assignation (=). The assignation operator serves to assign a value to a variable. a = 5; It is necessary to emphasize that the assignation operation.
1 Introduction to Computers and Programming Class 3 Introduction to C Professor Avi Rosenfeld.
C programming an Introduction. Types There are only a few basic data types in C. char a character int an integer, in the range -32,767 to 32,767 long.
Chapter 31 Fundamentals of Programming in VB(Continue I) Numbers Arithmetic Operations Variables Incrementing the Value of a Variable.
WEB DESIGN AND PROGRAMMING Introduction to Javascript.
Introduction to Computational Linguistics Programming I.
 Input and Output Functions Input and Output Functions  OperatorsOperators Arithmetic Operators Assignment Operators Relational Operators Logical Operators.
Pascal Programming Strings, Arithmetic operators and output formatting National Certificate – Unit 4 Carl Smith.
ORDER OF OPERATIONS x 2 Evaluate the following arithmetic expression: x 2 Each student interpreted the problem differently, resulting in.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley STARTING OUT WITH Python Python First Edition by Tony Gaddis Chapter 2 Input,
History of C 1950 – FORTRAN (Formula Translator) 1959 – COBOL (Common Business Oriented Language) 1971 – Pascal Between Ada.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
1 INTRODUCTION TO PROBLEM SOLVING AND PROGRAMMING.
Synthesis ENGR 1181 MATLAB 11. Topics  No new material  Covers topics that will be on the Midterm 2 Exam MATLAB 01 – Program Design MATLAB 02 – Introduction.
Course Title: Object Oriented Programming with C++ instructor ADEEL ANJUM Chapter No: 03 Conditional statement 1 BY ADEEL ANJUM (MSc-cs, CCNA,WEB DEVELOPER)
3D Puzzle Assignment #1 Programming Language, Spring 2003.
ECS 15 Variables. Outline  Using IDLE  Building blocks of programs: Text Numbers Variables!  Writing a program  Running the program.
Khalid Rasheed Shaikh Computer Programming Theory 1.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
Chapter 3 w Variables, constants, and calculations DIM statements - declaration temporary memory locations identifier, data type, scope data types - values.
Math, Data Types. Python Math Operations OperationOperator Addition + Subtraction – Multiplication * Division (floating point) / Division (integer) //
The assignment expressions. The assignment operator in an assignment statement We have seen the assignment statement: Effect: var = expr; Stores the value.
SATMathVideos.Net A set S consists of all multiples of 4. Which of the following sets are contained within set S? A) S2 only B) S4 only C) S2 and S4 D)
Algorithm Discovery and Design Objectives: Interpret pseudocode Write pseudocode, using the three types of operations: * sequential (steps in order written)
Midterm Exam Topics (Prof. Chang's section) CMSC 201.
Variables.. Part 2 Calculations. Review of yesterday Three types of variables var num:int var average:real var username:string No decimals Might have.
Dr. Sajib Datta Jan 21,  Declare a variable ◦ int height; [note that no value is still assigned]  Assign a variable a value ◦ height =
NOTE: C programs consist of functions one of which must be main. C programs consist of functions one of which must be main. Every C program begins executing.
Island of Logic Assignment #4 Programming Language, Spring 2003.
Do Now: : Use Distributive Property. Do Now: : Solving using Distributive Property and Combining like terms.
Introduction to programming in java Lecture 21 Arrays – Part 1.
CS 240 Computer Programming 1
CCSA 221 Programming in C CHAPTER 3 COMPILING AND RUNNING YOUR FIRST PROGRAM 1 ALHANOUF ALAMR.
2.3 Output Formatting. Outputting Format Specify the number of spaces, “c”, used to print an integer value with specifier %cd, e.g., %3d, %4d. E.g. printf.
Introduction to Calculated Columns Variables, Conditionals, and String Manipulation PRESENTER: Cameron Blashka| Informer Implementation Specialist| April.
Lecture 4: Expressions and Variables
1-1 Logic and Syntax A computer program is a solution to a problem.
Addition/ Subtraction
CS1001 Programming Fundamentals 3(3-0) Lecture 2
Test Review Computer Science History
Design & Technology Grade 7 Python
Organization of Programming Languages
Algebra Algebra.
Programming Right from the Start with Visual Basic .NET 1/e
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
PROGRAMMING Program Development.
Lecture 3: Expressions and Variables
Constants and Variables
Variables and Expressions
CS150 Introduction to Computer Science 1
Core Objects, Variables, Input, and Output
LMC Little Man Computer What do you know about LMC?
CS150 Introduction to Computer Science 1
What Is Wrong With This Simple Code?
For this assignment, copy and past the XHTML to a notepad file with the .html extension. Then add the code I ask for to complete the problems.
Engineering Problem Solving with C++ An Object Based Approach
Engineering Problem Solving with C++ An Object Based Approach
Lecture 4: Expressions and Variables
-4 is the y-value or the function value.
This is an introduction to JavaScript using the examples found at the CIS17 website. In previous examples I specified language = Javascript, instead of.
Python Basics. Topics Features How does Python work Basic Features I/O in Python Operators Control Statements Function/Scope of variables OOP Concepts.
Karan Thaker CS 265 Section 001
Python Creating a calculator.
Presentation transcript:

Assignment #3 Programming Language, Spring 2003 Calculator Assignment #3 Programming Language, Spring 2003

Specification (1) Calculator Application. Only integer arithmetic The operations are addition, subtraction and multiplication Use an arbitrary number of variables whose names are A,B,C,D,E. Main way of doing calculations To type in a few formulas and to assign them to variables Some formulas are complicated expressions, which can refer to yet undefined variables, while other formulas consist of a single number Then asks for the value of some variables Redefine some variables and then to reevaluate formulas that depend on these variables

Specification (2) Arithmetic Assignment Print Reset var := expression PRINT var Reset RESET

Assignment Objectives Implement calculator Input a few formulas and etc. Then answer the value of some variables asked for For each ``PRINT'' statement found in the input file Output a line containing the numerical value of the specified variable Or the word ``UNDEF'' if the variable is undefined

Input Convention Input file Contain a few formulas and etc. Example A := B + C B := 3 C := 5 PRINT D PRINT A B := 8 RESET A := 1 + ( 2 + ( 3 + ( 4 + 5 * 6 ) * 7 ) * 8 ) PRINT B

Output Convention Output file For each ``PRINT'' statement found in the input file Output a line containing the numerical value of the specified variable Or the word ``UNDEF'' if the variable is undefined Example UNDEF 8 13

Source Code calculator.scm Output value of the specified variable Input formulas and etc. calculator.in Output value of the specified variable calculator.out

Spec. Assignment Spec. System Unix Language Scheme (MIT Scheme)