Devilzc0de Forum Follow @devilzc0de
  • Home
  • Hacking
  • Networking
  • Programming
  • O.S
  • Server
  • Tweets
  • Search
  • Member List
  • Calendar
Current time: 06-20-2013, 06:45 PM Hello There, Guest! (Login — Register)
Devilzc0de Forum › Information Technology › Programming › C / C++ v
« Previous 1 ... 5 6 7 8 9 ... 15 Next »

C# Mencari Zodiak dengan SubString

Home General Computer Multimedia Business Lounge

Post Reply 
Tweet
Threaded Mode | Linear Mode
C# Mencari Zodiak dengan SubString
03-30-2012, 12:13 AM
Post: #1
kadoel Offline
Gengster DC
Posts: 200
Joined: Mar 2011
Reputation: 15
C# Mencari Zodiak dengan SubString
Pagi om2 mbak2 tante2 penghuni DC, ane cuman pengen ngeshare sedikit program cupu C# console mencari zodiak dari tanggal lahir yg kita inputkan dengan SubString.. Kalau repost, di delete aja om momod.. ketawa

NB :
Disini ane make Visual Studio (Windows) dan MonoDevelop (Ubuntu)

Visual Studio :
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace devilz
{
    class Program
    {
        static void Main(string[] args)
        {
            String lahir;
            String tanggal;
            String bulan;
            String pil;
            int day;
            int month;
            Console.Write("Masukkan tanggal Lahir : ");
            lahir = Console.ReadLine();
            tanggal = lahir.Substring(0, 2);
            Console.ReadLine();
            day = Convert.ToInt32(tanggal);
            bulan = lahir.Substring(3, 2);
            Console.ReadLine();
            month = Convert.ToInt32(bulan);

            if (month == 01)
            {
                if ((day >= 01) && (day <= 19))
                {
                    Console.Write("Anda Berzodiak CAPRICORN");

                }
                else if ((day >= 20) && (day <= 31))
                {
                    Console.Write("Anda Berzodiak AQUARIUS");
                }
            }

            if (month == 02)
            {
                if ((day >= 01) && (day <= 18))
                {
                    Console.Write("Anda Berzodiak AQUARIUS");
                }
                else if ((day >= 19) && (day <= 29))
                {
                    Console.Write("Anda Berzodiak PISCES");
                }
            }
            if (month == 03)
            {
                if ((day >= 01) && (day <= 20))
                {
                    Console.Write("Anda Berzodiak PISCES");
                }
                else if ((day >= 21) && (day <= 31))
                {
                    Console.Write("Anda Berzodiak ARIES");
                }
            }
            if (month == 04)
            {
                if ((day >= 01) && (day <= 20))
                {
                    Console.WriteLine("Anda Berzodiak ARIES");
                }
                else if ((day >= 21) && (day <= 30))
                {
                    Console.Write("Anda Berzodiak TAURUS");
                }
            }
            if (month == 05)
            {
                if ((day >= 01) && (day <= 20))
                {
                    Console.Write("Anda Berzodiak TAURUS");
                }
                else if ((day >= 21) && (day <= 31))
                {
                    Console.Write("Anda Berzodiak GEMINI");
                }
            }
            if (month == 06)
            {
                if ((day >= 01) && (day <= 20))
                {
                    Console.Write("Anda Berzodiak GEMINI");
                }
                else if ((day >= 21) && (day <= 30))
                {
                    Console.Write("Anda Berzodiak CANCER");
                }
            }
            if (month == 07)
            {
                if ((day >= 01) && (day <= 21))
                {
                    Console.Write("Anda Berzodiak CANCER");
                }
                else if ((day >= 22) && (day <= 31))
                {
                    Console.Write("Anda Berzodiak LEO");
                }
            }
            if (month == 08)
            {
                if ((day >= 01) && (day <= 20))
                {
                    Console.Write("Anda Berzodiak LEO");
                }
                else if ((day >= 21) && (day <= 31))
                {
                    Console.Write("Anda Berzodiak VIRGO");
                }
            }
            if (month == 09)
            {
                if ((day >= 01) && (day <= 22))
                {
                    Console.Write("Anda Berzodiak VIRGO");
                }
                else if ((day >= 23) && (day <= 30))
                {
                    Console.Write("Anda Berzodiak LIBRA");
                }
            }
            if (month == 10)
            {
                if ((day >= 01) && (day <= 22))
                {
                    Console.Write("Anda Berzodiak LIBRA");
                }
                else if ((day >= 23) && (day <= 31))
                {
                    Console.Write("Anda Berzodiak SCORPIO");
                }
            }
            if (month == 11)
            {
                if ((day >= 01) && (day <= 22))
                {
                    Console.Write("Anda Berzodiak SCORPIO");
                }
                else if ((day >= 23) && (day <= 30))
                {
                    Console.Write("Anda Berzodiak SAGITARIUS");
                }
            }
            if (month == 12)
            {
                if ((day >= 1) && (day <= 20))
                {
                    Console.Write("Anda Berzodiak SAGITARIUS");
                }
                else if ((day >= 21) && (day <= 31))
                {
                    Console.Write("Anda Berzodiak CAPRICORN");
                }
            }

            Console.ReadLine();
        }
    }
}

