The programmer's corner.

Please post computer issues here. We will try to help you. Also for showing off your PC.
83 posts
Alright everyone, I have found people fond of coding/programming here at KCNR.

I too share the same interest, in fact all my life is dedicated to it. I am a BASIC programmer, worked on Visuals, mainly Visual Basic. I'd love to work on Java, Python, C# and ultimately C++.

Currently working on Visual Basic, and I'll start Python from the 2nd of August.


If "Anyone sharing the same interest is welcome to my thread along with their knowledge"=True then
me.YourStudent=True
Msgbox "Teach me master" ,vbinformation
End if
End sub

Code: Select all

<?php

echo("Hello World");

?>

Add the following languages: PHP, Perl, Ruby and Bash
Are Ruby, Perl and Bash website designing languages?
No, no and no.

Ruby can be used for websites (backend)
Perl can be used for websites (backend)
Bash is for command line on Linux.

Website design is HTML and CSS.
And php is too for websites, well I want Linux so bad man, will talk about it later to you.
PHP is not per definition for websites. It's nice to use for websites as it's one of the easiest languages to use to work with websites.
Here is a small code that i did like a month ago ! Ofc i modified a bit here.
Body Mass Index

Code: Select all

import java.util.Scanner;
public class Kcnr
{
	public static void main (String [] arg)
	{
		Scanner scan= new Scanner (System.in);
	
		double m;
		double i;
		double BMI;
		
		System.out.println (" This program will tell your body mass index");
		System.out.println ();
		
		System.out.print ("How tall are you in meters : ");
		i=scan.nextDouble ();
		System.out.print ("How many kilograms do you have: ");
		m=scan.nextDouble ();
		
		BMI=m/Math.pow(i,2);
		
		if ( BMI < 18.5)
		{
			System.out.println ("Your Body Mass Index is BMI : "+BMI);		
			System.out.println (" You are under weight");
		}
		if ( BMI > 18.5 && BMI <= 24.9)	
		{
			System.out.println ("Your Body Mass Index is BMI: "+BMI);
			System.out.println (" You are in the recomended weight boi");
		}
		if ( BMI > 25.0 && BMI <=29.9)
		{
			System.out.println ("Your Body Mass Index is BMI:: " +BMI);
			System.out.println (" You are a bit fat boi, start caring for your self");
		}
		if ( BMI > 30 )
		{
			System.out.println ("Your Body Mass Index is BMI: "+BMI);
			System.out.println (" BOI are you kidding me even a whale is thinner than you are !");
		}
	}
}
Hahahaha really Henor? You did that BMI thingy too, with Java? :D I did it too, we were practicing pseudo codes with the exact same topic, I'll post it when I get time.
Thats my all long code up till now, compiling arrays nowadays though.

Nike.Inc

Code: Select all

Private Sub abt_Click()
About.Show
End Sub

Private Sub close_Click()
End
End Sub

Private Sub cmdadd_Click()
If txtid.Text = "" Then
   MsgBox "Record not entered properly"
End If
DE.rscmd2.AddNew
DE.rscmd2.Fields(0) = txtid.Text
DE.rscmd2.Fields(1) = txtname.Text
DE.rscmd2.Fields(2) = txtno.Text
DE.rscmd2.Fields(3) = txtadd.Text
DE.rscmd2.Fields(4) = txteadd.Text
DE.rscmd2.Fields(5) = txtcard.Text
DE.rscmd2.Update
MsgBox "Customer Record has been saved", vbInformation
End Sub

Private Sub cmdclear_Click()
txtid.Text = ""
txtname.Text = ""
txtno.Text = ""
txtadd.Text = ""
txteadd.Text = ""
txtcard.Text = ""
txtid.SetFocus
End Sub

Private Sub cmdfirst_click()
DE.rscmd2.MoveFirst
Call showrec
End Sub

Private Sub cmdlast_Click()
DE.rscmd2.MoveLast
Call showrec
End Sub

Private Sub cmdnext_Click()
DE.rscmd2.MoveNext
If DE.rscmd2.EOF = True Then
   DE.rscmd2.MoveLast
End If
Call showrec
End Sub

Private Sub cmdprevious_Click()
DE.rscmd2.MovePrevious
If DE.rscmd2.BOF = True Then
   DE.rscmd2.MoveFirst
End If
Call showrec
End Sub

Private Sub Command1_Click()
DE.rscmd2.Delete
DE.rscmd2.Fields(0) = txtid.Text
DE.rscmd2.Fields(1) = txtname.Text
DE.rscmd2.Fields(2) = txtno.Text
DE.rscmd2.Fields(3) = txtadd.Text
DE.rscmd2.Fields(4) = txteadd.Text
DE.rscmd2.Fields(5) = txtcard.Text
DE.rscmd2.Update
MsgBox "Record Deleted", vbInformation
End Sub

