CARI Infonet

 Forgot password?
 Register

ADVERTISEMENT

12
Return to list New
Author: cayangawak

tolong coding java atau c++....

[Copy link]
Post time 9-5-2010 03:25 PM | Show all posts
salam...leh explain x tntg law beta cmne tp law char tawla
cik su Post at 9-5-2010 12:13


apa smph msrkt ko nak tanya ni?

nak tny taip la elok2 samdol.
Reply

Use magic Report


ADVERTISEMENT


Post time 9-5-2010 04:09 PM | Show all posts
aku pon tak dapat translate bahasa dia pakai..lagi susah dari C++/JAVA/PHP tu..
Reply

Use magic Report

Post time 11-5-2010 12:55 AM | Show all posts
sy nak belajar jugak c++ ni.. hmm {:2_64:}
Reply

Use magic Report

Post time 10-9-2010 01:43 AM | Show all posts
Reply 14# hamster91

rasa mcm pernah kujawab soalan ini tp dimana ya?
nah amik ni hadiah malam raya sbb aku tgh boring2.

  1. #include <iostream>
  2. using namespace std;

  3. void main()
  4. {
  5.         double batu, harga;
  6.         char samdol;

  7.         do {
  8.                 cout<<"Number of miles : ";
  9.                 cin>>batu;

  10.                 if (batu > 100)
  11.                         harga = 25 + ( (batu-100)*0.15 );
  12.                 else
  13.                         harga = batu*0.25;

  14.                 cout<<"total price : RM "<<harga<<endl;
  15.                 cout<<"want continue or not (y/n) : ";
  16.                 cin>>samdol;
  17.         }

  18.         while (samdol == 'y');

  19. }
Copy the Code
Reply

Use magic Report

Post time 14-9-2010 07:34 PM | Show all posts
tgh borink2.

  1. #include <iostream>
  2. using namespace std;
  3. const int penanda = 100;

  4. double kira(int batua)
  5. {
  6.         double harga;

  7.         if (batua > penanda)
  8.                 harga = 25 + ( (batua-penanda)*0.15 );
  9.         else
  10.                 harga = batua*0.25;

  11.         return harga;
  12. }

  13. void main()
  14. {
  15.         int batu;
  16.         char samdol;

  17.         for(;;) {
  18.                 cout<<"Number of miles : ";
  19.                 cin>>batu;

  20.                 cout<<"total price : RM "<<kira(batu)<<endl;

  21.                 cout<<"want continue or not (y/n) : ";
  22.                 cin>>samdol;

  23.                 if (samdol=='n')
  24.                         break;
  25.                
  26.         }
  27. }
Copy the Code
Reply

Use magic Report

Post time 14-9-2010 11:32 PM | Show all posts
boring2

  1. #include <iostream>
  2. using namespace std;

  3. class jantina {
  4. private:
  5.         char janti;
  6.         char* jejans;
  7. public:
  8.         char* input();
  9.         void display();
  10. };

  11. char* jantina::input()
  12. {
  13.         cout<<"Masukkan jantina (m/f) : ";
  14.         cin>>janti;       
  15.        
  16.         if (janti=='m')
  17.                 jejans = "Male";

  18.         else if (janti=='f')
  19.                 jejans = "Female";

  20.         else
  21.                 jejans = "Not in database";

  22.         return jejans;
  23. }

  24. void jantina::display() { cout<<jejans<<endl; }

  25. void main()
  26. {
  27.         jantina kau;
  28.         kau.input();
  29.         kau.display();
  30. }
Copy the Code
Reply

Use magic Report

Follow Us
Post time 15-9-2010 12:03 AM | Show all posts
boring2 lg

  1. #include <iostream>
  2. using namespace std;

  3. class perjalanan {
  4. private:
  5.         double batu;
  6.         double rm;
  7. public:
  8.         double kirala();
  9. };

  10. double perjalanan::kirala()
  11. {
  12.         cout<<"Number of miles : ";
  13.         cin>>batu;

  14.         if (batu>100)
  15.                 rm = 25 + ( (batu-100)*0.15 );
  16.         else
  17.                 rm = batu*0.25;

  18.         return rm;
  19. }

  20. void main()
  21. {
  22.         char loop;
  23.         perjalanan* aku;
  24.         aku = new perjalanan;

  25.         for(;;) {
  26.         cout<<"total price : RM "<<aku->kirala();  

  27.         cout<<"\nwant continue or not (y/n) : ";
  28.         cin>>loop;

  29.         if (loop!='y')
  30.             break;         
  31.     }
  32. }
Copy the Code
Reply

Use magic Report

12
Return to list New
You have to log in before you can reply Login | Register

Points Rules

 

ADVERTISEMENT



 

ADVERTISEMENT


 


ADVERTISEMENT
Follow Us

ADVERTISEMENT


Mobile|Archiver|Mobile*default|About Us|CARI Infonet

7-5-2024 04:11 AM GMT+8 , Processed in 0.060816 second(s), 29 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

Quick Reply To Top Return to the list