Hehehehe...... Baru lagi nih....................... Silahkan buat panduan belajar dan latihan dirumah ya kawan... Hehehe... Penjelasannya entar aje sepulang kuliah hari ini..
Ingat Kawan, jangan asal kopi paste, kalo bisa di baca lalu ditulis lalu di coba... Wokeeh..
#include <stdio.h>
#include <iostream.h>
#include <conio.h>
#include <string>
main ()
{
char n[50] ; // variable karakter
string sh, z, bulan, j, p, keh ;
long int t, bl; // variable tahun lahir
printf ("================================================================== \n");
printf ("===================== Program Ramalan ============================ \n");
printf ("================================================================== \n");
// variable karakter
printf (" Masukkan Nama : ");
gets (n);
// variable tahun lahir
printf (" Tahun Lahir : ");
scanf ("%ld", & t);
// variable bulan lahir
printf (" Bulan : ");
scanf ("%d", & bl);
printf ("\n");
printf ("__________________________________________________________________ \n");
printf ("\n");
if ( t == 2000)
sh = "Naga" ;
else if ( t == 1999 )
sh = "Kambing" ;
if ( bl == 1 )
z = "Cancer";
else if ( bl == 2 )
z = "Pisces";
if ( bl == 1 )
bulan = "January" ;
else if ( bl == 2 )
bulan = "February" ;
printf (" Nama Tuan adalah %s \n", n);
printf (" Shio Anda adalah %s \n", sh);
printf (" Karena Anda Lahir di bulan %s", bulan);
printf (" Maka Zodiak Anda adalah %s \n", z);
if ( t == 2000 )
j = "Virgo" ;
else if ( t == 1999 )
j = "Sagitarius" ;
if ( t == 2000 && bl == 1 )
p = "Arsitek" ;
else if ( t == 1999 && bl == 1 )
p = "Programmer" ;
else if ( t == 2000 && bl == 2 )
p = "TNI AD" ;
else if ( t == 1999 && bl == 2 )
p = "Pilot" ;
if ( t == 2000 && bl == 1 )
keh = "Berlimpah Kekayaan" ;
else if ( t == 1999 && bl == 1 )
keh = "Selalu Bercinta" ;
else if ( t == 2000 && bl == 2 )
keh = "Penuh Kasih Sayang" ;
else if ( t == 1999 && bl == 2 )
keh = "Jangan Boros" ;
printf ("__________________________________________________________________ \n");
printf ("\n");
printf (" Ramalan = 1. Zodiak Jodoh = %s\n", j);
printf (" 2. Pekerjaan = %s\n", p);
printf (" 3. Kehidupan = %s\n", keh);
getch();
}
#include <iostream.h>
#include <conio.h>
#include <string>
main ()
{
char n[50] ; // variable karakter
string sh, z, bulan, j, p, keh ;
long int t, bl; // variable tahun lahir
printf ("================================================================== \n");
printf ("===================== Program Ramalan ============================ \n");
printf ("================================================================== \n");
// variable karakter
printf (" Masukkan Nama : ");
gets (n);
// variable tahun lahir
printf (" Tahun Lahir : ");
scanf ("%ld", & t);
// variable bulan lahir
printf (" Bulan : ");
scanf ("%d", & bl);
printf ("\n");
printf ("__________________________________________________________________ \n");
printf ("\n");
if ( t == 2000)
sh = "Naga" ;
else if ( t == 1999 )
sh = "Kambing" ;
if ( bl == 1 )
z = "Cancer";
else if ( bl == 2 )
z = "Pisces";
if ( bl == 1 )
bulan = "January" ;
else if ( bl == 2 )
bulan = "February" ;
printf (" Nama Tuan adalah %s \n", n);
printf (" Shio Anda adalah %s \n", sh);
printf (" Karena Anda Lahir di bulan %s", bulan);
printf (" Maka Zodiak Anda adalah %s \n", z);
if ( t == 2000 )
j = "Virgo" ;
else if ( t == 1999 )
j = "Sagitarius" ;
if ( t == 2000 && bl == 1 )
p = "Arsitek" ;
else if ( t == 1999 && bl == 1 )
p = "Programmer" ;
else if ( t == 2000 && bl == 2 )
p = "TNI AD" ;
else if ( t == 1999 && bl == 2 )
p = "Pilot" ;
if ( t == 2000 && bl == 1 )
keh = "Berlimpah Kekayaan" ;
else if ( t == 1999 && bl == 1 )
keh = "Selalu Bercinta" ;
else if ( t == 2000 && bl == 2 )
keh = "Penuh Kasih Sayang" ;
else if ( t == 1999 && bl == 2 )
keh = "Jangan Boros" ;
printf ("__________________________________________________________________ \n");
printf ("\n");
printf (" Ramalan = 1. Zodiak Jodoh = %s\n", j);
printf (" 2. Pekerjaan = %s\n", p);
printf (" 3. Kehidupan = %s\n", keh);
getch();
}
Kalo ada yg error pas nyoba tanya aja ama om indra.. okehh...
Hasilnye gini bro... |
Kayaknya banyak pertanyaan ntr nih...hehehehe %^_^% ..
BalasHapusgan udah ane baca n pahami tp kok masih ada yang error pas ane kopas, ane pakek turbo c++ gan,,, mohon pencerahannya,,, thanks
BalasHapus