Please take a look about R6.32 Suppose you design an educational game to teach c
ID: 3853953 • Letter: P
Question
Please take a look about R6.32
Suppose you design an educational game to teach children how to read a clock. How do you generate random values for the hours and minutes? In a travel simulation, Harry will visit one of his friends that are located in three states. He has ten friends in California, three in Nevada, and two in Utah. How do you produce a random number between 1 and 3, denoting the destination state, with a probability that is proportional to the number of friends in each state? Explain the differences between these debugger operations Stepping into a method Stepping over a method Explain in detail how to inspect the string stored in a String object in your debugger. Explain in detail how to inspect the information stored in a Rectangle object in your debugger. Explain in detail how to use your debugger to inspect the balance stored in a Bank Account object. Explain the divide-and-conquer strategy to get close to a bug in a debugger.Explanation / Answer
#include<stdio.h>
#include <stdlib.h>
int main() {
int a;
int randomNum;
//number of friends
a=rand() % 15;
if (a <= 9){ //a is 0-9
randomNum = 1; //California
printf("California");
} else if (a<=12){ // a is 10-12
randomNum = 2; //Nevada
printf("Nevada");
}else {//a is 13 or 14
randomNum = 3; //Utah
printf("utah");
}
}
Here we mentioned the probabiltiy that is proportinal to the number of friends in each set