Wednesday, October 19, 2011

updated. 4.1

#include
#include
using namespace std;

int main()
{
    int num,negativeCounter=0,positiveCounter=0,total=0,average = 0;
   
    cout<<"Enter an integer value,the program exits if the input is 0: "<
    cin>>num;

    int sum = 0 ;
      
    while ( num !=0)
    {
   
          sum += num ;
          if (num<0)
             negativeCounter++;
         
          else if (num>0)
               positiveCounter++;
              
          else
               cout<<" "<
         
          total=total+num;
          average=static_cast(total)/(positiveCounter+negativeCounter);
          cin>>num;
         
    }
              
          cout<<" The number of positives is "<<
          cout<<" The number of negatives is "<<
          cout<<" The total is: "<<
          cout<<" The average is : "<<
              
          system ("pause");
          return 0;
              
}

.: Syukran, moga sama2 menambah ilmu =] :.

this is th draft for 4.1 programming exercise chapter 4. maybe need some improvement,

#include
#include
using namespace std;

int main()
{
    int num,negativeCounter=0,positiveCounter=0,total=0,average = 0;
   
    cout<<"Enter an integer value,the program exits if the input is 0: "<
    cin>>num;
   
    while ( num !=0)
    {
          if (num<0)
             negativeCounter++;
         
          else if (num>0)
               positiveCounter++;
              
          else
               cout<<" "<
         
          total=total+num;
          average=static_cast(total)/(positiveCounter*negativeCounter);
          cin>>num;
         
    }
              
          cout<<"The number of positives is"<<
          cout<<"The number of negatives is"<<
          cout<<"The total is:"<<
          cout<<"The average is :"<<
              
               system ("pause");
               return 0;
              
}

.: Syukran, moga sama2 menambah ilmu =] :.

4.9

this is for programming exercise 4.9 

testing the code.

#include
using namespace std;

int main()
{
    int score = 0, highestScore = 0,lowestScore=100,student;
    cout<<"Enter number of student:";
    cin>>student;
   
    for(int i=0;i
    {
            cout<<"Enter score:";
            cin>>score;
              
               if (score> highestScore)
               highestScore=score;
              
               if (score< lowestScore)
               lowestScore=score;
              
    }
   
    cout<<"Highest score"<<
    cout<<"Lowest score"<<
   
    system("pause");
    return 0;
   
}
              
   

.: Syukran, moga sama2 menambah ilmu =] :.

Thursday, October 13, 2011

ya Allah, 

hanya pada Mu aku meletakkan keyakinan ku..
dan pada Mu juga aku meletakkan kesabaranku...

dan hanya Engkau Maha Tahu segala isi hatiku..

maka tenangkan lah , 

atas segala yang membebani ku..

sungguh, aku hanya lah hambaMu yang lemah..
lagi x berdaya..






.: Syukran, moga sama2 menambah ilmu =] :.

new life begins..

Salam aleykum , salam sejahtera.. dan salam satu ummat..

alhamdulillah.. alhamdulillah segala puji kpd Allah, Tuhan yang Menciptakan seluruh alam.. yang memberi peluang kpd kita menghela nafas yang satu.. dan masih lagi di alam y sementara ini, utk berbuat bekal ke hari sana..

kaifa haluka ? kaifahaluki???

cik cactus alhamdulillah sihat2 sahaja.. 

genap sebulan di dunia USM, subhanallah. begitu berbeda dunia matrikulasi dan dunia universiti rupanya :) 

taking a life as a computer science student, mmg begitu challenging rupanya. :D tapi..

manusia ini adalah sebaik2 kejadian y Allah cipta.. 

manusia fleksible, 

dalam erti kata lain, kita mampu buat apa yang dirasakan impossible. 

nak? atau x nak  sahaja :) 

subject2 yang diambil di sini termasuk lah programming, computer organization .. & logic and application. this is the three core courses we've taken for this sem. 

seronok? 

seronok juga.. jika niat di betulkan atas jalan Nya.. insyaAllah jalan kehidupan tu akan jadi lebih exciting! hehe.. 

tahun pertama.. masih setahun jagung. :D masih byk harus ditimba .

sahabat2 semua pn best setakat ini.. :) 








hope i will improve myself soon.


salam terbaik ummat :)


.: Syukran, moga sama2 menambah ilmu =] :.