MonoDevelop :
Code:
using System;

namespace devilz
{
    class MainClass
    {
        public static void Main (string[] args)
        {
            String lahir;
            String tanggal;
            String bulan;
            String pil;
            int day;
            int month;
            Console.Write("Masukkan tanggal Lahir : ");
            lahir = Console.ReadLine();
            tanggal = lahir.Substring(0, 2);
            Console.ReadLine();
            day = Convert.ToInt32(tanggal);
            bulan = lahir.Substring(3, 2);
            Console.ReadLine();
            month = Convert.ToInt32(bulan);

            if (month == 01)
            {
                if ((day >= 01) && (day <= 19))
                {
                    Console.Write("Anda Berzodiak CAPRICORN");

                }
                else if ((day >= 20) && (day <= 31))
                {
                    Console.Write("Anda Berzodiak AQUARIUS");
                }
            }

            if (month == 02)
            {
                if ((day >= 01) && (day <= 18))
                {
                    Console.Write("Anda Berzodiak AQUARIUS");
                }
                else if ((day >= 19) && (day <= 29))
                {
                    Console.Write("Anda Berzodiak PISCES");
                }
            }
            if (month == 03)
            {
                if ((day >= 01) && (day <= 20))
                {
                    Console.Write("Anda Berzodiak PISCES");
                }
                else if ((day >= 21) && (day <= 31))
                {
                    Console.Write("Anda Berzodiak ARIES");
                }
            }
            if (month == 04)
            {
                if ((day >= 01) && (day <= 20))
                {
                    Console.WriteLine("Anda Berzodiak ARIES");
                }
                else if ((day >= 21) && (day <= 30))
                {
                    Console.Write("Anda Berzodiak TAURUS");
                }
            }
            if (month == 05)
            {
                if ((day >= 01) && (day <= 20))
                {
                    Console.Write("Anda Berzodiak TAURUS");
                }
                else if ((day >= 21) && (day <= 31))
                {
                    Console.Write("Anda Berzodiak GEMINI");
                }
            }
            if (month == 06)
            {
                if ((day >= 01) && (day <= 20))
                {
                    Console.Write("Anda Berzodiak GEMINI");
                }
                else if ((day >= 21) && (day <= 30))
                {
                    Console.Write("Anda Berzodiak CANCER");
                }
            }
            if (month == 07)
            {
                if ((day >= 01) && (day <= 21))
                {
                    Console.Write("Anda Berzodiak CANCER");
                }
                else if ((day >= 22) && (day <= 31))
                {
                    Console.Write("Anda Berzodiak LEO");
                }
            }
            if (month == 08)
            {
                if ((day >= 01) && (day <= 20))
                {
                    Console.Write("Anda Berzodiak LEO");
                }
                else if ((day >= 21) && (day <= 31))
                {
                    Console.Write("Anda Berzodiak VIRGO");
                }
            }
            if (month == 09)
            {
                if ((day >= 01) && (day <= 22))
                {
                    Console.Write("Anda Berzodiak VIRGO");
                }
                else if ((day >= 23) && (day <= 30))
                {
                    Console.Write("Anda Berzodiak LIBRA");
                }
            }
            if (month == 10)
            {
                if ((day >= 01) && (day <= 22))
                {
                    Console.Write("Anda Berzodiak LIBRA");
                }
                else if ((day >= 23) && (day <= 31))
                {
                    Console.Write("Anda Berzodiak SCORPIO");
                }
            }
            if (month == 11)
            {
                if ((day >= 01) && (day <= 22))
                {
                    Console.Write("Anda Berzodiak SCORPIO");
                }
                else if ((day >= 23) && (day <= 30))
                {
                    Console.Write("Anda Berzodiak SAGITARIUS");
                }
            }
            if (month == 12)
            {
                if ((day >= 1) && (day <= 20))
                {
                    Console.Write("Anda Berzodiak SAGITARIUS");
                }
                else if ((day >= 21) && (day <= 31))
                {
                    Console.Write("Anda Berzodiak CAPRICORN");
                }
            }

            Console.ReadLine();
        }
    }
}

