Sunday, February 27, 2011

Assignment 1

haih~~~~
atas sebab-sebab tertentu yg  agak payah untuk dijelaskan....
terpaksa la post assignment yang miss bagi dgn meng-sharing file tersebut....
nanti aq post sepenuhnya bila da kewangan aq stabil....or plg lmbt ari isnin yg terdekat
[EDIT]
Da ble post

1.    Write correct C++ syntax & for each statement below:

a) Initializing variable Pi with the value 3.14 (constant)

    Const float Pi=3.142;

b) Declare a variable named Parameter with double data type (declare variable)

      Double parameter

c) Give instruction that allowed user to input data (input)
   
    Cout<<”please insert your score”;
  
d) Input number of computer using variable (input assign to variable value)

    //variable nc=number of computer
    Int nc;
    //input
    Cout<<”Insert number of computer:”;
    Cin>>nc;


1.    Solve the question below. Show the working.

a) 5 * 2 % 3 + 25 / 5
    [(5*2)%3] + [25/5]
    [(10)%3] + [5]
    [1] + [5]
    6

b) a = 5, b = 6

    !((a < 3) && (a == 3) || (b > 9))
    NOT[(5<3:0)&&(5==3:0) || (6>9:0)]
    NOT[(0&&0) || 0]
    NOT[0 || 0]
    NOT[0]
    1

2.    Identify syntax errors in the following program.

#include<iostream.h>
main()
{
float allowance = 300.00, salary
, TSalary;

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

TSalary = salary +
allowance;

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

return 0;
}

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

#include <iostream.h>
main()
{
      //declare
      float allowance=500.00,salary=40,tsalary,day;
      //input
      cout<<"please input total days work";
      cin>>day;
      //process
      tsalary = (salary*day)+allowance;
      //output
      cout<<"The total salary for this month is:RM "<<tsalary;
      return 0;
      }

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

#include<iostream.h>
main()
{
//declare variable
float a,b,c,d,e,average;
//input
cout<<”please insert 5 numbers here: \nExample: a,b,c,d,e”<<endl;
cin>>a, b, c, d, e;
//process
average = (a+b+c+d+e)/5;
//output
cout<<”The average is:”<<average;
return 0;
}

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

#include <iostream.h>
main()
{
      //declare
      float b,h,r,w,area,;
      float pi=3.14;
      int selection;
      //out
      cout<<"Please choose you choice"<<endl;
      cout<<"1.Rectangular";
      cout<<"\n2.Triangle";
      cout<<"\n3.Circle"<<endl;
      cin>>selection;
      switch (selection)
      {
             case 1: cout<<"Please input the height"<<endl;
                     cin>>h;
                     cout<<"Please input the width"<<endl;
                     cin>>w;
                     //process
                     area = w*h;
                     cout<<"The area is:"<<area;
                     break;
             case 2: cout<<"Please input the height"<<endl;
                     cin>>h;
                     cout<<"Please input the base"<<endl;
                     cin>>b;
                     //process
                     area = 0.5*b*h;
                     cout<<"The area is:"<<area;
                     break;
             case 3: cout<<"Please input the radius"<<endl;
                     cin>>r;
                     //process
                     area = pi*r*r;
                     cout<<"The area is:"<<area;
                     break;
             default :cout<<"Invalid Selection";
             return 0;
             }
}

Tuesday, February 8, 2011

Weekly Reflection 3

Kali nie kitaorng berjaya bgn pagi dan dpt hadir ke ke kelas....
sampai kelas miss suruh kitaorang download Turbo C++ tp memandangkan lappy aq x ble install aq guna Dev C++ n settle hal aku

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

-Masok latihan dlm Weekly Reflection 3.
-Sume ahli hadir.
-Semua ahli bagi kerjasama dan telah memberikn komitmen yg terbaik.

Weekly reflection credit goes to Ezwanjb

Weekly Reflection 2

Aku x datang plk waktu Weekly Reflection 2 nie....
so aku copy lg skali dari forum and as usual credit goes to Nas[Leader]

-register forum untuk group FOP. web http://lect-ayuni.forumms.net
-mencari 3 perbezaan antara procedural programming , structured programming dan object oriental programming diberi masa selama 45 minit post ke dalam forum web http://lect-ayuni.forumms.net
-belajar chapter 2 c++ programming language
-chapter 2 miss mengajar program layout dan perlu memahami bagi untuk tulis didalam weekly reflection 2
-selain itu masukkan weekly reflection 1 ke dalam forum
-kemudian buat weekly reflection 2 by group . kemudian masukkan wekkly relection 2 ke dalam forum sekali
-masukkan tugasan integer multiply num 1 * num 2(programming) ke dalam forum miss
-2 orang ahli tidak datang , faris dan izwan

Weekly Reflection 1

Aku da ingat sgt weekly reflection 1 nie....nasib baik leader aku ada buat kat forum
Credit to: Nas [Leader]

-Orientasi suai kenal
-rehat 15 minit , breakfast
-pembahagian kumpulan
-pengenalan subjek chapter 1
-belajar tentang algorithm , pseudo code , flowchart
-algorithm > ayat panjang
-pseudo code > bentuk pergerakkan program
-buat weekly reflection
-buat assignment tentang perbezaan antara procedural programming , structured programming and object oriented programming
-buat forum
-zip file
-kena buat blogspot