Powered By Blogger

Monday, February 28, 2011

Weekly Reflection 4

1.masok kelas jew miss ayuni memberi rehat.
2.kembali kami ke kelas miss menerangkan maksud simbol2 operators and acepertion.
3.melalukan exercise and or not.
4.kami belajar tentang if....else @ switch...case.
5.miss memberi latihan if..else dan switch...case.
6.memberi assigement kepada student.
7.membuat weekly reflection 4.
8.balik 

Weekly Reflection 3

1)Breakfast 9am-10am.
2)Download TURBO C++ 32bit di forum.
3)Tutorials buat blogspot. 
4)Miss bagi latihan Coding C++ :
   a. Calculate 3 numbers with using the formula below :-
      calculate = (num1*num2)-num3+(num2/num1)

5)Masok latihan dlm Weekly Reflection 3. 

Weekly Reflection 2

1)pelajar diminta mendaftar di forum lecture ayuni.
2)kami di minta untuk memberi username forum dan URL blog.
3)kerja rumah tentang perbezaan antara structured programming,procedural programming,dan object oriental programming.
4)bermulanya sesi pembelajaran chapter 2 tentang c++ program
5)penerangan tentang c++ language dan c++ program
6)penerangan tentang program layout serta variable,input dan output.
7)kami diajar untuk memindahkan flowchart kepada c++ program.
8)melakukan grouping exercise.
9)kami diminta melakukan flowchart dan program c++.bagaimana untuk menukar kan celcius kepada farenheidt.
10)pelajar diminta membuat weekly reflection 2..... 
tamat suda... Very Happy Laughing 

Weekly Reflection 1


*kami dibahagikan kpd beberapa kumpulan.
*FORUM:bincang pendapat masing-masing
*weekly reflection menerangkan apa yg kita buat dlm masa 4 jam.
*zip file diberi 5 markah(4 assignment)tak guna paper.
*buat blog samada blogspot.com/wordpress(10)
*midterm 10 mark
*final 40 mark
*URL 
add:uttp://www.facebook.com
*sesi kenalan
*kita belajar chapter 1:algorithm
:psedocode
:flowchart
miss meyuruh setiap kumpulan mesti selesai & tulis di whiteboard,soalan yg miss bagi.

Exercise(answer)


Answer.



Question 1
(a) Variable Name =
      Float Pi = 3.14;
(b) double parameter;
(c) Declare
      Int data;
      Cout<<”insertdata=”; Cin>>data;
(d) cin>>num;


Question 2
(a) (5*2)%3+25/5
      (10%3)+25/5
       1+(25/5)
       1+5
        =6

(b)! ((5>3) && (5==3) II (6>9))
     [(( 0 ) && (0)] II(0))
     (0) (0)
     !(0) !(0)
     =1

Question 3
#Include<iostream.h>
Main ()
{
Float allwance=300.00,salary,Tsalary;
Salary;
Cout<<”Inputsalary=”; Cin>>salary;
Tsalaray=salary+allowance;
Cout<<”totalsalaryis=<<tsalary;

Return0;
}


Question 4
#include
main()
{
float dpayment, tpayment ;
cout<<"Enter your daily payment=";
cin>>dpayment;
tpayment=dpayment*22;
cout<<"Your salary="<<>
return 0;
}

















Question 5
#include

Main()
{
Int num1, num2, num3, num4, num5, avg;
Cout<<”Enter number 1:”;
Cin>>num1;
Cout<<”Enter number 2:”; 
Cin>>num2;
Cout<<”Enter number 3:”; 
Cin>>num3;
Cout<<”Enter number 4:”; 
Cin>>num4;
Cout<<”Enter number 5:”; 
Cin>>num5;
avg= (num1+num2+num3+num4+num5)/5
Cout<<”Total average=”<<>
Return 0;
}




Question 6
Rectangular 
#include

Main()
{
Float height, width, area;
Cout<<”Enter your height=”;
Cin>>height;
Cout<<”Enter your width=”;
Cin>>width;
Area= h*w;
Cout<<”Total of area=”<<area;< em=""></area;<>
Return 0;
}












Triangle
#include

main()
{
float base, height, area;
cout<<"Enter triangle base=";
cin>>base;
cout<<"Enter triangle height=";
cin>>height;
area= base*height*0.5;
cout<<"Total area of triangle="<<>
return 0;
}


Circle
#include

main()
{
float radius ,pi=3.14, area;
cout<<"Enter radius of circle=";
cin>> radius;
area= radius*radius*pi ;
cout<<"Total area of circle="<<>
return 0;
}




Exercise

Question
1. Write correct C++ syntax & for each statement below:
a) Initializing variable Pi with the value 3.14 (constant)
b) Declare a variable named Parameter with double data type (declare variable)
c) Give instruction that allowed user to input data (input)
d) Input number of computer using variable (input assign to variable value)

2. Solve the question below. Show the working.
a) 5 * 2 % 3 + 25 / 5
b) a = 5, b = 6
!((a < 3) && (a == 3) || (b > 9))

3. Identify syntax errors in the following program.

include
main()
{
float allowance = 300.00, salary;

cout<<"Input Salary = ";
cin>>salary;

TSalary = salary + Allowance;

cout<<"Salary is= "<< salary;
}

4. Write a program that will calculate the monthly salary for an employee that where Saturday and Sunday considered as non-working days.

5. Write a program that calculates the average of 5 numbers that can be input by user.

6. Write a program that will calculate the area of rectangular, triangle and circle.