First term exam
Section A
40 MC (40 marks) - book 2 - around 10MC from Cisco
Section B (Structure questions) - 60 marks
- around 34 marks (from Section C: Networking, web page authoring etc)
- around 13 marks (from Section B)
- around 13 marks (from Section D:programming)
Chapter 11-22
No HTML will be given. You only needed to read.
You need to draw flow chart.
Algorithm Design I
Tools for learning Flowchart:
- Raptor http://raptor.martincarlisle.com/
Complete the following flowchart and upload to Google Drive
Name: S5XYY_example2.rap
Submission on or before Dec 13, 2016
Example 1:
Sharing payment after a dinner.
Problem Identification
Problem analysis
Algorithm Design
Developing a solution
Debugging and testing
Documentation
Sharing payment of N persons after a dinner
Create an IPO chart
Input
Number of person (N)
Total amount of payment: (TOTAL)
Process
Calculate each share
AMT = TOTAL /N
Output
Each share
N: integer
TOTAL: Real (Float, double etc)
SHARE: Real
Pseudo code
Get N
Get TOTAL
Set SHARE to TOTAL /N
OUTPUT SHARE
User Raptor to prepare the flowchart.
In the menu bar, Click "Generate" - "C++"
Paste to http://codepad.org and do the following modification
- declare all variable: string, int, double
- C++ is case sensitive. Change the variable name to small capital letter.
- You can not run "cin" input statement, so use assignment statement to replace it.
Better to create a account and login.
The result will be similar to below:
#include <iostream>
#include <string>
using namespace std;
int main()
{
int total=100;
int n=10;
int amt;
amt =total/n;
cout << "Each person needs to pay $" << amt << endl;
return 0;
}
Class work
- Submit 3 html files (2nd test) using notepad++
- complete the above flow chart using raptor, pseudo code with codepad, copy to notepad and submit in eclass.
- complete example 3 of your text book with raptor, write pseudo code with notepad++, generate C++ code and do modification and complete it in codepad.
Submit all the files in eclass
22.3 Basics of Constants and variables in Computer Programming
Constant and variables
Common Data types
2 Common Data structures are string and (1-Dimensional) array
Array is a collection of variables of the same data type which can access by the same name. Usually work together with looping.
"ICT" is an array of char
Relational operator (Similar to Excel, database)
Logical operator: Similar to Excel, Database
Order of Precedence (Priority): NOT (negative ), AND (multiplication), OR (Addition)
Refer to P.38
Practical 1 on Dec/11, 2014
Create a Forum registration form with at least including the following items:
- Mandatory field: Name, Sex, Age (ranging from 13- 20 inclusive)
- Do suitable validation.
- Add other field for other Input type. You should know the name of input type.
- share it with all Rosaryhill School User Only, log their username.
- post your URL in https://rhss.edmodo.com