Professional Documents
Culture Documents
Fow Seng Joe (B1757) - PFE Lab 2
Fow Seng Joe (B1757) - PFE Lab 2
INTAKE/GROUP :
BENGME2A
Fow Seng Joe B1757
Lab Feedback Form
Total Marks / 40
General Comments:
Name:
Learning Outcomes
Objective
Introduction
This laboratory introduces the field of computer science and covers the
fundamentals of hardware, software, operating systems, programming, problem
solving, and software engineering. The components of programs, such as key
words, variables, operators, and punctuation are covered.
Read and answer the Lab 1 Intro to C++ Programming IDE that has been
uploaded in Laboratory folder in Microsoft Teams.
Answer
Lab: 1 Introduction to C++ Programming and IDE BEE2009 PFE
5
Laboratory 2: Working with Tokens & IO Statements
Tutorial Activities
1.
Syntax errors • A syntax error is an error in the syntax of a sequence of
characters or tokens that is intended to be written in a
particular programming language. For example, a
missing semicolon at the end of a line or an extra
bracket at the end of a function may produce a syntax
error.
Runtime errors • A runtime error is a program error that occurs while the
program is running. For instance, there will be
misspelled or incorrectly capitalized variable and
function names. Attempts to perform operations such as
math operations on data of the wrong type.
Logic errors • The logical errors occur due to a fault in the logic of the
program. For instance, a logic error is a 'bug' or mistake
in a program's source code that results in incorrect or
unexpected behaviour.
3.
No. Rules Examples
1 Cannot have white space on the identifier resistance value
5.
Input Code:
Output code:
6.
a. 103e-4 0.0103
b. 123.45e3 123450
c. 1.2345e6 1234500
7.
a. 1300 1.3 X 103
b.123.45 1.2345 X102
c. 00426 4.26 X 10-3
8.
a. Valid d. Valid
b. Valid e. Invalid
c. Valid f. Valid
9.
Input code
Output code
Programming Activities:
1) Input code
Output code
2) Input Code
Output code
3) Input code
Output Code
4) Input Code
Output code