Inputan tanggal lahir harus seeperti ini : dd/mm/yyyy
Visit this user's website Find all posts by this user
Quote this message in a reply
 Reputed by :  tabun(+1) , od3yz(+1)
03-30-2012, 12:49 AM
Post: #2
noe Away
./Devilz Officer
Posts: 223
Joined: May 2011
Reputation: 9
RE: C# Mencari Zodiak dengan SubString
mntap juga, bikin sndira ya om ??
Visit this user's website Find all posts by this user
Quote this message in a reply
03-30-2012, 12:07 PM
Post: #3
od3yz Offline
"Brondong Metal Devilzc0de"
Posts: 912
Joined: Mar 2011
Reputation: 62
RE: C# Mencari Zodiak dengan SubString
hah gak ada yg susahan apa d share, isi cek2 sodiak nte metal
Visit this user's website Find all posts by this user
Quote this message in a reply
03-30-2012, 04:26 PM (This post was last modified: 03-30-2012 04:29 PM by kadoel.)
Post: #4
kadoel Offline
Gengster DC
Posts: 200
Joined: Mar 2011
Reputation: 15
RE: C# Mencari Zodiak dengan SubString
(03-30-2012 12:49 AM)noe Wrote:  mntap juga, bikin sndira ya om ??

Ya om buat sendiri.. kebetulan ini tugas ane di kampus.. hmm
(03-30-2012 12:07 PM)od3yz Wrote:  hah gak ada yg susahan apa d share, isi cek2 sodiak nte metal

Ini lain cok.. ini make Substring.. suram

Ente aja waktu ini buat tugas C# tentang menghitung nilai akhir salah ngakak
Visit this user's website Find all posts by this user
Quote this message in a reply
« Next Oldest | Next Newest »
Post Reply 


Topic Tools
Topic Link :
BBCode :
HTML Code :
View a Printable Version Send Thread to a Friend Subscribe to this thread
Submit Google Submit Face book Submit to Digg Submit to Reddit Submit to Furl Submit to Del.icio.us Submit to Jeqq

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  [Ask] C# update database dengan phpmyadmin,textbox,dan datagridview kenta 0 82 05-20-2013 09:36 AM
Last Post: kenta
  [Tutor] berkutat dengan linkedlist rakaslash 3 148 04-22-2013 05:04 AM
Last Post: e0ne199
Tongue [Tutor] Iseng dengan C++ nyiurmelambai 28 2,595 02-25-2013 03:28 PM
Last Post: abuabu_hat10
Thumbs Up [Tutor] Surat Cinta Dengan C++ chentiz 23 643 01-10-2013 08:57 AM
Last Post: chentiz
  [Tutor] Send Mail Gmail & Yahoo dengan Program C# kadoel 8 254 12-17-2012 09:27 AM
Last Post: kadoel
  [Tutor] Program Send Mail dengan C# kadoel 18 392 12-15-2012 07:20 PM
Last Post: hazel
Thumbs Up [Tutor] Program Urutkan Data dengan metode insertion sort chentiz 4 167 12-10-2012 10:18 PM
Last Post: chentiz
  enkripsi dan deskripsi dengan teknik caesar jinjun 6 1,749 11-05-2012 09:39 PM
Last Post: heram
  mendapatkan page size dengan _SC_PAGE_SIZE mywisdom 1 555 09-16-2012 01:59 PM
Last Post: oktori yusan
  Looping iseng dengan For While RieqyNS13 3 350 06-02-2012 11:34 AM
Last Post: RieqyNS13

Users Browsing
1 Guest(s)

  • Contact Us
  • devilzc0de
  • Return to Top
  • Mobile Version
  • RSS Syndication
  • Help
Current time: 06-20-2013, 06:45 PM Powered By MyBB, © 2002-2013 MyBB Group. Theme created by Justin S. | Mixed By Chaer.Newbie | Fixed By Aditya

USING THIS SITE INDICATES THAT YOU HAVE READ AND ACCEPT OUR TERMS. IF YOU DO NOT ACCEPT THESE TERMS, YOU ARE NOT AUTHORIZED TO USE THIS SITE