Introduction to Random Numbers - C Sharp Programming - Lecture Slides, Slides of C Sharp Programming

This programming course teaches different programming concepts with respect to C Sharp Programming. Key points of this lecture are: Introduction to Random Numbers, System.Random Class, Using the Random Class, Random Integer

Typology: Slides

2012/2013

Uploaded on 09/27/2013

vikrant
vikrant 🇮🇳

4.4

(9)

119 documents

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Introduction to Random
Numbers
docsity.com
pf3
pf4
pf5

Partial preview of the text

Download Introduction to Random Numbers - C Sharp Programming - Lecture Slides and more Slides C Sharp Programming in PDF only on Docsity!

Introduction to Random

Numbers

Lecture Overview

 Introduce the System.Random class

Using the Random Class (1)

 Create an instance of the Random class with a random seed value

Random CurrentRandom = new Random()  Create an instance of the Random class with a fixed seed value (The same sequence of numbers will always be generated

Random CurrentRandom = new Random(10)

Using the Random Class (2)

Next returns a random integer  It can also return a value within a range by passing the minimum and maximum value as arguments I = CurrentRandom.Next() I = CurrentRandom.Next(1, 10)NextDouble returns a double between 0 and 1 J = CurrentRandom.NextDouble()