Question Laboratory Task 1 Sesi120212022
Question Laboratory Task 1 Sesi120212022
CLO2P (30)
TOTAL /30
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
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
The output;
DFC20113 / Laboratory Task 1/Sesi120212022/01
End of Question
RUBRIC