Private Sub cmdsearch_Click()
DE.rscmd2.MoveFirst
DE.rscmd2.Find ("ID=" & Val(txtid.Text))
If DE.rscmd.EOF = True Then
MsgBox "Record does not exist", vbExclamation
txtid.Text = ""
txtid.SetFocus
Exit Sub
End If
Call showrec
End Sub

Private Sub ext_Click()
End
End Sub

Private Sub Form_Load()
DE.rscmd2.Open
End Sub
Private Sub showrec()
txtid.Text = DE.rscmd2.Fields(0)
txtname.Text = DE.rscmd2.Fields(1)
txtno.Text = DE.rscmd2.Fields(2)
txtadd.Text = DE.rscmd2.Fields(3)
txteadd.Text = DE.rscmd2.Fields(4)
txtcard.Text = DE.rscmd2.Fields(5)
End Sub

Private Sub itm_Click()
Me.Hide
Item.Show
End Sub

Private Sub logout_Click()
Me.Hide
Login.Show
End Sub

Private Sub transaction_Click()
Me.Hide
Trans.Show
End Sub

Private Sub txtadd_Change()
If KeyAscii >= 65 And KeyAscii <= 90 Or KeyAscii >= 97 And KeyAscii <= 122 Or KeyAscii >= 48 And KeyAscii <= 57 Or KeyAscii = 8 Or KeyAscii = 32 Then
KeyAscii = KeyAscii
Else
KeyAscii = 0
End If

End Sub

Private Sub txteadd_KeyPress(KeyAscii As Integer)
If KeyAscii >= 65 And KeyAscii <= 90 Or KeyAscii >= 97 And KeyAscii <= 122 Or KeyAscii >= 48 And KeyAscii <= 57 Or KeyAscii = 8 Or KeyAscii = 32 Or KeyAscii = 46 Or KeyAscii = 64 Or KeyAscii = 95 Then
KeyAscii = KeyAscii
Else
KeyAscii = 0
End If
End Sub

Private Sub txtid_KeyPress(KeyAscii As Integer)
If KeyAscii >= 47 And KeyAscii <= 58 Or KeyAscii = 8 Or KeyAscii = 32 Then
KeyAscii = KeyAscii
Else
KeyAscii = 0
End If
End Sub

Private Sub txtname_KeyPress(KeyAscii As Integer)
If KeyAscii >= 65 And KeyAscii <= 90 Or KeyAscii >= 97 And KeyAscii <= 122 Or KeyAscii = 8 Or KeyAscii = 32 Then
KeyAscii = KeyAscii
Else
KeyAscii = 0
End If

End Sub

Option Explicit

Public LoginSucceeded As Boolean

Private Sub abt_Click()
About.Show
End Sub

Private Sub close_Click()
 LoginSucceeded = False
    Me.Hide
End Sub
Private Sub cmdOK_Click()
        'check that username and password are correct or not
If txtUserName = "" Then
LoginSucceeded = True
Else
MsgBox "Invalid username entered", vbExclamation
End If
If txtPassword = "" Then
LoginSucceeded = True
Else
MsgBox "Incorrect password, go to Nike.net to reset password", vbExclamation
End If
If txtUserName = "" And txtPassword = "" Then
Me.Hide
Item.Show
Unload Me
End If
End Sub

Private Sub Command1_Click()
Shell "explorer https://www.nike.net/portal/site/nike/template.LOGIN"
End Sub

Private Sub Label2_Click()
Shell "explorer https://www.nike.net/portal/site/nike/template.FORGOT_PASSWORD"
End Sub

Private Sub Label3_Click()
Shell "explorer https://www.nike.net/portal/site/nike/template.LOGIN"
End Sub
Private Sub Label4_Click()
Shell "explorer https://www.nike.net/portal/site/nike/template.FORGOT_USERNAME"
End Sub

Private Sub quit_Click()
End
End Sub


Option Explicit

Private Sub Form_KeyPress(KeyAscii As Integer)
    Unload Me
End Sub

Private Sub Form_Load()
    lblVersion.Caption = "Version " & App.Major & "." & App.Minor & "." & App.Revision
    lblProductName.Caption = App.Title
End Sub

Private Sub Frame1_Click()
    Unload Me
End Sub

Private Sub Timer2_Timer()
Me.Hide
Login.Show
End Sub
And trust me man, just to get up this result, the amount of coding you require... whoooff!

Image
83 posts