Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

COMPUTER SCIENCE PROGRAM

FACULTY OF COMPUTING AND INFORMATICS


UNIVERSITI MALAYSIA SABAH

KT14303 PROGRAMMING PRINCIPLES


Lab 1 Introduction to Programming
______________________________________________________________________________
Student Matric No :_____________________
Student Name :_________________________
Program : HC00/HC05/HC14
Course Code : KT14303

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, includes the comments, preprocessor directive, main
function, standard library such as input stream (cin), comments, white space and basic
formatting (e.g. ‘\n’, ‘\t’, etc.) – Practices 3 & 4

INSTRUCTION: ANSWER ALL QUESTIONS

Practice 1: Working with Smartv3 system (Estimate 15 minutes to 30 minutes)


i. Login to smartv3 system.
ii. Take the mock test.
iii. Download Lab 1 question.
iv. Submit the lab 1 works.

Practice 2: Working with C++ IDE (Estimate 15 minutes to 30 minutes)

The C++ IDE tools could be assessed through the following web sites. Download and install the
program.

• Visual Studio Community https://visualstudio.microsoft.com/vs/community/


• Eclipse - https://www.eclipse.org
• NetBeans IDE - https://netbeans.org/features/cpp/
• DevC - http://www.bloodshed.net
• ChIDE - https://www.softintegration.com

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 run in debug mode to investigate the
problems

1
Practice 3: Structure of C++ Program (Estimate 15 minutes to 30 minutes)
Write your first C++ Program that displays a message “Welcome to KT14303 Programming
Principle Faculty of Computing and Informatics Universiti Malaysia Sabah!” inside a box on the
console screen, as shown in Figure 1 below. Do your best to approximate lines with characters
such as ‘|’ or ‘-‘ .

SAMPLE RUN :

****************************************************
* Welcome to KT14303 Programming Principles *
* Faculty of Computing and Informatics *
* Universiti Malaysia Sabah! *
****************************************************

Figure 1: sample – basic info

Practice 4: Modify Practice 3 (Estimate 15 minutes to 30 minutes)


Improve practice 3 by include your name, matric no and your personal motto . An example is
shown in Figure 2 below.

SAMPLE RUN :

****************************************************
* Welcome to KT14303 Programming Principles *
* Faculty of Computing and Informatics *
* STUDENT NAME *
* BI21XXXXXX *
* while (! (succeed =try())); *
****************************************************

Figure 2: sample – extended version

*************************** THE END ******************************

You might also like