Menu Program Periklanan Media Cetak
Pada tampilan menu awalnya saya memberikan 3 pilihan yaitu :1. Jadwal Iklan yang Terbit Pada Hari Ini
Pada point pertama ini disana saya menampilkan sebuah pilihan yang berisikan jadwal iklan yang terbit pada hari itu.2. Pendaftaran Iklan
Pada point kedua ini pendaftaran iklan disini untuk memasukkan data suatu perusahanna yang ingin menerbitkan sebuah iklan, disana juga terdapat langsung perhitungan cepat yang didalamnya terdapat langsung harga iklan tersebut setelah dimasukkan data dan discount.3. Arsip Iklan
Pada point ini terakhir bertujuan menampilkan jadwal-jadwal iklan yang telah terbitDengan pembuatan program periklanan ini diharapkan kepada sasaran dari tujuan pembuatan prgram ini dapat meminimalkan penggunaan kertas yang selama ini dalam dalam bidang periklan masih banyaknya perusahaan menggunakan kertas sebagai arsip-arsipnya.
Program Periklanan Media Cetak Menggunakan Bahasa Pemrograman C++
Program ini di buat oleh Budi Satria Nugroho Add Juga Akun Facebooknya di Budi SatriaBaik langsung aja praktekin programnya di aplikasi Dev sobat.
1. Syntax Program
#include <iostream> //preprosesssor dasar pada pemograman C++ #include <stdio.h> //berfungsi membaca karakter berupa spasi #include <iomanip> //berfungsi mengatur lebar #include <conio.h> //berfungsi sbg mengatur baris dan kolom serta meghapus screen #include <string.h> //preprosesor yg berfungsi menjalankan fungsi strcpy/strcmp #include <time.h> //preprosesor yg berfungsi untuk tulisan berjalan #include <windows.h> //preprosesor yg berfungsi sbg converted aplikasi Turbo C++ ke Dev++ using namespace std; //syntax converted aplikasi Turbo C++ ke Dev++ void gotoxy(int x,int y){ COORD coord; coord.X = x; coord.Y = y; SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),coord); } int delay(unsigned int mseconds) //syntax yang berfungsi dalaam menampilakn tulisan berjalan { clock_t goal=mseconds+clock(); while(goal>clock()); } int main(int argc, char** argv) { //merupakan fungsi main int m,a,b,n,o,x,z,v=1,g=1,f; //tipe data integer string hari [100]={"","SENIN","SELASA","RABU","KAMIS","JUMAT","SABTU","MINGGU","SENIN","SELASA","RABU","KAMIS","JUMAT","SABTU","MINGGU" ,"SENIN","SELASA","RABU","KAMIS","JUMAT","SABTU","MINGGU","SENIN","SELASA","RABU","KAMIS","JUMAT","SABTU","MINGGU","SENIN","SELASA","RABU","KAMIS"}; string np2 [100]={"","PT. Tracker","PT. Jaya Makmur","L I B U R","PT. Dell","PT. King","L I B U R","PT. Ghost" ,"PT. Tracker","PT. Abal-Abal","L I B U R","PT. Dell","PT. King","L I B U R","PT. Ghost","PT. Dell" ,"PT. Jaya Makmur","L I B U R","PT. Dell","PT. King","L I B U R","PT. King","L I B U R","PT. Ghost" ,"L I B U R","PT. Jaya Makmur","PT. Abal-Abal","PT. Dell","PT. King","L I B U R","PT. Ghost","PT. Dell","PT. Honda Reptol"}; string hari2 [100]={"","KAMIS","JUMAT","SABTU","MINGGU","SENIN","SELASA","RABU","KAMIS","JUMAT","SABTU","MINGGU","SENIN","SELASA","RABU" ,"KAMIS","JUMAT","SABTU","MINGGU","SENIN","SELASA","RABU","KAMIS","JUMAT","SABTU","MINGGU","SENIN","SELASA","RABU","KAMIS","JUMAT","SABTU","MINGGU"}; string hal2 [35]={"0","5","9","-","20","15","-","7","5","9","-","20","15","-","7","5","9","-","20","9","-","7","-","9","-","20","-","15","7" ,"5","9","10"}; string np3 [100]={"","PT. Capsule","PT. Jaya Makmur","L I B U R","PT. Honda Reptol","PT. Ribut","L I B U R","PT. Yamaho Tech" ,"PT. Suzuka Moto","PT. Dell","L I B U R","PT. En3os","PT. Kampret","PT. Yamaho Tech","PT. Honda Reptol","PT. Abal-Abal" ,"PT. Yamaho Tech","L I B U R","PT. En3os","PT. Mosta","PT. Taplet","PT. Yamaho Tech","PT. Honda Reptol","PT. En3os" ,"L I B U R","PT. Yamaho Tech","PT. Asikin","PT. Zipp","PT. Honda Reptol","PT. Suzuka Moto","PT. Yamaho Tech","L I B U R"}; string hari3 [100]={"","KAMIS","JUMAT","SABTU","MINGGU","SENIN","SELASA","RABU","KAMIS","JUMAT","SABTU","MINGGU","SENIN","SELASA","RABU" ,"KAMIS","JUMAT","SABTU","MINGGU","SENIN","SELASA","RABU","KAMIS","JUMAT","SABTU","MINGGU","SENIN","SELASA","RABU","KAMIS","JUMAT","SABTU","MINGGU"}; string hal3 [35]={"0","5","9","-","20","15","-","7","5","9","-","20","7","15","7","5","9","-","20","7","15","7","5","9","-","20","9","15","7" ,"5","9","-"}; //tipe data string berupa kalimat/kata string npi[20],ji[20]; char disc[25]; int k[5],t[5],th,h,lt[10]; //dalam tanda kurung tsb merupakan space yg diberikan dalam memori char ma= 'Y',mab= 'Y',mah='Y'; //tipe data char berupa huruf while (ma == 'y' || ma == 'Y'){ //pernyataan looping (pengulangan) {system("cls");} //syntax yang berfungsi membersihkan screen cout<<"============================================================"<<endl; cout<<"|| ||"<<endl; cout<<"|| RIAU TIMES ||"<<endl; cout<<"|| ||"<<endl; cout<<"============================================================"<<endl; //cout berfungsi sebagai menampilkan di layar hasil eksekusi //gotoxy(int x,int y) sebagai mengatur posisi letak pada screen eksekusi gotoxy(10,10);cout<<"Menu Pilihan Periklanan RIAU TIMES"<<endl; gotoxy(5,12);cout<<"1. Jadwal Iklan RIAU TIMES"<<endl; gotoxy(5,13);cout<<"2. Pendaftaran Iklan RIAU TIMES"<<endl; gotoxy(5,14);cout<<"3. Arsip Iklan RIAU TIMES"<<endl; gotoxy(5,17);cout<<"Silahkan Pilih Menu [1/2/3] : ";cin>>m; //cin berfungsi sbg perintah untuk menginputkan switch(m){ //switch berupa pernyataan pilihan berganda case 1: //merupakan ungkapan 1 pada switch while (mah == 'y' || mah == 'Y'){ // {system("cls");} //syntax yang berfungsi membersihkan screen cout<<"============================================================"<<endl; cout<<"|| ||"<<endl; cout<<"|| RIAU TIMES ||"<<endl; cout<<"|| ||"<<endl; cout<<"============================================================"<<endl; for(x=1;x<18;x++) { //perintah menampilakna tulisan bergerak delay(120); gotoxy(x-1,10);cout<<' '; gotoxy(x,10);cout<<" Jadwal Iklan RIAU TIMES "; } cout<<"\n\n\n"; struct { char np[100]; char hal[100]; }kln[10]; for(z=1;z<=7;z++) { cout<<"Data Hari - "<<g++<<endl; cout<<"Masukan Nama Perusahaan = ";cin>>kln[z].np; cout<<"Masukan Halaman = ";cin>>kln[z].hal; cout<<endl; } cout<<"\n\n\n"; for(z=1;z<=7;z++) { cout<<"Hari - "<<v++<<endl; cout<<"Nama Perusahaan = "<<kln[z].np<<endl; cout<<"Halaman = "<<kln[z].hal<<endl; cout<<endl; } cout<<"Apakah Ingin Melihat Jadwal Iklan Hari Ini (1=Ya 2=Tidak)";cin>>f; switch(f){ //switch berupa pernyataan pilihan berganda case 1: //merupakan ungkapan 1 pada switch {system("cls");} //syntax yang berfungsi membersihkan screen cout<<"============================================================"<<endl; cout<<"|| ||"<<endl; cout<<"|| RIAU TIMES ||"<<endl; cout<<"|| ||"<<endl; cout<<"============================================================"<<endl; // 56789012345678901234567890123456789012345678901 gotoxy(5,12);cout<<"-----------------------------------------------"<<endl; gotoxy(5,13);cout<<"|TANGGAL| HARI | NAMA PERUSAHAAN |HALAMAN|"<<endl; gotoxy(5,14);cout<<"-----------------------------------------------"<<endl; for(a=1;a<=7;a++) //pernyataan looping (pengulangan) { //aray dengan 7 elemen tipe int dan string gotoxy(5,14+a);cout<<"|"; gotoxy(9,14+a);cout<<a; gotoxy(13,14+a);cout<<"|"; gotoxy(14,14+a);cout<<hari[a]; gotoxy(20,14+a);cout<<"|"; gotoxy(23,14+a);cout<<kln[a].np; gotoxy(43,14+a);cout<<"|"; gotoxy(47,14+a);cout<<kln[a].hal; gotoxy(51,14+a);cout<<"|"; } //menampilakan isi array ke dalam screen eksekusi cout<<endl; cout<<" -----------------------------------------------"<<endl; break; default: cout<<"Kode Input Salah"<<endl; break; } gotoxy(3,30);cout<<"Apakah Anda Ingin Kembali ke Menu Jadwal Iklan (Y/T) : ";cin>>mah;} break; //sbg pernyataan bahwa case dalam switch ini telah berakhir case 2: //merupakan ungkapan 2 pada switch while (mah == 'y' || mah == 'Y'){ // {system("cls");} //syntax yang berfungsi membersihkan screen cout<<"============================================================"<<endl; cout<<"|| ||"<<endl; cout<<"|| RIAU TIMES ||"<<endl; cout<<"|| ||"<<endl; cout<<"============================================================"<<endl; for(x=1;x<15;x++) { //perintah menampilakna tulisan bergerak delay(120); gotoxy(x-1,10);cout<<' '; gotoxy(x,10);cout<<" Pendaftaran Iklan RIAU TIMES "; } cout<<"\n\n\n\n\n"; cout<<setw(40)<<"Masukkan Jumlah Pendaftaran : ";cin>>n; {system("cls");} //syntax yang berfungsi membersihkan screen cout<<"============================================================"<<endl; cout<<"|| ||"<<endl; cout<<"|| RIAU TIMES ||"<<endl; cout<<"|| ||"<<endl; cout<<"============================================================"<<endl; cout<<"| | | | | | |"<<endl; cout<<"|NO|NAMA PERUSAHAAN|U.IKLAN|L.TERBIT|HRG IKLAN| DISCOUNT |"<<endl; cout<<"| | | K | T | (HARI) | | |"<<endl; cout<<"============================================================"<<endl; //012345678901234567890123456789012345678901234567890123456789 for(b=1;b<=n;b++) //pernyataan looping (pengulangan) { //aray dengan elemenyang dibatasi dengan gotoxy(0,8+b);cout<<"|"; //input data tipe int dan string gotoxy(1,8+b);cout<<b; gotoxy(3,8+b);cout<<"|"; gotoxy(4,8+b);cin>>npi[b]; gotoxy(19,8+b);cout<<"|"; gotoxy(21,8+b);cin>>k[b]; gotoxy(23,8+b);cout<<"|"; gotoxy(25,8+b);cin>>t[b]; gotoxy(27,8+b);cout<<"|"; gotoxy(31,8+b);cin>>lt[b];" hari"; h = k[b]*t[b]*lt[b]*25000; // gotoxy(36,8+b);cout<<"|"; gotoxy(37,8+b);cout<<"Rp."<<h; if (h > 10000000){ //pernytan if sbg mengambil kondisi berdasarkan strcpy(disc,"5 % HARGA"); //suatu kondisi yang terpenuhi th = h*0.05;} else if (h > 5000000 && h <= 10000000){ strcpy(disc,"2,5 % HARGA"); //strcpy sbg printah mengcopy string th = h*0.025;} else if (h >= 1000000 && h < 5000000){ strcpy(disc,"0,5 % HARGA"); th = h*0.005;} else{ strcpy(disc,"TIDAK ADA"); th = h;} gotoxy(46,8+b);cout<<"|"; gotoxy(47,8+b);cout<<disc; gotoxy(59,8+b);cout<<"|"; cout<<endl; //menampilakan isi array ke dalam screen eksekusi gotoxy(0,9+n);cout<<"============================================================"<<endl; gotoxy(0,10+n);cout<<"|NO| JADWAL IKLAN | TOTAL HARGA |"<<endl; gotoxy(0,11+n);cout<<"============================================================"<<endl; //012345678901234567890123456789012345678901234567890123456789 gotoxy(0,11+b+n);cout<<"|"; gotoxy(1,11+b+n);cout<<b; gotoxy(3,11+b+n);cout<<"|"; gotoxy(7,11+b+n);cin>>ji[b]; gotoxy(33,11+b+n);cout<<"|"; gotoxy(39,11+b+n);cout<<"Rp."<<th; gotoxy(59,11+b+n);cout<<"|";} cout<<endl; cout<<"============================================================"<<endl; //perintah looping untuk kembali ke menu pendaftaran gotoxy(4,20);cout<<"Apakah Anda Ingin Kembali ke Menu Pendaftaran (Y/T) : ";cin>>mah;} break; //sbg pernyataan bahwa case dalam switch ini telah berakhir case 3: //merupakan ungkapan 1 pada switch while (mab == 'y' || mab == 'Y'){ {system("cls");} //syntax yang berfungsi membersihkan screen cout<<"============================================================"<<endl; cout<<"|| ||"<<endl; cout<<"|| RIAU TIMES ||"<<endl; cout<<"|| ||"<<endl; cout<<"============================================================"<<endl; //cout berfungsi sebagai menampilkan di layar hasil eksekusi //gotoxy(int x,int y) sebagai mengatur posisi letak pada screen eksekusi gotoxy(10,10);cout<<"Menu Arsip Iklan RIAU TIMES Tahun 2017"<<endl; gotoxy(5,12);cout<<"1. JANUARI"<<endl; gotoxy(5,13);cout<<"2. FEBRUARI"<<endl; gotoxy(5,14);cout<<"3. MARET"<<endl; gotoxy(5,15);cout<<"4. APRIL"<<endl; gotoxy(5,16);cout<<"5. MEI"<<endl; gotoxy(5,18);cout<<"Silahkan Pilih Menu [1/2/3/4/5] : ";cin>>o; //cin berfungsi sbg perintah untuk menginputkan switch(o){ //switch berupa pernyataan pilihan berganda case 1: //merupakan ungkapan 1 pada switch {system("cls");} //syntax yang berfungsi membersihkan screen cout<<"============================================================"<<endl; cout<<"|| ||"<<endl; cout<<"|| RIAU TIMES ||"<<endl; cout<<"|| ||"<<endl; cout<<"============================================================"<<endl; for(x=1;x<28;x++) { //perintah menampilakna tulisan bergerak delay(120); gotoxy(x-1,10);cout<<' '; gotoxy(x,10);cout<<" JANUARI "; } cout<<"\n\n\n"; // 56789012345678901234567890123456789012345678901 gotoxy(5,12);cout<<"-----------------------------------------------"<<endl; gotoxy(5,13);cout<<"|TANGGAL| HARI | NAMA PERUSAHAAN |HALAMAN|"<<endl; gotoxy(5,14);cout<<"-----------------------------------------------"<<endl; for(a=1;a<=31;a++) //pernyataan looping (pengulangan) { //aray dengan 31 elemen tipe int dan string gotoxy(5,14+a);cout<<"|"; gotoxy(9,14+a);cout<<a; gotoxy(13,14+a);cout<<"|"; gotoxy(14,14+a);cout<<hari[a]; gotoxy(20,14+a);cout<<"|"; gotoxy(23,14+a);cout<<np3[a]; gotoxy(43,14+a);cout<<"|"; gotoxy(47,14+a);cout<<hal3[a]; gotoxy(51,14+a);cout<<"|"; } //menampilakan isi array ke dalam screen eksekusi cout<<endl; cout<<" -----------------------------------------------"<<endl; break; case 2: {system("cls");} //syntax yang berfungsi membersihkan screen cout<<"============================================================"<<endl; cout<<"|| ||"<<endl; cout<<"|| RIAU TIMES ||"<<endl; cout<<"|| ||"<<endl; cout<<"============================================================"<<endl; for(x=1;x<24;x++) { //perintah menampilakna tulisan bergerak delay(120); gotoxy(x-1,10);cout<<' '; gotoxy(x,10);cout<<" FEBRUARI "; } cout<<"\n\n\n"; // 56789012345678901234567890123456789012345678901 gotoxy(5,12);cout<<"-----------------------------------------------"<<endl; gotoxy(5,13);cout<<"|TANGGAL| HARI | NAMA PERUSAHAAN |HALAMAN|"<<endl; gotoxy(5,14);cout<<"-----------------------------------------------"<<endl; for(a=1;a<=28;a++) //pernyataan looping (pengulangan) { //aray dengan 31 elemen tipe int dan string gotoxy(5,14+a);cout<<"|"; gotoxy(9,14+a);cout<<a; gotoxy(13,14+a);cout<<"|"; gotoxy(14,14+a);cout<<hari2[a]; gotoxy(20,14+a);cout<<"|"; gotoxy(23,14+a);cout<<np2[a]; gotoxy(43,14+a);cout<<"|"; gotoxy(47,14+a);cout<<hal2[a]; gotoxy(51,14+a);cout<<"|"; } //menampilakan isi array ke dalam screen eksekusi cout<<endl; cout<<" -----------------------------------------------"<<endl; break; case 3: {system("cls");} //syntax yang berfungsi membersihkan screen cout<<"============================================================"<<endl; cout<<"|| ||"<<endl; cout<<"|| RIAU TIMES ||"<<endl; cout<<"|| ||"<<endl; cout<<"============================================================"<<endl; for(x=1;x<28;x++) { //perintah menampilakna tulisan bergerak delay(120); gotoxy(x-1,10);cout<<' '; gotoxy(x,10);cout<<" MARET "; } cout<<"\n\n\n"; // 56789012345678901234567890123456789012345678901 gotoxy(5,12);cout<<"-----------------------------------------------"<<endl; gotoxy(5,13);cout<<"|TANGGAL| HARI | NAMA PERUSAHAAN |HALAMAN|"<<endl; gotoxy(5,14);cout<<"-----------------------------------------------"<<endl; for(a=1;a<=31;a++) //pernyataan looping (pengulangan) { //aray dengan 31 elemen tipe int dan string gotoxy(5,14+a);cout<<"|"; gotoxy(9,14+a);cout<<a; gotoxy(13,14+a);cout<<"|"; gotoxy(14,14+a);cout<<hari3[a]; gotoxy(20,14+a);cout<<"|"; gotoxy(23,14+a);cout<<np3[a]; gotoxy(43,14+a);cout<<"|"; gotoxy(47,14+a);cout<<hal3[a]; gotoxy(51,14+a);cout<<"|"; } //menampilakan isi array ke dalam screen eksekusi cout<<endl; cout<<" -----------------------------------------------"<<endl; break; case 4: {system("cls");} //syntax yang berfungsi membersihkan screen cout<<"============================================================"<<endl; cout<<"|| ||"<<endl; cout<<"|| RIAU TIMES ||"<<endl; cout<<"|| ||"<<endl; cout<<"============================================================"<<endl; for(x=1;x<26;x++) { //perintah menampilakna tulisan bergerak delay(120); gotoxy(x-1,10);cout<<' '; gotoxy(x,10);cout<<" APRIL "; } cout<<"\n\n\n"; // 56789012345678901234567890123456789012345678901 gotoxy(5,12);cout<<"-----------------------------------------------"<<endl; gotoxy(5,13);cout<<"|TANGGAL| HARI | NAMA PERUSAHAAN |HALAMAN|"<<endl; gotoxy(5,14);cout<<"-----------------------------------------------"<<endl; for(a=1;a<=31;a++) //pernyataan looping (pengulangan) { //aray dengan 31 elemen tipe int dan string gotoxy(5,14+a);cout<<"|"; gotoxy(9,14+a);cout<<a; gotoxy(13,14+a);cout<<"|"; gotoxy(14,14+a);cout<<hari2[a]; gotoxy(20,14+a);cout<<"|"; gotoxy(23,14+a);cout<<np2[a]; gotoxy(43,14+a);cout<<"|"; gotoxy(47,14+a);cout<<hal2[a]; gotoxy(51,14+a);cout<<"|"; } //menampilakan isi array ke dalam screen eksekusi cout<<endl; cout<<" -----------------------------------------------"<<endl; break; case 5: {system("cls");} //syntax yang berfungsi membersihkan screen cout<<"============================================================"<<endl; cout<<"|| ||"<<endl; cout<<"|| RIAU TIMES ||"<<endl; cout<<"|| ||"<<endl; cout<<"============================================================"<<endl; for(x=1;x<27;x++) { //perintah menampilakna tulisan bergerak delay(120); gotoxy(x-1,10);cout<<' '; gotoxy(x,10);cout<<" MEI "; } cout<<"\n\n\n"; // 56789012345678901234567890123456789012345678901 gotoxy(5,12);cout<<"-----------------------------------------------"<<endl; gotoxy(5,13);cout<<"|TANGGAL| HARI | NAMA PERUSAHAAN |HALAMAN|"<<endl; gotoxy(5,14);cout<<"-----------------------------------------------"<<endl; for(a=1;a<=30;a++) //pernyataan looping (pengulangan) { //aray dengan 31 elemen tipe int dan string gotoxy(5,14+a);cout<<"|"; gotoxy(9,14+a);cout<<a; gotoxy(13,14+a);cout<<"|"; gotoxy(14,14+a);cout<<hari3[a]; gotoxy(20,14+a);cout<<"|"; gotoxy(23,14+a);cout<<np3[a]; gotoxy(43,14+a);cout<<"|"; gotoxy(47,14+a);cout<<hal3[a]; gotoxy(51,14+a);cout<<"|"; } //menampilakan isi array ke dalam screen eksekusi cout<<endl; cout<<" -----------------------------------------------"<<endl; break; default :{ gotoxy(5,20);cout<<"Maaf Kode yang Dipilih Salah!!"<<endl; break; } } gotoxy(4,49);cout<<"Apakah Anda Ingin Kembali ke Menu Arsip (Y/T) : ";cin>>mab;} break; //sbg pernyataan bahwa case dalam switch ini telah berakhir default:{ //menambahkan optional jika user memasukkan input data yang salah gotoxy(5,20);cout<<"Maaf Kode yang Dipilih Salah!!"<<endl; break;} } cout<<"\n\n\tApakah Anda Ingin Ke Menu Awal (Y/T) : ";cin>>ma;} //looping ke menu tampilan awal }
2. Tampilan Awal Program
Diharapkan supaya memahami setiap perintah Syntax program di atas supaya tidak bingung jika terjadi error.
Sekian Artikel tentang Membuat Program Periklanan Menggunakan Bahasa Pemrograman C dan C++ semoga bermanfaat dan dapat menambah pengetahuan kamu.
Baca Juga :
Membuat Program Supermarket Menggunakan Bahasa Pemrograman C dan C++
Membuat Program Perhotelan dan Rumah Makan Menggunakan Bahasa C++
0 komentar:
Posting Komentar
Silahkan beri komentar dengan bijak dan sesuai dengan topik artikel.
Gunakan tombol balas dibawah komentar terkait jika ingin membalas komentar agar komunikasi lebih terstruktur.
Klik untuk melihat kode :) :( :s :D :-D ^:D ^o^ 7:( :Q :p T_T @-@ :-a :W *fck* :ngakak |o| :goodluck :smile