Answer:
// Program is written in Java Programming Language
// Comments are used for explanatory purpose
import java.util.*;
public class FlipCoin
{
public static void main(String[] args)
{
// Declare Scanner
Scanner input = new Scanner (System.in);
int flips;
// Prompt to enter number of toss or flips
System.out.print("Number of Flips: ");
flips = input.nextInt();
if (flips > 0)
{
HeadsOrTails();
}
}
}
public static String HeadsOrTails(Random rand)
{
// Simulate the coin tosses.
for (int count = 0; count < flips; count++)
{
rand = new Random();
if (rand.nextInt(2) == 0) {
System.out.println("Tails"); }
else {
System.out.println("Heads"); }
rand = 0;
}
}
Answer:
risk = probability x loss
Explanation:
Answer:
//Define the header file
#ifndef PLAYER_H
#define PLAYER_H
//header file.
#include <string>
//Use the standard namespace.
using namespace std;
//Define the class Player.
class Player
{
//Declare the required data members.
string name;
int score;
public:
//Declare the required
//member functions.
void setName(string par_name);
void setScore(int par_score);
string getName();
int getScore();
}
//End the definition
//of the header file.
#endif
Player.cpp:
//Include the "Player.h" header file,
#include "Player.h"
//Define the setName() function.
void Player::setName(string par_name)
{
name = par_name;
}
//Define the setScore() function.
void Player::setScore(int par_score)
{
score = par_score;
}
//Define the getName() function.
string Player::getName()
{
return name;
}
//Define the getScore() function.
int Player::getScore()
{
return score;
}
Answer:
F=531831381
Explanation:
There are two ways of doing this question:
1) By Formula
2) By Using Compound interest Table
By Formula:

Where:
F is future value
A is annual amount per year
i is interest rate
n is number of years

F=531831381
By Using Compound interest Table:
F=A(F/A,i,n)
From Table F/A at i=8% and n=8 is 10.6366
F=50000000*(10.6366)
F=531830000≅531831381
The difference in two answers is due to decimal points if you take value from table to greater decimal points you will get the exact answer as by using formula.