Questions
what is a diploid number ? what is a Haploid number ? crossing over occurs in...

what is a diploid number ?

what is a Haploid number ?
crossing over occurs in what stages Meiosis?

In: Biology

Take an unknown number of integers as input and print the second smallest number. If there...

  • Take an unknown number of integers as input and print the second smallest number.
  • If there is no second smallest number in the sequence the program should print an error message and quit.
  • Write a function that takes a vector as argument and that returns an int containing the second smallest number. If no such number exists, the function should throw an exception that in turn is caught in main.
  • Your program should compute its answer with a complexity no worse than O ( n ). Note that this requirement excludes, e.g., sorting the sequence of numbers.
    • The professor means to say: "Your program should compute its answer with a complexity no worse than O ( n ). Note that this requirement excludes, e.g., the use of sorting algorithms on the sequence of numbers."
  • The program should read integers from cin until something non-numeric is entered.

Two examples of a correct execution of the program are shown below:

Enter the numbers in random order: (close by entering q)
34 254 1 -5 -13 q
The second smallest number is -5 

And:

Enter the numbers in random order: (close by entering q)
4 4 4 4 4 q
error: no second smallest

Code using c++ only.

In: Computer Science

Explain the relationship between group number and the number of bonds that ions of elements are...

Explain the relationship between group number and the number of bonds that ions of elements are likely to form.

Please explain in detial!

In: Chemistry

Prime Number Determines if a number is prime or not I also need the algorithm and...

Prime Number

Determines if a number is prime or not

I also need the algorithm and pseudocode in java.

In: Computer Science

isPrime Function. A prime number is a number that is only evenly divisible by itself and...

isPrime Function.

A prime number is a number that is only evenly divisible by itself and 1. For example, the number 5 is prime because it can only be evenly divided by 1 and 5. The number 6, however, is not prime because it can be divided evenly by 1, 2, 3, and 6.

Write a function named isPrime, which takes an integer as an argument and returns true if the argument is a prime number, or false otherwise. The program should ask for the number in main, and pass that number to the isPrime function, returning the result as to whether this number was prime or not prime. It should then display that as console output, and ask for another number from the user (repeating until the user no longer wants to make a request).

For a bonus point, for each number the user enters, return all the prime numbers from 2 up until that number (hint, you will need an additional loop).

Validate all input. Do not use using namespace std;. Don’t forget your pre and post conditions.

Hints:

Recall that the % operator divides one number by another, and returns the remainder of the division. In an expression such as num1 % num2 , the % operator will return 0 if num1 is evenly divisible by num2 .

In: Computer Science

Predict the number of d-electrons AND number of unpaired electrons on the metal in each of...

Predict the number of d-electrons AND number of unpaired electrons on the metal in each of the following complexes (explanations helpful!):

1. [Cr(H2O)4F2]

2. [Rh(en)3]3+

3. [Pt(CN)4]2-

4. [TiCL4]3-

In: Chemistry

An Armstrong number is a number that is the sum of its own digits, each raised...

An Armstrong number is a number that is the sum of its own digits, each raised to the power of the number of its digits. For example, 153 is considered an Armstrong number because 13 + 53 + 33 = 153.

Write a VBA program that lists all 3-digit Armstrong numbers within a specified range of 3-digit positive integers. Your sub should do the following: 1) Using two input boxes, ask the user to input two 3-digit positive integers (a "lower bound" and an "upper bound" for the range); 2) Enter all Armstrong numbers between the specified numbers in column A, staring with cell A1. Hints: Use a For Loop. Also, string functions can be used on LONG variables.

In: Computer Science

Given L={words in which the number of a’s are the same as the number of b’s}...

  1. Given L={words in which the number of a’s are the same as the number of b’s}
    1. Write a CFG to accept L.
    2. Convert the CFG to CNF.
    3. Construct a PDA for this CNF.

In: Computer Science

5. A prime number is a number that is only evenly divisible by itself and 1....

5. A prime number is a number that is only evenly divisible by itself and 1. For example, the number 5 is prime because it can only be evenly divided by 1 and 5. The number 6, how‐ ever, is not prime because it can be divided evenly by 1, 2, 3, and 6.   Write a Boolean function named is_prime which takes an integer as an argument and returns true if the argument is a prime number, or false otherwise. Use the function in a program that prompts the user to enter a number then displays a message indicating whether the number is prime.

6. In another program, use the function you wrote in question 5 to print the prime numbers between 1 and 100 using for loop.

In: Computer Science

Following the laws of quantum Mechanics: Calculate the number of orbitals and number of electrons in...

Following the laws of quantum Mechanics: Calculate the number of orbitals and number of electrons in different kinds of orbitals for n = 5 to 9. Explain what two electrons are allowed per orbital, and calculate the number of orbitals and total number of electrons for a given n. Does the calculation indicate a Pi or Sigma bond? Would this these natural atomic orbitals have an overlap?

In: Chemistry