CC102 FUNDAMENTALS OF PROGRAMMING PROJECT Felix
CC102 FUNDAMENTALS OF PROGRAMMING PROJECT Felix
PROGRAMMING
LABORATORY
EXERCISES
COMPILATION
JUZZY D. NICANOR
BSIT-1
Schedule: TTH-2:30PM-5:00PM
LABORATORY EXERCISE 01
SOURCE CODE
#include <iostream>
using namespace std;
int main()
{
cout << "HELLO WORLD" << endl;
return 0;
}
PROGRAM OUTPUT
LABORATORY EXERCISE 02
SOURCE CODE
#include <iostream>
using namespace std;
int main ()
{
string name;
cout << "ENTER YOUR NAME: ";
getline (cin, name);
cout << "YOUR COMPLETE NAME IS: " << name << endl;
return 0;
}
PROGRAM OUTPUT
LABORATORY EXERCISE 03
SOURCE CODE
#include <iostream>
using namespace std;
int main()
{
string fname;
string lname;
return 0;
}
PROGRAM OUTPUT
LABORATORY EXERCISE 04
SOURCE CODE
#include <iostream>
using namespace std;
int main()
{
string name;
int DaysPresent;
int DailyRate= 368.00;
return 0;
}
PROGRAM OUTPUT
LABORATORY
EXERCISE 05
SOURCE CODE
#include <iostream>
using namespace std;
int main()
{
float totalBill;
float liquorCharge;
float tipPercentage;
cout << "TOTAL BILL WITHOUT LIQUOR CHARGE:" << totalBill - liquorCharge << endl;
cout << "DISPLAY TIP: " << (totalBill - liquorCharge) * ((tipPercentage) / 100)<< endl;
return 0;
}
PROGRAM OUTPUT
LABORATORY EXERCISE 06
SOURCE CODE
#include <iostream>
using namespace std;
int main()
{
int num1, num2;
cout << "Enter first number:";
cin >> num1;
cout << "Enter second number:" ;
cin >> num2;
}else {
cout << "Both numbers are equal." ;
}
return 0;
}
PROGRAM OUTPUT
LABORATORY EXERCISE 07
SOURCE CODE
#include <iostream>
using namespace std;
int main()
{
double annualSales, bonus;
return 0;
}
PROGRAM OUTPUT
LABORATORY EXERCISE 08
SOURCE CODE
#include <iostream>
using namespace std;
int main()
{
int age = 18;
char reg;
if (reg == 'Y')
cout << "YOU CAN VOTE";
else
cout << "YOU MUST REGISTER BEFORE YOU CAN VOTE";
}else {
cout << "YOU ARE TOO YOUNG TO VOTE";
}
return 0;
}
PROGRAM OUTPUT
LABORATORY EXERCISE 09
SOURCE CODE
#include <iostream>
using namespace std;
int main(){
char productID;
switch (productID) {
case '1':
cout << "Price:P10.00" << endl;
break;
case '2':
cout << "Price:P20.00" << endl;
break;
case '3':
cout <<"Price:P30.00" << endl;
break;
case'4':
cout <<"Price:40.00" <<endl;
break;
default:
cout <<"Invalid Product ID:" << endl;
}
return 0;
}
PROGRAM OUTPUT
LABORATORY EXERCISE 10
SOURCE CODE
#include <iostream>
#include<math.h>
using namespace std;
int main()
{
double a,b,c,sum;
sum=a + b + c;
cout <<"answer all basic math: ";
cout << sum;
sum=a + b + c;
return 0;
}
PROGRAM OUTPUT