Navigation
 Index
 Memberlist
 Profile
 FAQ
 Search
Latest topics
» Perkhidmatan Kereta Sewa Shah Alam
Wed Sep 09, 2015 2:48 am by sksportcar

» Homestay Di Kota Bharu
Sun Jan 25, 2015 10:52 pm by sksportcar

» Kereta Sewa Shah Alam
Tue Aug 05, 2014 8:54 am by sksportcar

» Bahasa Jepun: Ayat Seharian,Hari,Haribulan & Nombor
Mon Sep 23, 2013 8:43 pm by foxfoxer

» Tips nak hapuskan virus secara manual [On updates]
Tue Mar 19, 2013 8:38 am by Optitech

» Teknik defense dari virus and spyware [Auto]
Thu Jul 21, 2011 2:53 am by Optitech

» Virus shortcut kat pendrive
Thu Jul 21, 2011 12:27 am by Optitech

» Admin Kembali dengan Menyengat
Wed Jul 20, 2011 1:59 pm by Optitech

» Xcode Magazine - Penulisan daripada hacker
Wed Jul 20, 2011 12:45 pm by Optitech


Assignment 3.3 dan 3.4

View previous topic View next topic Go down

Assignment 3.3 dan 3.4

Post  Optitech on Sat Feb 06, 2010 5:29 pm

Assalamualaikum dan salam sejahtera semua..
Apa khabar? kekeke..
Semoga sihat2 jer kay.
Baru2 ni aku ada usha2 assignment TKE. Macam gampang jugak soklan dia tu. Tpai berjaya gak dijawab.

Berikut merupakan kod dan output bagi assignment tersebut:


ASSIGNMENT 3.3

------------
Question 1:
------------

Code:

//Program Miles prints miles in kilometers

#include
using namespace std;

float kilometers(int);

int main()
{
    cout<<
    cout<<"One mile is "<
        << " kilometers."<
    cout<<"Ten miles is "<
        << " kilometers."<
    cout<<"One hundred miles is "<
        << " kilometers."<

    return 0;
}

float kilometers (int miles)
{
    const KILO = 1.609;
    return KILO * float (miles);
}


OUTPUT:





-----------
Question 2
-----------



Code:

// Program Function demonstrates the use of library and
// user defined functions

#include
#include
using namespace std;

float answer (float, float, float);

int main()
{
    cout<<

    cout<
    return 0;
}

//Do you recognize this formula?
float answer (float one, float two, float three)
{
    return (( -two  sqrt (pow (two, three)
              -(4.0 * one * three))) / (2.0*one));
}


Output











ASSIGNMENT 3.4

------------
Question 1:
------------



Code:


// Program StrDemo demonstrate string functions.

#include
#include
using namespace std;

const string TITLE = "How much was the doggie in the windows?";
const string CAT = "cat";

int main()
{
    cout<< TITLE.length() <
    cout<< TITLE.find ("the") <
    cout<< TITLE.find (CAT) <
    cout<< TITLE.substr (17, 6) <
    cout<< TITLE.substr (17, 23) <
    cout<< TITLE.substr (17, 23).length() << endl;
    return 0;
}


Output






------------
Question 2:
------------

Code:

//Program String applies string functions.

#include
#include
using namespace std;

const string FIRST_NAME = "Muhammad Haiqal";
const string LAST_NAME = "Mohd Jamaluddin";

int main()


{

cout<< FIRST_NAME<<" "<< LAST_NAME<< endl;
cout<< FIRST_NAME.length()  LAST_NAME.length()<< endl;

   return 0;
}


Output





any problem, you can reach me by PM me.
I glad to teach you about programming. Smile

_________________
|----------------------------------------------------|




EXCUSE IS THE DUMBEST WAY TO ESCAPE

MAKLUMAN: Worksheet/Assignment Download Section hanya untuk pengguna berdaftar. Sila daftar untuk melakukan 'download'. Lepas dah click link, tekan kat perkataan "Skip Ad" bahagian atas belah kanan sekali. Pastu baru leh download.
Harap Maklum.

Optitech

Posts : 518
Join date : 2010-01-01
Age : 24
Location : ProxyFireZ

http://sembangseposen.blogspot.com

Back to top Go down

Re: Assignment 3.3 dan 3.4

Post  foronum on Mon Feb 08, 2010 11:35 am

oit, kitorang tak belaja lagi la menatang ni. 6

foronum

Posts : 281
Join date : 2010-01-03
Location : tempat paling best !

Back to top Go down

Re: Assignment 3.3 dan 3.4

Post  Optitech on Mon Feb 08, 2010 1:37 pm

assignment ni aku ambik ngan tke la oit.
huhu..

ko kelas lain kot..

_________________
|----------------------------------------------------|




EXCUSE IS THE DUMBEST WAY TO ESCAPE

MAKLUMAN: Worksheet/Assignment Download Section hanya untuk pengguna berdaftar. Sila daftar untuk melakukan 'download'. Lepas dah click link, tekan kat perkataan "Skip Ad" bahagian atas belah kanan sekali. Pastu baru leh download.
Harap Maklum.

Optitech

Posts : 518
Join date : 2010-01-01
Age : 24
Location : ProxyFireZ

http://sembangseposen.blogspot.com

Back to top Go down

Re: Assignment 3.3 dan 3.4

Post  Admin on Tue Feb 09, 2010 4:58 am

ko ambik ngan sapa assignment tu?
nanti ko send softcopy dia kat email aku..au pun nak try wat gak ar.

Admin
Admin

Posts : 108
Join date : 2010-01-01
Age : 24
Location : Di dalam mindaku

http://myjmti.findtalk.biz

Back to top Go down

Re: Assignment 3.3 dan 3.4

Post  Sponsored content Today at 9:06 am


Sponsored content


Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum