[go: up one dir, main page]

0% found this document useful (0 votes)
259 views7 pages

Question Laboratory Task 1 Sesi120212022

The document is a lab assessment for a programming fundamentals course. It contains instructions for two programming tasks. The first task involves developing a program to calculate the total payment for a travel package with a 30% discount rate of RM250 per person. The second task identifies five errors in a sample time conversion program and provides the corrected code. It asks the student to debug, compile and run the corrected program.

Uploaded by

Miza Oh Miza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
259 views7 pages

Question Laboratory Task 1 Sesi120212022

The document is a lab assessment for a programming fundamentals course. It contains instructions for two programming tasks. The first task involves developing a program to calculate the total payment for a travel package with a 30% discount rate of RM250 per person. The second task identifies five errors in a sample time conversion program and provides the corrected code. It asks the student to debug, compile and run the corrected program.

Uploaded by

Miza Oh Miza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

DFC20113 / Laboratory Task 1/Sesi120212022/01

CLO2P (30)

TOTAL /30

DEPARTMENT OF INFORMATION AND COMMUNICATION


TECHNOLOGY COURSEWORK ASSESSMENT (Session: SESI
1 2021/2022)

Name :NURUL ASMIZA BINTI TALIB Reg. No. :21DDT20F2006

Code & Course :DFC20113 PROGRAMMING Class :DDT2A


FUNDAMENTALS
Lecturer(s) :PUAN NORZIMAH CHE Date :13/10/2021
HASSAN
Lab. Task(s) No. : 1 / 2 [CLO: CLO2(P2)] Duration : 2 Hours

Instruction: Answer ALL the questions below.

1. You have been hired by Pearl Travel&Tours Sdn. Bhd as a programmer. Your task is to
develop a program that is able to count the total payment for the travel package. The
package rate is RM250.00/person. In conjunction with the Langkawi tourism bubble
initiative, this package gives 30% discount. The expected output is shown in Figure 1
below. [15 Marks]

Figure 1
DFC20113 / Laboratory Task 1/Sesi120212022/01

Answer for program

Example answer using the program;


DFC20113 / Laboratory Task 1/Sesi120212022/01

2. Identify FIVE (5) errors in the following programs and write the correct answers.
Debug, compile and run a program using C++. [P2] [15 Marks]

#include <iostream>
using namespace std;

int main ()
{
cout << "Welcome to time converter\n";
cout << "*************************";
cout << "\nPlease enter a time in hour:"
cin << timeInMinutes;
cout<<"You just key in: "<<timeInHour <<" hours\n";
timeInMinutes=timeInHour*60;
cin << timeInHour<<" hours = "<<timeInMinutes<<" minutes.\n";
return 0;
}

Five errors

~no variables(describe variable)


~cout<<”\nPlease enter a time in hour:” no(;)

~cin<<timeInMinutes; wrong symbol must add (>>) and change to timeInHour

~cin << timeInHour<<" hours = "<<timeInMinutes<<" minutes.\n";


Must be cout

Right program with no error;


DFC20113 / Laboratory Task 1/Sesi120212022/01

The output;
DFC20113 / Laboratory Task 1/Sesi120212022/01

End of Question

RUBRIC

CLO Criteria Exceptional Acceptable Amateur Unsatisfactory Unsolved Mark


(5) (4) (3) (2) (1)
Program The C++ More than More than Less than No proper
program is 75% 50% 50% program program.
excellently program is program is is correct.
correct. correct. correct.
Output Output Output More than Less than Output does
meets or meets 75% output 50% output not meet
CLO2P exceeds the requirement meets meet requirement
requirement requirement requirement
Comment Clearly write Write more Write more Write less Write less
comments than 70% than 50% than 20% than 10%
of the C++ comments comments comments of comments
program of the C++ of the C++ the C++ of the C++
structure. program program program program
structure. structure. structure. structure.
Total Mark /30
DFC20113 / Laboratory Task 1/Sesi120212022/01
Rubric for question 1 and question

You might also like