Assignment Csc402
Assignment Csc402
(b)
START
Display "Please enter the length of rectangle in meter: "
Display "Please enter the width of rectangle in meter: "
Display "Please enter the heigth of triangle in meter: "
Read length, width, height
const float PI=3.142
Area_rec = length * width
Area_tri = 0.5 * length * height
radius = width / 2
Area_cir = PI * pow(radius,2)
Area_obj = Area_rec + Area_tri + Area_cir
Display “The area of rectangle is” , Area_rec
Display “The area of triangle is” , Area_tri,
Display “The area of circle is” , Area_cir,
Display “The area of objects is” , Area_obj
END
(c)
//NAME : AIN NUR BALQIS BINTI HAMIZUL
//DATE : 2/11/2023
//PROGRAM TITLE : Calculate area of the objects
#include <iostream>
using namespace std;
int main ()
{
//Declare in data type double
double length,width,heigth,radius,area_rec,area_tri,area_cir,area_obj;
//Initiallize constant in data type float
const float PI = 3.142;
return 0;
}
(a)
Input Process Output
(b)
(c)
//NAME : AIN NUR BALQIS BINTI HAMIZUL
//DATE : 2/11/2023
//PROGRAM TITLE : Covert from Malaysian Ringgit (RM) to japanese Yen and to
Jordanian Dinar
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
//Declare in data type double
double RM,Yen,Dinar;
return 0;
}
(a)
Input Process Output
(b)
START
Display “Enter a number”
Read num
IF num > 0 THEN
Display “positive”
ELSE IF num < 0 THEN
Display “negative”
ELSE
Display “zero”
END IF
END IF
END
Input Process Output
minute Convert the entered number of minutes into Display hour and min
hours and minutes.
hour = minute / 60
min = minute % 60
(a)
(b)
START
Display "Enter numeric value for minute : "
Read minute
hour = minute / 60
min = minute % 60
Display "The answer is " , hour , “hours” , min , “minutes”
END
(c)
//NAME : AIN NUR BALQIS BINTI HAMIZUL
//DATE : 2/11/2023
//PROGRAM TITLE : Convert entered number of minutes into hour and minute
#include <iostream>
using namespace std;
int main()
{
int minute,min,hour; //Declare in data type double
return 0;
}