- Create a program which draws 6 random numbers from the range of [1..49] The numbers cannot be repeated.
Define the following function:
- to save the result of the draw use a 49-element array of logical values (true or false),
- before the draw all the elements of the array should contain the value false.
Drawing each of the six numbers should modify these elements of the array ( to true)
whose indexes equal the drawn numbers.
Save the program as the file lotek_your_surname.cpp
- void zerujTablice(bool tab, int n)
a function which completes a 49-element array with logical values false,
- void losujTablice(bool tab, int n)
a function which draws 6 random numbers which are not repeated and saves the resulting changes in the array,
- void piszWynik(bool tab, int n)
a function which displays the drawn numbers.
- Create a program which simulates throwing a dice:
Save the program as the file kostka_your_name.cpp
after the dice has been thrown a certain number of times the program displays the information about
how many times a specific number of dots has been thrown,
- to simulate the throwing use a procedure whose parameter is the number of throws,
- use switch statement to dispay the result of the throwing .
- Create a program which calculates how many times a dice needs to be thrown to obtain the same amount
of dots in two subsequented throwns. Use a function which returns a number of throws. Calculate the average result
for n number of trials. The total of trials ( n) is entered from the keyboard.
Save the program as the file takieSame_Your_surname.cpp
- Each program should contain a comment with your name and surname.
- Use appropriate indentation to improve the readability of the programs' source code. The lack of indentation may result in a lower mark.
- Enable the user to repeat each program.