Answer:
#include <iostream>
#include <time.h>
#include <string>
using namespace std;
int main(){
srand(time(NULL));
cout<<"Throw dice"<<endl;
int b =0;
int a=0;
a=rand()%6;
b=rand()%6;
for (int i =0;i<1;i++)
{cout<<"dice one: "<<a<<endl;}
for (int i =0;i<1;i++)
{cout<<"dice two: "<<b<<endl;}
if(a>b)
{cout<<"first dice won"<<endl;}
if(b>a)
{cout<<"second dice won"<<endl;}
else{cout<<"they are same"<<endl;
return main();
}
return 0;
}
Explanation:
/*best dice roll game just for you change it as you want but all necessary things are there/*
A functional dependency describes a relationship between the attributes of an entity such that the value of one attribute is dependent on the value of some other attribute and is very well affected by it.
There can be various sources of information that define functional dependency. For instance, an attribute age can define the functional dependency with the attribute ID. One cannot include the voter ID if they are not above 18 years of age.
Similarly, the attribute date of joining can define the functional dependency with the attribute experience, as the experience in a particular organization can be calculated by subtracting the joining date fro the current date.
Answer:
import java.util.Scanner;
import java.util.Arrays;
import java.util.Random;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.print("Enter low: ");
int low = scan.nextInt();
System.out.print("Enter high: ");
int high = scan.nextInt();
scan.close();
int rndnumbers[] = new int[10];
Random r = new Random();
for(int i=0; i<rndnumbers.length; i++) {
rndnumbers[i] = r.nextInt(high-low+1) + low;
}
for(int i=0; i<rndnumbers.length; i++) {
System.out.printf("%d: %d\n", i, rndnumbers[i]);
}
}
}
Because of the reflection on the window or mirror.