Assignment 1 Csc404 (Syafiqah Batrisyia)
Assignment 1 Csc404 (Syafiqah Batrisyia)
PROGRAMMING 2
ASSIGNMENT 1
Algorithm:
/*
Sid# : 2022821848
Course : CSC404
Group# : RCSCS2552A
*/
#include <iostream>
#include <cmath>
return areaT;
double areaS = x * y;
return areaS;
}
int main()
float x, y;
int shape;
cin>> shape;
cin>> x;
cin>> y;
return 0;
}
C++ Program:
Output:
Sample 1
Sample 2
TASK 2
Algorithm:
/*
Sid# : 2022821848
Course : CSC404
Group# : RCSCS2552A
*/
#include<iostream>
void DisplayPackage();
void DisplayPackage()
cout<<"--------------------------------------"<<endl;
cout<<"|------------------------------------|"<<endl;
cout<<"| ----------------------|"<<endl;
cout<<"|------------------------------------|"<<endl;
cout<<"| ----------------------|"<<endl;
cout<<"|------------------------------------|"<<endl;
cout<<"--------------------------------------"<<endl;
float tpriceKid,tpriceAdult,tprice;
if(package == 1)
tpriceKid = k * 59.60 ;
tpriceAdult = a * 78.60 ;
if(k + a > 5)
else
tprice;
else if(package == 2)
tpriceKid = k * 48.30 ;
tpriceAdult = a * 62.50 ;
if(k + a > 5)
else
tprice;
else if(package == 3)
tpriceKid = k * 39.00 ;
tpriceAdult = a * 55.00 ;
if(k + a > 5)
else
tprice;
int main()
int packageType , k , a;
cout<<"Welcome!"<<endl;
cout<<"These are the details of package offered by Syarikat Percutian Era Sdn Bhd"<<endl;
DisplayPackage();
cout<<"You can choose what package type that do you want ?"<<endl;
cin>>packageType;
cout<<endl;
cout<<"With same package, how many kid and adult in your group ?"<<endl;
cout<<"Kid : ";
cin>>k;
cout<<"Adult : ";
cin>>a;
cout<<endl;
C++ Program:
Output:
Sample 1
Sample 2