Explain how overloading a unary operator is almost similar to overloading a binary operator with necessary examples and include main() function to demonstrate. Mention the differences between these two in terms of number of operands they deal with.
The number of grams of carbohydrates contained in a 1-ounce servings of randomly selected chocolates and non-chocolate candy is listed below. Is there sufficient evidence to conclude that the difference in the carbohydrates content is significant?
Chocolate
29 25 17 36 41 25 32 29 38 34 24 27 29 31 23 42
Non-chocolate
41 41 37 29 30 38 39 10 29 55 29 34 32 38 53 36
Consider an experiment of tossing an unbiased coin three times. What is the probability of obtaining four heads?
Select one:
a. 1
b. ½
c. 0
d. ¼
In which of the approaches to probability are personal conviction, belief and experience are employed to express probability of an event occurring?
Select one:
a. Subjective
b. Standard
c. Experimental
d. Relative frequency
If A and B are two non-mutually exclusive events, then
PrA∪PrB is
Select one:
a. PrA+PrB+PrA∩Pr(B)
b. PrA+PrB-PrA∩Pr(B)
c. PrA-PrB-PrA∩Pr(B)
d. PrA+PrB-PrA∩Pr(B)
All the following are approaches to assigning probability to events except
Select one:
a. Empirical Approach
b. Subjective Approach
c. Classical Approach
d. Objective Approach
A card is drawn from an ordinary deck. Find the probability of getting a 3 or a diamond card.
________ is one of the results obtained when a statistical experiment is carried out.
Select one:
a. Event
b. Activity
c. Outcome
d. Experiment
Adapt the following code to run in a windows form and also add a button to reset the input length and width boxes.
namespace PaintingEstimate
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Program computes the cost of painting the room");
//inputs room length and width
Console.Write("Enter room length: ");
int length = Convert.ToInt32(Console.ReadLine());
Console.Write("Enter room width: ");
int width = Convert.ToInt32(Console.ReadLine());
//calls method
int totalPrice = ComputePrice(length, width);
Console.WriteLine("Total price: ${0}", totalPrice);
Console.ReadKey();
}
//method computes work price
static int ComputePrice(int length, int width)
{
//price per square foot
int price = 6;
//ceiling
int ceil = 9;
int totalSquare = width * ceil * 2 + length * ceil * 2;
return price * totalSquare;
}
}
}
If the occurrence of an event does not influence the occurrence of another event, the two events are said to be
Select one:
Mutually Inclusive
Dependent
Mutually Exclusive
Independent