Posts

Showing posts from July, 2015

Learn Java - Random class

Image
The java.util.Random class instance is used to generate a stream of pseudorandom numbers. The class uses a 48-bit seed, which is modified using a linear congruential formula.The algorithms implemented by class Random use a protected utility method that on each invocation can supply up to 32 pseudorandomly generated bits. Commonly used methods of Random class There is a list of commonly used Scanner class methods: Method Description protected int next(int bits) This method generates the next pseudorandom number. boolean nextBoolean() This method returns the next pseudorandom, uniformly distributed boolean value from this random number generator's sequence. void nextBytes(byte[] bytes) This method generates random bytes and places them into a user-supplied byte array. double nextDouble() This method returns the next pseudorandom, uniformly distributed double value between 0.0 and 1.0 from this random number generator's sequence. float nextFloat() This method return

learn java - Scanner class

Image
The java.util.Scanner class is one way to read data enter by the user, using an appropriate input device such as keyboard. The  Java Scanner  class breaks the input into tokens using a delimiter that is whitespace bydefault. It provides many methods to read and parse various primitive values.  Commonly used methods of Scanner class There is a list of commonly used Scanner class methods: Method Description public String next() it returns the next token from the scanner. public String nextLine() it moves the scanner position to the next line and returns the value as a string. public byte nextByte() it scans the next token as a byte. public short nextShort() it scans the next token as a short value. public int nextInt() it scans the next token as an int value. public long nextLong() it scans the next token as a long value. public float nextFloat() it scans the next token as a float value. public double nextDouble() it scans the next token as a double value. Screen s

Car Wash System vb.net

Image
This software consists of a database that save the registration number of every vehicle being wash along side with the date, type of wash made and price Screen Shot Source Code To view records in the database: Dim conn As OleDbConnection = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\washRcd.accdb;Persist Security Info=False") Dim sql As String sql = " SELECT * FROM tblwash" conn.Open() Dim dt As New DataTable Dim cmd2 As New OleDb.OleDbDataAdapter(sql, conn) cmd2.Fill(dt) DataGridView1.DataSource = dt DataGridView1.Refresh() conn.Close() To insert new record in the database: Private Sub insert() Dim conn As OleDbConnection = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\washRcd.accdb;Persist Security Info=False") Dim updateSql As String = String.Format("