skip to main | skip to sidebar

OPEN SOURCE

Linux for Better life

  • Home
  • Trik-Tips
  • Free Template
  • Blogger Hack
  • Free Ebook
Showing posts with label c#. Show all posts
Showing posts with label c#. Show all posts

C ++ part 3

CD RENT APPLICATION

/ Asumsi - asumsi :
// 1. Rental hanya mempunyai 10 CD
// 2. Pada state awal, CP01, CP03, CP07 sudah dipinjam
// ************************************************************

#include
#include
#include

int main()
{

// Deklarasi Variable
char inpmenu, inp[4], any;
int st, stat, x, y;
char nama[6] = {' '};

// Dumping Data CD
char cd[10][4] = { {'C','P','0','1'}, {'C','P','0','2'},
{'C','P','0','3'}, {'C','P','0','4'},
{'C','P','0','5'}, {'C','P','0','6'},
{'C','P','0','7'}, {'C','P','0','8'},
{'C','P','0','9'}, {'C','P','1','0'}
};

// Dumping Data Peminjaman
char pinjam[10][10] = {
{'C','P','0','1','H','a','t','m','a'} ,
{'C','P','0','2',' ',' ',' ',' ',' ',' '},
{'C','P','0','3','M','a','y','a','n','g'},
{'C','P','0','4',' ',' ',' ',' ',' ',' '},
{'C','P','0','5',' ',' ',' ',' ',' ',' '},
{'C','P','0','6',' ',' ',' ',' ',' ',' '},
{'C','P','0','7','A','i','n','a'},
{'C','P','0','8',' ',' ',' ',' ',' ',' '},
{'C','P','0','9',' ',' ',' ',' ',' ',' '},
{'C','P','1','0',' ',' ',' ',' ',' ',' '}
};

// Menu Label
menu :

// Clear Screen
system("clear");

// Greeting

cout << "+-----------------------------------+" <<>

// Menu
cout << "Silakan pilih proses yang akan dilakukan" <<>

// Input Menu
cout << "\n>> Pilihan Anda : ";
cin >> inpmenu;
cout <<>

// Greeting
cout << "+-----------------------------------+" <<>> inp;

// Validasi Input - Check Apa CD Tersedia
x = 0; st = 0;
do
{
for (y=0; y<4; st =" 0;" st="="4)">> nama; cout << z =" 0;" stat="1;" x="1;" x="="10)" stat="0;" x="0;" b="0;">

Posted by MALIK 0 comments

Labels: c ++, c#, code, linux, online, open source

C ++ part 2

if (x==10)
{ cout << "\n(!) Kode Mobil tidak ditemukan\n" << stat="0;" x="0;" b="0;">> any; goto menu;

break;

case '2' :
// Clear Screen
system("clear");

// Greeting
cout << "+====================================+" <<>> inp;

// Validasi Input - Check Apa Mobil Tersedia
x = 0; st = 0;
do
{
for (y=0; y<4; st =" 0;" st="=" z =" 0;" stat="1;" x="1;" x="=" stat="0;" x="0;" b="0;">> any; goto menu;

break;
case '3' :
// Clear Screen
system("clear");

// Greeting
cout << "+====================================+" <<>

avanza.data("Avanza ", 400000);
innova.data("Kijang Innova ", 600000);
APV.data("APV ", 550000);
krista.data("Kijang Krista", 400000);
taruna.data("Taruna ", 300000);
xenia.data("Xenia ", 40000);

avanza.tampil();cout<<<<<<<< "\nTekan sembarang tombol + enter untuk melanjutkan .. "; cin >> any; goto menu;
break;

case '4' :
// Clear Screen
system("clear");

// Greeting
cout << "+====================================+" << m="0;" n="0;" n="4;" n="0;">> any; goto menu;
break;

case '5' :
// Clear Screen
system("clear");

// Greeting
cout << "+====================================+" <<>

Posted by MALIK 0 comments

Labels: c ++, c#, code, open source, source

C Sharp

ARRAY

using System;

namespace Arrays
{
class Arrays
{
public static void PrintArray(int[] myInts)
{
for(int i = 0; i <>

public static string[] GetStringArray()
{
string[] theStrings = {"Hello", "from", "GetStringArray"};
return theStrings;
}

public static int Main(string[] args)
{
#region Array declarations

// A string array containing 10 elements {0, 1, ...,9}.
string[] booksOnCOM;
booksOnCOM = new string[10];

// A 2 item string array, numbered {0, 1}
string[] booksOnPL1 = new string[2];

// 100 item string array, numbered {0, 1, ..., 99}
string[] booksOnDotNet = new string[100];

// The size of this array will automatically be set to 4.
// Note the lack of the 'new' keyword.
int[] ages = {20, 22, 23, 0};

// Need 'new' keyword when you define a fixed size array.
// Uncomment to trigger error.
// int[4] ages = {30, 54, 4, 10}; // Error!
#endregion

Console.WriteLine("***** Array as Parameter *****");
PrintArray(ages);

Console.WriteLine("\n***** Array as return value *****");
string[] strs = GetStringArray();
foreach(string s in strs)
Console.WriteLine(s);

Console.WriteLine("\n***** A rectangular MD array *****\n");
int[,] myMatrix;
myMatrix = new int[6,6];

// Populate (6 * 6) array.
for(int i = 0; i < j =" 0;">

// Show (6 * 6) array.
for(int i = 0; i < j =" 0;">

Console.WriteLine("\n***** A jagged MD array *****\n");
int[][] myJagArray = new int[5][];

// Create the jagged array.
for (int i = 0; i < i =" 0;" j =" 0;">

// Initialize items at startup or...
Console.WriteLine("\n***** Created array of strings *****");
string[] firstNames =
new string[5]{"Steve", "Gina", "Swallow", "Baldy", "Gunner"};

// ...go member by member.
/*
string[] firstNames = new string[4];
firstNames[0] = "Steve";
firstNames[1] = "Gina";
firstNames[2] = "Swallow";
firstNames[3] = "Baldy";
firstNames[4] = "Gunner";
*/

// Print out names in declared order.
for(int i = 0; i <>

// ... and print them.
Console.WriteLine("\n\n***** Here is the array once reversed *****");
for(int i = 0; i <>

// Clear out all but the final member.
Console.WriteLine("***** Cleared out all but young Gunner *****");
Array.Clear(firstNames, 1, 4);
for(int i = 0; i <>

Posted by MALIK 0 comments

Labels: c#

C Sharp

STRING

using System;
using System.Text;

namespace Strings
{
class StringApp
{
public static int Main(string[] args)
{
Console.WriteLine("***** Fun with Text *****\n");
System.String strObj = "This is a TEST";
string s = "This is another TEST";

// Test for equality between the stings.
if(s == strObj)
Console.WriteLine("Same info...");
else
Console.WriteLine("Not the same info...");

// Concatenation.
string newString = s + strObj;
Console.WriteLine("s + strObj = " + newString + "\n");

// Escape characters.
string anotherString;
anotherString = "Every programming book needs \"Hello World\"";
Console.WriteLine("\t" + anotherString);

anotherString = "c:\\CSharpProjects\\Strings\\string.cs";
Console.WriteLine("\t" + anotherString + "\n");

// The @ string turns off the processing of escape characters.
string finalString = @"\n\tString file: 'C:\CSharpProjects\Strings\string.cs'";
Console.WriteLine(finalString);

// Spacing is preserved!
string myLongString = @"Stuff Stuff Stuff Stuff Stuff
Stuff Stuff Stuff Stuff Stuff Stuff Stuff
Stuff Stuff Stuff Stuff Stuff ";
Console.WriteLine(myLongString);

// Make changes to this string? Not really...
System.String strFixed = "This is how I began life";
Console.WriteLine(strFixed);
string upperVersion = strFixed.ToUpper();
Console.WriteLine(strFixed);
Console.WriteLine(upperVersion + "\n\n");

// Play with the StringBuilder class.
StringBuilder myBuffer = new StringBuilder("I am a buffer");
myBuffer.Append(" that just got longer...");
Console.WriteLine(myBuffer);
myBuffer.Append("and even longer.");
Console.WriteLine(myBuffer);
string theReallyFinalString = myBuffer.ToString().ToUpper();
Console.WriteLine(theReallyFinalString);

// Note! System.String also defines a custom indexer to access each
// character in the string.
for(int k = 0; k <>

return 0;
}
}
}

Posted by MALIK 0 comments

Labels: c#

C Sharp

Hello Message

using System;
using System.Windows.Forms;

class HelloMessage
{
public void Speak()
{
MessageBox.Show("Hello...");
}
}

TEST APPLICATON

// The first C# app of the book...
using System;

// Add this!
// using System.Windows.Forms;

class TestApp
{
public static void Main()
{
Console.WriteLine("Testing! 1, 2, 3");

// Add this!
// MessageBox.Show("Hello...");

HelloMessage h = new HelloMessage();
h.Speak();

// Oops! Forgot semi-colon.
// Uncomment line below and
// use /bugreport to build
// report file.
// h.Speak()
}
}

Posted by MALIK 0 comments

Labels: c#

Older Posts Home

Links

  • ALJAZEERA TV
  • ANTARA
  • Bali`s Blogger
  • BBC
  • BERITANET.COM
  • CHIP ONLINE
  • CNN
  • DETIK.COM
  • E-BOOK
  • Economic
  • Friends
  • Friendster's Blog
  • Habibieafsyah
  • HARVARD UNIVERSITY
  • ILMU KOMPUTER
  • INFO LINUX
  • KICK ANDY
  • LINUX OpenSuse
  • LINUX SLAX
  • Linux Temanggung
  • LINUX UBUNTU
  • LIPUTAN 6 SCTV
  • MASTER BLOGGER
  • METROTV NEWS
  • MUSIC DOWNLOAD
  • My Class
  • Robotic AMIKOM
  • SMA N 3 TEMANGGUNG
  • SMART E-LEARNING
  • SOFTPEDIA
  • STMIK AMIKOM
  • SUPPORTED BLOGGER
  • TIPS TRICKS
  • TRIAL FILM
  • TV ONE ONLINE

Blog Archive

  • ▼ 2009 (38)
    • ▼ 05/31 - 06/07 (1)
      • Java
    • ► 02/15 - 02/22 (1)
    • ► 01/11 - 01/18 (11)
    • ► 01/04 - 01/11 (25)
  • ► 2008 (70)
    • ► 11/30 - 12/07 (22)
    • ► 11/16 - 11/23 (18)
    • ► 11/09 - 11/16 (1)
    • ► 10/26 - 11/02 (5)
    • ► 10/19 - 10/26 (16)
    • ► 10/12 - 10/19 (4)
    • ► 10/05 - 10/12 (4)



$100.00 Anda pasti untung setelah registrasi!






Search Engine Optimization and SEO Tools







Bookmark CO.CC:Free Domain