Wednesday, February 27, 2013


question1
uk26465
nur hidayah khamis

question2

#include <cstdlib>
#include <iostream>
// MATRIK : UK26465
// NAME : NUR HIDAYAH BINTI KHAMIS
// A program to calculate time boat sail
using namespace std;

int main(int argc, char *argv[])
{
    string matric = "UK26465"; 
    // Give your matric & name
                string name = "NUR HIDAYAH KHAMIS";
                int speed, distance, time;
          cout << "My Matric no : " << "UK26465" << endl;
          cout << "My Name :  " << "NUR HIDAYAH KHAMIS" << endl;
                // pamir arahan untuk mendapatkan data input
                cout <<"Type two numbers: speed & distance & press <Enter> \n";
                // baca nilai distance dan speed
          cin >> distance>> speed;  /* baca data input */
                // kira nilai time, iaitu distance/speed
          time = distance / speed ;
                // cetak nilai time
          cout << "time is :  " << time<< endl << endl;
    system("PAUSE");
    return EXIT_SUCCESS;
}

c) matric no: uk26465
   my name: nur hidayah khamis
  type two number: speed & distance & press <enter>
  500
  6.7
  time is : 74.62

No comments:

Post a Comment

Search This Blog