1 ENGI 2420 Structured Programming (Lab Tutorial 4) Memorial University of Newfoundland.

Slides:



Advertisements
Similar presentations
Etter/Ingber Engineering Problem Solving with C Fundamental Concepts Chapter 4 Modular Programming with Functions.
Advertisements

Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Object-Oriented programming in C++ Classes as units of encapsulation Information Hiding Inheritance polymorphism and dynamic dispatching Storage management.
Modular Programming With Functions
Computer Programming w/ Eng. Applications
Computer Security coursework 3 (part 2) Dr Alexei Vernitski.
1 ENGI 2420 Structured Programming (Lab Tutorial 0) Memorial University of Newfoundland.
CMPUT 101 Lab # 5 October 22, :00 – 17:00.
Taylor Series (11/12/08) Given a nice smooth function f (x): What is the best constant function to approximate it near 0? Best linear function to approximate.
1 9/20/06CS150 Introduction to Computer Science 1 Review: Exam 1.
Top-Down Design with Functions 4 What do programmer’s (not programs!) use as input to the design of a program? –Documentation Problem definition Requirements.
Downloading and Installing AutoCAD Architecture 2015 This is a 4 step process 1.Register with the Autodesk Student Community 2.Downloading the software.
Introduction to MATLAB ENGR 1187 MATLAB 1. Programming In The Real World Programming is a powerful tool for solving problems in every day industry settings.
CPS 2231 Computer Organization and Programming Instructor: Tian (Tina) Tian.
MBAC 611.  Click on the My Computer Icon  Open your private network directory  Create a new folder named lab7  Copy your lab6 Access file to the lab7.
Intro to C++. Getting Started with Microsoft Visual Studios Open Microsoft Visual Studios 2010 Click on file Click on New Project Choose Visual C++ on.
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
Chapter 3.  Traditionally, programming languages have assigned different types of data for different types of numbers.  In many languages, there may.
An Introduction to Programming and Algorithms. Course Objectives A basic understanding of engineering problem solving process. A basic understanding of.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 10 – Enhancing the Wage Calculator Application:
Monday, Jan 13, 2003Kate Gregory with material from Deitel and Deitel Week 2 Questions from Last Week Control Structures Functions Lab 1.
Final Exam Review Closed book Closed laptop One sheet of notes permitted SE-0010 Dr. Mark L. Hornick 1.
CSC350: Learning Management Systems COMSATS Institute of Information Technology (Virtual Campus)
Class Example - Rationals Rational numbers are represented by the ratio of two integers, a numerator and a denominator, e.g., 2/3. This is opposed to irrational.
Agenda Review C++ Library Functions Review User Input Making your own functions Exam #1 Next Week Reading: Chapter 3.
Discussion 5. Lab 3 Not really using rectangle class Return type of getPoint is String instead of Point You are not able to retrieve the point if you.
Fundamental Programming: Fundamental Programming Introduction to C++
C++ Basics C++ is a high-level, general purpose, object-oriented programming language.
All About Me Finding and Editing Saved Student Work Part II.
Chapter 3 MATLAB Fundamentals Introduction to MATLAB Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
© The McGraw-Hill Companies, 2006 Chapter 2 Selection.
Going Green Initiatives in AP Computer Science A (Mr. Smith’s Classroom)
Chapter 4 Introduction to Classes, Objects, Methods and strings
ECA 225 Applied Interactive Programming1 ECA 225 Applied Online Programming basics.
1 ENGI 2420 Structured Programming (Lab Tutorial 7) Memorial University of Newfoundland.
Functions Overview Functions are sequence of statements with its own local variables supports modularity, reduces code duplication Data transfer between.
Mobile Programming Lecture 3 Debugging. Lecture 2 Review What widget would you use to allow the user to enter o a yes/no value o a range of values from.
Introduction Chapter 1 8/31 & 9/1 Imagine! Java: Programming Concepts in Context by Frank M. Carrano, (c) Pearson Education - Prentice Hall, 2010.
1 ENGI 2420 Structured Programming (Lab Tutorial 8) Memorial University of Newfoundland.
How to Back Up In 10 Easy Steps. Step 1: Double click on My computer. You should see something like this. WatchWatch.
1 ENGI 2420 Structured Programming (Lab Tutorial 5) Memorial University of Newfoundland.
CS1201: PROGRAMMING LANGUAGE 2 FUNCTIONS. OVERVIEW What is a Function? Function Prototype Vs Decleration Highlight Some Errors in Function Code Parameters.
Modularity using Functions Chapter 4. Modularity In programming blocks of code often can be "called up" and reused whenever necessary, for example code.
L what are executable/non-executable statements l out of the ones below which constructs are executable #include p=3.14; const double PI=3.14; int myfunc(int);
1 L Bellamy Reminder, PLEASE! (see U:\MODELING\ASSESSMT\EXPECT\REMINDER.DOC) éPrint out the U:\MODELING\ASSESSMT\CHKLST\CHKLST10.DOC and attach it as the.
1 ENGI 2420 Structured Programming (Lab Tutorial 7) Memorial University of Newfoundland.
1 ENGI 2420 Structured Programming (Lab Tutorial 1) Memorial University of Newfoundland.
1 ENGI 2420 Structured Programming (Lab Tutorial 3) Memorial University of Newfoundland.
PHP Form Processing * referenced from
Announcements You will receive your scores back for Assignment 2 this week. You will have an opportunity to correct your code and resubmit it for partial.
AVCE ICT – Unit 7 - Programming Session 12 - Debugging.
Announcements Assignment 2 Out Today Quiz today - so I need to shut up at 4:25 1.
1 ENGI 2420 Structured Programming (Lab Tutorial 2) Memorial University of Newfoundland.
FUNCTIONS (C) KHAERONI, M.SI. OBJECTIVE After this topic, students will be able to understand basic concept of user defined function in C++ to declare.
Bill Tucker Austin Community College COSC 1315
Some Assignments  Write a program which prints the following information about at least 5 persons: NAME MAIL-ID EMPLOYEE-CODE PHONE Eg. Umesh
CSCI 161: Introduction to Programming Function
Input/Output Input/Output operations are performed using input/output functions Common input/output functions are provided as part of C’s standard input/output.
Use proper case (ie Caps for the beginnings of words)
WEB PROGRAMMING JavaScript.
Assignment 4 For this assignment refer to the notes on MATLAB from an MIT course that you can find here (or at the original website, lectures 14, 15, 16).
We are starting to program with JavaScript
Announcements Homework 1 will be assigned this week,
Programming in JavaScript
Programming in JavaScript
HOW TO REVIEW MULTIPLE CREDIT CARD TRANSACTIONS IN PAYMENTNET
Functions continued.
Review Lab assignments Homework #3
Printing from the Konica after you’ve sent a file down to print
Presentation transcript:

