6
Functions and an
Introduction
to Recursion
EIE2264 Computer Programming, PolyU
OBJECTIVES
To construct programs modularly from
functions.
To create functions with multiple parameters.
The mechanisms for passing information
between functions and returnin
Graphical User Interface (GUI)
Microsoft Visual Studio 2015
1
Objectives
1.
2.
3.
4.
Develop simple GUI forms
Usage of unmanaged codes in GUI
Develop multiple GUI forms
Usage of Windows Graphical Device
Interface (GDI+)
2
Develop a Simple GUI Example 1
St
EIE2264
Command-Line Processing and
Linked List
Dr. Lawrence Cheung
Outline
Command-Line Processing
Linked List
Introduction
Linked List
Stack
Queue
Tree
EIE2264, Command-Line Processing and Linked List
The Hong Kong Polytechnic University
2
Comman
17
File Processing
EIE2264 Computer Programming, PolyU
1
OBJECTIVES
In this chapter you will learn:
To create, read, write and update files.
Sequential file processing.
Random-access file processing.
To use high-performance unformatted I/O
operations.
The Hong Kong Polytechnic University
Department of Electronic and Information Engineering
EIE2264 Lab 8: Command-line Processing and Linked List
(Deadline for Submission: Check the course information)
Introduction
This tutorial is designed to give you han
The Hong Kong Polytechnic University
Department of Electronic and Information Engineering
EIE2264 Assignment 2: Static Library with pointers, file processing, and GUI
(Deadline for Submission: Check the course information)
Introduction
This assignment is
The Hong Kong Polytechnic University
Department of Electronic and Information Engineering
EIE2264 Lab 9: File Processing
(Deadline for Submission: Check the course information)
Question
You are the owner of a hardware store and need to keep an inventory t
The Hong Kong Polytechnic University
Department of Electronic and Information Engineering
EIE2264 Lab 10: GUI
(Deadline for Submission: Check the course information)
Introduction
This tutorial is designed to give you hand-on experience in GUI.
Question
Yo
Name:
Tutorial
EIE, Communication Fundamentals
Tutorial Angle Modulation
Angle modulation general expression: v0 (t) = A0 cos[27gfct + 1/0)]
Part 1: Class Activity
Refer to the following block diagram for the generation of phase modulation:
m(f)
->
Phase
Hong Kong Polytechnic University
Department of Electronic and Information Engineering
EIE 3381
Q1.
Given an analog data below:
7
0
a)
First Sampling Point
Encode the above signal by PCM with 8 quantization levels.
Solution
Code for samples are (in decimal
EIE3381 Communication Fundamentals ~ Tutorial (FM)
An 88.1MHZ FM broadcasting transmitter develops an output power of 15 kW into its
folded halfwave dipole antenna with a feeding resistance of 300 Q. The modulator of the
transmitter has a peak frequency d
EIE4415 MT Homework 2: Multimedia Communications
1.
2.
Assume a MPEG coder is used to encode an NTSC composite video (YUV format), the image
sequence is of size 720x480 with 8-bit resolution for each luminance and chrominance component of
the pixel.
(a)
I
EIE3381 Tutorial 4a
Q1
A synchronous time-division multiplexing system is used to multiplex two analog signals and
four digital signals. The first analog signal has a 5 kHz bandwidth, and the second has a
bandwidth of 10 kHz. All of the digital signals ha
EIE4415 MT Homework 4: Digital TV
Q1. Consider the following convolution encoder.
+
Encoded
Sequence
O1
S3
S2
S1
Input Sequence
O2
+
(a) Construct the trellis diagram.
(b) Assume that a message sequence of 0010100011 is to be sent to the
encoder. Using pa
EIE4415 MT Homework 1: Multimedia Compression
You have to submit Questions (7) and (9) by 11 Oct. 2016
1.
The following character string is to be transmitted using Huffman coding:
ABACADABACADABACABAB
(a)
(b)
(c)
Describe the Huffman code table.
Determine
EIE4415 MT Homework 3: Error Resilience and Concealment
1. A series of messages is to be transferred between two computers over a PSTN. The messages comprise
just the characters A through H. Analysis has shown that the probability (relative frequency of
o
EIE4415 MT Tutorial 7: PAT
Assume that a digital TV channel can carry 3 digital TV programs (P1, P2, and P3)
and each program contains one video bitstream and one audio bitstream. Fig. 1 shows
parts of the Program Map Tables (PMTs) for these programs.
P1
EIE4415 MT Tutorial 5: Scalable Coding
1.
Suppose after the DCT transform we obtain a set of coefficients, the first eight of
which are
29.75 6.1 -6.03 1.93 -2.01 1.23 -0.95 2.11
(a) Suppose this set of coefficients is quantized by a step size of 4, and i
EIE4415 MT Tutorial 2: JPEG Compression
Suppose a 256 gray-level image is divided into 44 blocks and encoded using a JPEG
baseline encoder. The quantized Discrete Cosine Transform (DCT) coefficients of the first
three 44 blocks in the image are given as f
EIE4415 MT Tutorial: Multimedia Integration Tools
A multimedia presentation that comprises three media clips which include
Video clip video.rm (size: 320(w)240(h)
Image clip image.jpg (size 300(w) 50(h)
Audio clip audio.ra
This presentation has the follow
EIE4415 MT Tutorial 3: Discussion on Motion Estimation/Compensation
1.
Fig 1(a) and 1(b) show the situation of a reference frame and a current block for
block matching motion estimation. The size of searching window is 142 while
the block size is 22. The
EIE4415 MT Tutorial 1: Lossless Compression
1.
A series of messages is to be transferred between two computers over a PSTN.
The messages comprise just the characters A through H. Analysis has shown that
the probability (relative frequency of occurrence) o
EIE4415 MT Tutorial 4: Motion-compensated Prediction and Video Coding
Figures (a) and (b) show two consecutive video frames, denoted as frame(t1) and
frame(t), respectively. To encode frame(t), the frame is divided into blocks of size 22
and frame(t1) is
EIE 2261 Logic Design
Homework 3: Sequential Systems (Suggested Solutions)
1. The S=R=1 input pattern is invalid to a SR latch (the output is unstable), but what is
input is out of the SR latchs control. By connecting D to S and "not" D to R, the D
latch
EIE 2105 Digital and Computer Systems
Tutorial 2- Boolean Algebra and Logic Gates
1.
2.
Derive the truth tables of the following Boolean functions, rewrite them in Sum of Minterms
and Product of Maxterms, and write down their formal shorthand.
(a)
F ( A,
EIE 2261 Logic Design
Tutorial 4- Arithmetic Functions
Q1. The following binary numbers have a sign in the leftmost position and, if negative, are in
2s complement form. Perform the indicated arithmetic operations and verify the answers
by decimal operati
EIE2261 Logic Design
Homework 2: Combinational Logic Design (Suggested Solutions)
The truth table of a priority encoder has been given as follows.
D3
0
0
0
0
1
Inputs
D2 D1
0
0
0
0
0
1
1
X
X
X
D0
0
1
X
X
X
Outputs
A1
A0
V
X
X
0
0
0
1
0
1
1
1
0
1
1
1
1
(a)
EIE 2261 Logic Design
Tutorial 3- Combinational Logic Design
Q1. In p.7 of Chapter 3, it is said that the Boolean functions of the output variables of the circuit
shown in Fig. Q1 are given as
Fig. Q1
Prove that the following equation is true:
F1 A BC ABD