The king, queen and jack of clubs are removed from a deck of 52 playing cards and then shuffled. A card is drawn from the remaining cards. Find the probability of getting:
(i) a heart
(ii) a queen
(iii) a club
In: Statistics and Probability
A fair coin is tossed 450 times and the outcomes were noted as: Head = 250, Tail = 200.
Find the probability of the coin showing up
(i) a head
(ii) a tail.
In: Statistics and Probability
What is a cumulative probability? Please Give details explanation.
In: Statistics and Probability
Are my codes correct?
#include <iostream>
#include <string>
#include <cassert>
#include <cctype>
#include <cstring>
#include <stdio.h>
#include <ctype.h>
#include<fstream>
int locateMinimum( const std::string array[ ], int n ){
if(n <= 0){
return -1;
}
else{
int minInd = 0;
for(int i = 0; i < n; ++i){
if(array[i] < array[minInd]){
minInd = i;
}
}
return minInd;
}
}
int countPunctuation( const std::string array[], int n)
{
int count = 0;
for (int i=0;i<= n;i++)
{
if (array[i]== ('!', ',' ,':' ,';' ,'.', '-' ,'?'))
{
count = count + 1;
return count;
}
else {
return 0;
}
bool hasReverse(const std::string array[ ], int n )
{
// entire array
for(int i=0;i<n;i++)
{
//finding the reverse of the string
string rev = string(array[i].rbegin(),array[i].rend());
//checking that reverse of the string is present in the array or not
//if present returning true or we are returning false
for(int j=0;j<n;j++)
{
if(array[j] == rev){
return true;
}
}
}
return false;
}
char highestOccurredCharacter(const std::string array[ ], int n, int index ){
if( n <= 0 || index >= n || index < 0) //if invalid array length n or invalid index is given the function returns null character
return '\0';
int highest=0; //initially considering the highest to be 0
char c = '\0'; //to save the most repeating character
for(int i=0;i<array[index].length();i++){ //traversing through the string array[index]
int count = 0; //initial count of character array[index][i] is 0
for(int j=0;j<array[index].length();j++) //traversing through the string array[index] again to find the count of repeatetions of array[index][i] character
if(array[index][i]==array[index][j])
count++;
if(count>highest){ //if count is greater than the highest count then we have a new highest which has to be stored in highest
highest = count; //save the latest highest in highest
c = array[index][i]; //save the character of latest highest in c
}
}
return c; //return the total highest repeated character
}
bool isInIncreasingOrder( const std::string array[ ], int n )
{
if(n < 0){
return false;
}
else if(n == 0){
return true;
}
else{
for(int i = 1; i < n; ++i){
if(fruit[i] <= fruit[i - 1]){
return false;
}
}
return true;
}
}
char firstNonRepeatedCharacter(const std::string array[ ], int n, int index);
//This function finds out the first non repeating chracter and returns it
if( n <= 0 || index>= n || index < 0) { //if invalid array length n or invalid index is given the function returns null character
return '\0';}
for(int i=0;i<array[index].length();i++){ //traversing through the string array[index] chracters
int count = 0; //initialising count to 0 initially
for(int j=0;j<array[index].length();j++) //traversing through the string array[index] chracters to count the occurrences
if(array[index][i]==array[index][j]) //
count++;
if(count==1) //the count of non Repeating Character is 1 so if any chracter gets a count 1 it must be returned and it would be the firstNonRepeatedCharacter
return array[index][i];
}
bool isOnlyDigits( const std::string array[ ], int n ){
//traversing array
for(int i=0;i<n;i++)
{
//traversing each string of the array
for(int j=0;j<array[i].length();j++)
{
//checking the string contains only digits or not if not we are returning false
if (!(array[i][j] >= '0' && array[i][j] <= '9'))
return false;
}
}
return true;
}
}
In: Computer Science
Write the electron formula for a neutral atom having 14 electrons and predict is highest valence.
In: Chemistry
2. Answer the following questions about the motion of an object launched from the roof of a building with a height of 10 m at an initial velocity of 20 m/s and an angle of 60°. (1) Find the x and y components of the initial velocity. (2) Find the x and y components of the velocity after 2.0 seconds. (3) Find the time to reach the highest point. (4) Find the height of the highest point. (5) Find the time until it falls to the ground.
In: Physics
WANT CODE IN PYTHON PROGRAM:
THE QUESTION IS BASED ON Mcdonald.csv
In: Statistics and Probability
Match each statement below with the appropriate inventory costing method.
1. This inventory costing method shows cost of goods sold on the income statement at the most current inventory costs during a period of deflation
2. This inventory costing method results in the highest amount of income tax expense reported on the income statement during a period of deflation
3. This inventory costing method results in the highest amount paid to purchase inventory during a period of inflation
In: Accounting
An object is thrown vertically upward with an initial speed of 56.9 m/s. (Assume the object is thrown from ground level.)
(a) How high (in m) does it rise?
(b) How long (in s) does it take to reach this highest altitude?
(c) How long (in s) does it take to hit the ground after it reaches the highest altitude?
(d) What is its speed (in m/s) when it returns to the level from which it was initially released?
In: Physics
In C ++, Design and implement a program that reads from the user four integer values between 0 and 100, representing grades. The program then, on separate lines, prints out the entered grades followed by the highest grade, lowest grade, and averages of all four grades. Format the outputs following the sample runs below.
Sample run 1:
You entered: 95, 80, 100, 70
Highest grade: 100
Lowest grade: 70
Average grade: 86.25
In: Computer Science