EECE 231 Introduction to Programming Using C+ and
MATLAB
Programming Assignment 4
October 1, 2014
This programming assignment consists of 3 problems.
It is due at the beginning of the next lab session by 3:00 pm. You are required to submit your
solution
EECE 231 Introduction to Programming Using C+ and
MATLAB
Programming Assignment 6
October 23, 2014
This programming assignment consists of 4 problems.
It is due at the beginning of the next lab session by 3:00 pm. You are required to submit your
solutio
/Assignment 4
/Problem 3
/Author: Maya Safieddine
#include <iostream>
using namespace std;
/list of functions signatures in order to access them from main before their
full implementation after the main function.
int sequentialSearch(int A[], int n, int x
EECE 231 Introduction to Programming Using C+ and
MATLAB
Programming Assignment 11
December 3, 2014
This programming assignment consists of 2 problems (+ 1 optional problem).
It is never due but it covers material included in the nal exam.
Related Read
EECE 231 Introduction to Programming Using C+ and
MATLAB
Programming Assignment 10
November 27, 2014
This programming assignment consists of 3 problems.
It is due at the beginning of the next lab session by 3:00 pm. You are required to submit your
solut
EECE 231 Introduction to Programming Using C+ and
MATLAB
Programming Assignment 9
November 19, 2014
This programming assignment consists of 3 problems.
The due date will be specied by the instructor. You are required to submit your solutions of
the lab
EECE 231 Introduction to Programming Using C+ and
MATLAB
Programming Assignment 7
October 30, 2014
This programming assignment consists of 3 problems.
It is due at the beginning of the next lab session by 3:00 pm. You are required to submit your
solutio
EECE 231 Introduction to Programming Using C+ and
MATLAB
Programming Assignment 8
November 6, 2014
This programming assignment consists of 2 problems.
The due date will be specied by the instructor. You are required to submit your solutions of
the lab a
EECE 231 Introduction to Programming Using C+ and
MATLAB
Programming Assignment 5
Updated on Wed Oct 15
October 15, 2014
This programming assignment consists of 5 problems.
It is due at the beginning of the next lab session by 3:00 pm. You are required
EECE 231 Introduction to Programming Using C+ and
MATLAB
Programming Assignment 3
September 24, 2014
This programming assignment consists of 4 problems.
It is due at the beginning of the next lab session by 3:00 pm. You are required to submit your
solut
EECE 231 Introduction to Programming Using C+ and
MATLAB
Programming Assignment 2
September 17, 2014
This programming assignment consists of 5 problems.
It is due at the beginning of the next lab session by 3:00 pm. You are required to submit your
solut
EECE 231 Introduction to Programming
Using C+ and MATLAB
Programming Assignment 1
September 8, 2014
Introduction
Your lab instructors will guide you on how to start your development environment and make it ready so that you can use it to write programs. U
Department of Electrical and Computer Engineering
Faculty of Engineering and Architecture
American University of Beirut
Course Information
Course title: Introduction to Programming Using C+ and MATLAB
Course number: EECE 231
Catalog description:
An introd
EECE 231  Introduction to Programming
Using C+ and MATLAB
Programming Assignment 2
Due  September 16, 2016
This programming assignment consists of 3 problems.
It is due during the next lab session. You are required to submit your solutions of the lab
as
EECE 231: F ILES R EADING AND
W RITING
R EADING : B IELAJEW, S ECTION 9.4
M ATLAB HELP FOR FILE READ / WRITE
FUNCTIONS
Oct 1, 2014
Electrical and Computer Engineering (ECE)

EECE 231
O BJECTIVES
Learn the concept of a le as a basic unit of storage.
Readi
EECE 231: I NTRODUCTION TO M ATLAB
R EADING : B IELAJEW, C HAPTER 11
Oct 1, 2014
Electrical and Computer Engineering (ECE)

EECE 231
O BJECTIVES
Introduce the Matlab environment
Illustrate that Matlab is an interpretation program
Understand data represen
/*
* course: EECE 231
* Lab: 3
* Problem: 4b
* author: Ameen Jaber
*/
#include <iostream>
using namespace std;
int main() cfw_
/ Declare variables
int n;
/ Read the possible sum of two squares number from the user
cout < "Please enter an integer: ";
cin
cplusplus.com
C+ Language Tutorial
Written by: Juan Souli Last revision: June, 2007
Available online at:
http:/www.cplusplus.com/doc/tutorial/
The online version is constantly revised and may contain corrections and changes
The C+ Language Tutorial
This d
C+ Programming:
Control Structures
Some material taken from: C+ Programming: Program Design Including Data Structures
Objectives
Learn about control structures
Examine relational and logical operators
Explore how to form and evaluate logical
(Boolean)
C+ Programming:
Basic Elements of C+
Some material taken from: C+ Programming: Program Design Including Data Structures
Objectives
Become familiar with the basic components of
a C+ program, including functions, special
symbols, and identifiers
Explore s
C+ Programming:
Arrays
Some material taken from: C+ Programming: Program Design Including Data Structures
Motivation
Consider the following problems:
Read a large list of numbers and print it in
reverse order
Sort a large list of numbers
Need to store
C+ Programming:
Overview of computers and
programming
Some material taken from: C+ Programming: Program Design Including Data Structures
Outline
Hardware components of a computer system
Highlevel programming languages
Edit, Compile, link, execute
Alg
EECE 231: G RAPHICS 2D AND 3D PLOTS
R EADING : B IELAJEW, C HAPTER 12
M ATLAB HELP FOR GRAPHICS AND 3D
VISUALIZATION
Oct 1, 2014
Electrical and Computer Engineering (ECE)

EECE 231
O BJECTIVES
Go over the basic graphics support in Matlab.
Illustrate 2D
EECE 231: R ECURSION
R EADING : B IELAJEW, S ECTION 9.3
A DDITIONAL REFERENCES : M AILK , C HAPTER 16
Oct 1, 2014
Electrical and Computer Engineering (ECE)

EECE 231
O BJECTIVES
Learn recursive denitions
Learn base and general cases in a recursive deniti
EECE 231: S YMBOLIC M ATH
M ATLAB HELP FOR SYMBOLIC MATH
Oct 1, 2014
Electrical and Computer Engineering (ECE)

EECE 231
O BJECTIVES
Appreciate how symbolic computation works
Learn Matlab basics for symbolic computations
Learn how to integrate, different
The Towers of Hanoi
Authors: Martin Hofmann and Berteun Damman
The idea and visualization were by Martin Hofmann, Berteun
Damman programmed the actual recursion.
Tower of Hanoi 1 Disc
1
Tower of Hanoi 1 Disc
1
Moved disc from pole 1 to pole 3.
Tower of Ha
EECE 231: I NTRODUCTION TO M ATLAB :
PART II
R EADING : B IELAJEW, C HAPTER 11
Oct 1, 2014
Electrical and Computer Engineering (ECE)

EECE 231
O BJECTIVES
Introduce Matlab terminology
Introduce loops in Matlab
Introduce control structures in Matlab
Intro
/=
/ Name
: pa3_p1_a.cpp
/ Author
: HusseinSibai
/ Description : Solution of problem 1a of the pa3 in EECE231 \ Fall 2014
/=
#include<iostream>
using namespace std;
int main()
cfw_
int n;
cout < "Please enter the number of entries in the sequence (strictl
#include <iostream>
#include <cmath>
using namespace std;
int main()
cfw_
int x;
cout<"Please enter a positve integer: ";
cin> x;
int numberOfPrimes = 0;
int n=2;
while(n<=x)
cfw_
/ code from part (b) /
bool isPrime = true;
int i = 2;
while(i*i<=n & isPri
#include <iostream>
#include <cmath>
using namespace std;
int main()
cfw_
int n;
cout <"This is a primality test. Please enter a positive integer:"<endl;
cin > n;
bool isPrime = true;
if (n=1)
isPrime = false;
/ 1 is not prime by convention
else cfw_
int