1 ENGI 2420 Structured Programming (Lab Tutorial 4) Memorial University of Newfoundland

ENGI 2420 – Structured Programming Lab Tutorial Problems in Assignment How to Recognize a Project in Eclipse 4.3Resubmit Policy 4.4Assignment-4 Lab Tutorial 4

ENGI 2420 – Structured Programming Lab Tutorial Problems in Assignment-3  Why different answers than those in the lab notes (FAQ)? - unit conversion - how to multiply by 1/2? In C++, use 0.5, 1.0/2, or 1/2.0 etc. - sign problems  Signs for deceleration and delta_v (FAQ): - deceleration should return a positive number for a decrease in speed (i.e., v1 < v0). - delta_v should be interpreted as change in speed, so a negative value is a decrease in speed 4.1 Problems in Assignment-3

ENGI 2420 – Structured Programming Lab Tutorial 4 4 Common Problems  Correctly understand the meaning of the parameters on the function argument list e.g., declaration: double deceleration ( double v0, double v1, double delta_t );  double decelerationStop2 = deceleration( v0, (delta_v +v0), delta_v); double decelerationStop2 = deceleration( v0, (delta_v +v0), delta_t);  FAQ: should I document each variable? - to be on the safe side, We 'd suggest you do. 4.1 Problems in Assignment-3

ENGI 2420 – Structured Programming Lab Tutorial 4 5 Style point  It isn’t necessary to return the value of a variable double d = (v0-v1) / 3.6 /delta_t; return d ;  Might as well be return (v0-v1) / 3.6 /delta_t;

ENGI 2420 – Structured Programming Lab Tutorial How to Migrate an Eclipse Project  First work on your assignment on machine-A  Copy the project folder from machine-A to M:Drive  If you work on machine-B in the lab next time, copy your project folder from M:Drive to machine-B (say, under My Documents/workspace)  In Eclipse, click File->New->C++ Project and type in the original project name. Ignore the warning message and click Finish. The old project will be recognized in Eclipse on Machine-B 4.2 How to Recognize a Project in Eclipse

ENGI 2420 – Structured Programming Lab Tutorial Resubmit Policy  Resubmits are permitted automatically on every assignment - for students who submitted the assignment in the first place - style will not be marked again - resubmits are due at 8:55 am on the day shown in the assignment table on the course web-site - note that resubmits on assignments 4-8 will cost you one mark 4.3 Resubmit Policy

ENGI 2420 – Structured Programming Lab Tutorial Assignment-4  Structure of C++ files - a4main.cpp: contains a code that calls the functions using input typed in by the user (Note that you are not expected to understand all of the code in this file at this point in the course) - assign4.h: contains the declarations for the functions - assign4.cpp: contains your implemented functions  Implement two functions as follows 4.4 Assignment-4

ENGI 2420 – Structured Programming Lab Tutorial 4 9 Function 1  double sineSeries(double x, int n) - computes the nth-order Maclaurin series approximation of sin(x) - where x is an angle in radians in the range (-π, π). n is the degree of the highest term - note that the even degree terms are all 0. For n=7 or n=8 we have - returns the magnitude of the difference between the computed approximation and the libraryfunction (sin) 4.4 Assignment-4

ENGI 2420 – Structured Programming Lab Tutorial 4 10 Function 2  double expSeries ( double x, int n) - computes the nth-order Taylor series approximation of e x - where x is any number, n is the degree of the highest term - returns the magnitude of the difference between the computed approximation and the library function (exp) 4.4 Assignment-4

ENGI 2420 – Structured Programming Lab Tutorial 4 11 Execution Example (I) Available options: 1 - Test sineSeries 2 - Test expSeries 0 - Quit Please enter a selection: 1 Enter the angle in radians (range -pi, pi): 1.5 Enter the highest order: 9 sineSeries(1.5, 9) = e Assignment-4

ENGI 2420 – Structured Programming Lab Tutorial 4 12 Execution Example (II) Available options: 1 - Test sineSeries 2 - Test expSeries 0 - Quit Please enter a selection: 2 Enter the exponent: 1.5 Enter the highest order: 4 expSeries(1.5, 4) = Assignment-4