Lab Assignment Programming
Lab Assignment Programming
CSC 404
LAB ASSIGNMENT 1
PROGRAMMING II
NAME:
STUDENT ID:
LAB ASSIGNMENT PROGRAMMING
#include <iostream>
return area;
return area;
int main() {
int shape;
// User Input
if(shape == 1){
cout << "Area of the triangle: " << triangle_area << endl;
cout << "Area of the square: " << square_area << endl;
else
return 0;
}
Name: Elissa Yasmeen Binti Muhamad Yusni
Sid#: 2022455318
Course: CSC404
Group#: CS2552B
Assign#:
Program Description:
#include <iostream>
#include <iomanip>
void DisplayPackage();
int packageNum;
float totalPrice;
DisplayPackage();
void DisplayPackage(){
cout << "Package Details offered by Syarikat Percutian Era Sdn Bhd:" << endl;
switch (packageNum){
case 1:
pricePerChild = premiumChild;
pricePerAdult = premiumAdult;
break;
case 2:
pricePerChild = ecoChild;
pricePerAdult = ecoAdult;
break;
case 3:
pricePerChild = budgetChild;
pricePerAdult = budgetAdult;
break;
default:
return 0;
return totalPrice;
}
#include <iostream>
int bestRound = 0;
maxScore = score[i];
bestRound = i;
return bestRound;
float sum = 0;
sum += score[i];
return avg;
cout << "Group A is the champion of the E-Games competition." << endl;
cout << "Group B is the champion of the E-Games competition." << endl;
cout << "Group C is the champion of the E-Games competition." << endl;
} else {
cout << "There is a tie for the champion of the E-Games competition." << endl;
int main() {
cout << "Best round for Group A: " << bestRoundA + 1 << endl;
cout << "Best round for Group B: " << bestRoundB + 1 << endl;
cout << "Best round for Group C: " << bestRoundC + 1 << endl;
return 0;