In: Biology
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 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 pseudocode in java.
In: Computer Science
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 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 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
In: Computer Science
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
In: Chemistry