Professional Documents
Culture Documents
LAB1
LAB1
LAB1
Learning Objectives/Outcomes:
Upon completion of this lab, the student should be able to:
• use the smartv3 system for gaining the course learning materials, taking the
quizzes and
tests, submitting the course works and joining the discussion forum (Practice
1)
• familiar with C++ Integrated Development Environment (IDE) for coding,
compiling and
debugging C++ program (Practice 2)
• write a C++ program structure, including the comments, preprocessor directive,
main
function, standard libraries such as input stream (cin), comments, white
space and basic
formatting (e.g. ‘\n’, ‘\t’, etc.) (Practice 3 & Practice 4)
After the installation, familiar yourself with the installed C++ IDE environment:
i. Writing and editing C++ Code
ii. Configure your compiler and build your C++ project
iii. Debugging the Program under the debugger or running in debug mode to
investigate the
problems
SAMPLE RUN :
===================================================
# Welcome to KT14303 Programming Principles! #
# Faculty of Computing and Informatics, #
# Universiti Malaysia Sabah. #
===================================================
SAMPLE RUN :
=====================================================
# Welcome to KT14303 Programming Principles! #
# Faculty of Computing and Informatics, #
# Universiti Malaysia Sabah. #
# STUDENT NAME #
# BI22XXXXXX #
# while (! (succeed =try())); #
=====================================================
Practice 3
// Practice3.cpp : This file contains the 'main' function. Program execution begins
and ends there.
//
#include <iostream>
using namespace std;
int main()
{
cout <<
"=========================================================" << endl;
cout << "#\tWelcome to KT14303 Programming Principles!\t#" << endl;
cout << "#\t Faculty of Computing and Informatics,\t\t#" << endl;
cout << "#\t Universiti Malaysia Sabah.\t\t#" << endl;
cout <<
"=========================================================" << endl;
return 0;
}
Practice 4
// Practice4.cpp : This file contains the 'main' function. Program execution begins
and ends there.
//
#include <iostream>
using namespace std;
int main()
{
cout << "=========================================================" << endl;
cout << "#\tWelcome to KT14303 Programming Principles !\t#" << endl;
cout << "#\t Faculty of Computing and Informatics,\t\t#" << endl;
cout << "#\t Universiti Malaysia Sabah.\t\t#" << endl;
cout << "#\t Irfa Irsya Binti Suhaizan\t\t#" << endl;
cout << "#\t\t BI22160523\t\t\t#" << endl;
cout << "#\t\t Enjoy Your Life\t\t\t#" << endl;
cout << "=========================================================" << endl;
return 0;
}