Pages

This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Sabtu, 16 April 2011

struktur program c(c program structure)

c program structure is as follows: (header file) header file is a form of libraries to call a certain function For example: # include, # include (data dictionary) data dictionary to determine the type function that will be used For example: int x; / * means that the function x is an integer (Numbers rounded) * / float y; / * y is a float means fingsi (Num. real) * / (loss program) all the contents of any agency program here beginning of the body programs are: int main () / * This is the main menu program body * / {/ * this is a function...

Simple Program Using the Type Class(Program Sederhana Menggunakan Jenis Class)

How do you think the Implementation Class In In C + +? In my opinion, the application of a class in C + + really, really helped her special in the simplification of a problem relating to an object. Use of classes to help us in giving a name to an object that it will consist of several classes in an object that we make. Thus the class can be defined as something that has the data (properties) and function (method). And whose name is still...

Kamis, 14 April 2011

Program menampilkan Paket-paket menu makanan

#include void main(){ char ulang; int pilih; do { cout< cout<<"DAFTAR HARGA MENU"< cout< cout<<"1.Paket 1"< cout<<"2.Paket 2"< cout<<"3.Paket 3"< cout< cout<>pilih; switch(pilih){ case1: cout<<"nasi goreng dan teh botol= Rp.5000"; break; case2:cout<<"mie goreng dan es jeruk=Rp.4000"; break; default:cout<<"bakso urat dan air putih=Rp.3500"; } cout< cout<>ulang; } while((ulang==’y'||ulang==’Y'))...

Program C++ Mencari Nilai Rata-Rata Dengan For

Seperti yang kita ketahui bahwa dalam bahasa pemrograman C++ pernyataan For digunakan untuk melakukan perulangan (looping) terhadap satu atau sejumlah pernyataan. Sebagai contoh kita bisa mencari nilai rata-rata yang diinputkan oleh user. Kemudian program akan menampilkan jumlah total serta nilai rata-rata dari nilai yang diinputkan oleh user tersebut. Misalkan kita ingin mencari nilai rata-rata dari 10 nilai yang diinputkan oleh user, maka program C++ nya adalah sebagai berikut :   #include   #include   void main()  ...

Program Perulangan (loop)

#include <cstdlib> #include <iostream> using namespace std; int main(){ int nilai; for(nilai=1;nilai<=10;nilai++) cout<<nilai<<” “<<endl; cout<<endl; system(“PAUSE”); return EXIT_SUCCESS; } - Sintak perulangan : for(inisialisasi;kondisi;kenaikan) pernyataan; - inisialisasi menetapkan variabel kontrol loop ke nilai awal. - kondisi adalah ekspresi yang diuji setiap kali loop berulang. selama kondisi benar (bukan nol) loop terus berjalan. - kenaikan yaitu ungkapan yang menentukan bagaimana variabel...

contoh program menggunakan array dengan C++(Mencari nilai tertinggi, nilai terendah, rata-rata)

#include <iostream.h> #include <stdio.h>#include <conio.h>#include <math.h>void input(int x[],int n){ for (int i=1;i<=n;i++) {cout<<”Masukan Nilai “<<i<<” : “;cin>>x[i];}}void tinggi(int x[],int n){ int max,min; max = x[1]; min = x[1]; for (int i=2;i<=n;i++) { if (max < x[i]) max = x[i]; if (min > x[i]) min = x[i]; } cout<<”\nNilai tertinggi = “<<max<<”\n”; cout<<”Nilai...

program bangun ruang

#include<iostream.h> //#include<string.h> #include<math.h> const float phi = 3.14; class menu {     private:     public: void pilihan() {         cout<<" Menu Bangun : "<<endl;         cout<<"\t 1.Balok"<<endl;         cout<<"\t 2.Kubus"<<endl;        ...