V.Vidhya Logo

V.Vidhya

Math (Object) II


Q1.

Create a program that generates a random number representing a dice roll.

The dice has 6 possible outcomes between 1 & 6 so the randomly generated number should be between 1 & 6


Q2. (Adv.)

Create a program to choose a lucky winner of a contest.

Assume you have a set of customers (their data in form of their name) and for a draw, you have to randomly select a lucky customer.

Expected Output:

Lucky winner of the contest is `CustomerName`.

Your program should be independent of the number of customers, means if the number of customers changes even then your program will work without changing anything inside your code.


Prev Post
Math (Object) I
Next Post
Functions (Basic)