First of all i am learning c# and i got a homework assignment. But i didn't figure it out myself. I can't find the random numbers. Shall i write it in an apart class or actually i have no idea where i can start.
what i need to do is:
Create a gambling game where the user can bet on a race between two cars . The winner of the race is determined by the horsepower of the engine of the racing cars . Provide an OO solution wherein the following classes and their properties are used :
car
- number
- Engine
engine
- HP
When a car object is created will automatically Engine object created and are allocated . It is not possible to adjust . The engine of a car Also, the number of PK of the motor is determined by the creation of the engine and can not be changed by a external class . Determining the number of HP in the engine class you can in the following way :
<PkProperty> = New Random ( ) Next ( <min> , <max> ) . ;
Example : Pk = new Random ( ) Next (80 , 500 ) .
<PkProperty> Where the name of your HP property and and denote the minimum
and maximum value is between which a random number can be found.
The user will first need to enter the race cars. 2 songs After that, the program
the listing of both cars to = ratio of the probability of winning the 1st car compared to the 2nd car .
Just as the number of PK can be determined with this listing :
<notering> = new Random ( ) Next ( <min> , <max> ) . ;
Example : int = new listing Random ( ) Next ( 1 , 30 ) .
On the basis of this data, the user must enter the correct number of the car and the amount he wants to bet . Finally, the program is the result of the race , and any announce earnings .
The user will first need to enter the race cars. 2 songs After that, the program the listing of both cars to = ratio of the probability of winning the 1st car compared to the 2nd car .What does that even mean?!