Using the do…while() loop, continuously scan for random integers, but add up only all the positive integers and store the total in one variable.
The loop shall only be terminated when the inputted integer is zero. Afterwards, print out the total of all inputted positive integers.
1. A sample of 60 grade 11 students’ ages was obtained to estimate the mean age of all grade 11 students. years and the population variance is 16.
a. What is the point estimate for μ?
b. Find the 95% confidence interval for μ.
c. Find the 99% confidence interval for μ.
d. What conclusions can you make based on each estimate.
An elevated level of sodium ions in the blood would be 0.155 mol L-1 and would be cause for concern. The average adult female has a total blood volume of 4.70 L. Calculate the total mass of sodium ions present when this concentration is found, assuming a blood volume of 4.70 L.
We Filipinos are quite known for the habit of leaving at least one of the many pieces of food on the plate as it can't be equally divided among all at most times. Just like when 3 people decide to eat a pizza of 10 slices, there will often be at least one slice left on the box. To accurately show just how many pieces of things are left when divided by a certain number, we code it using modulo.
Care to do it for me?
Input
A line containing two integers separated by a space.
10 3
Output
A single line containing an integer.
1
The distance between the electrodes is 2.6 cm. If the dielectric strength of the dry air between is 3 x 10^6 V/m, what is the voltage across the electrodes when the arc first forms?
6. Three Lines Apart
by CodeChum Admin
Do you like reading books? If you do, then you must have encountered texts that have quite a wide space with dots in between them, just like pausing or thinking before proceeding the narration. Let's try doing that here in Python, shall we?
Input
Two lines containing a string on each.
some string
another string
Output
The first line contains the first inputted string.
The next three lines contains a dot symbol on each.
The last line contains the second inputted string.
some string
.
.
.
another string
Two coins are tossed and the random variable Z gives the number of heads. Find the range space, possible outcomes, and give the table of values.
Haley’s Comet can only be viewed once in every 76 years. How fast is it moving if it is
1.56 x 1020 m away from the Earth? If its mass is about 3,000 kg, how much force is keeping it in orbit?
1. Write a Java program to rearrange a given array of unique elements such that every second element of the array is greater than its left and right elements.
Example:
Input :
nums= { 1, 2, 4, 9, 5, 3, 8, 7, 10, 12, 14 }
Output:
Array with every second element is greater than its left and right elements:
[1, 4, 2, 9, 3, 8, 5, 10, 7, 14, 12]
2. Write a Java program to form the largest number from a given list of non-negative integers.
Example:
Input :
nums = {1, 2, 3, 0, 4, 6}
Output:
Largest number using the given array numbers: 643210
3. Write a Java program to shuffle a given array of integers.
4. Write a Java program to find maximum product of two integers in a given array of integers.
Example:
Input :
nums = { 2, 3, 5, 7, -7, 5, 8, -5 }
Output:
Pair is (7, 8), Maximum Product: 56
1. Write a Java program to find the maximum and minimum value of a 1-d array.
2. Write a Java program without using a second array to reverse elements of each row of a 2-d array of integer values.
e.g. 1 2 3 4 4 3 2 1
5 6 7 8 è 8 7 6 5
9 10 11 12 12 11 10 9
3. Write a java program to print the Pascal’s Triangle using a 2-d array.
4. Write a Java program to convert an array to an ArrayList, and an ArrayList to an array.
5. Write a Java program to arrange the elements of a given array of integers where all negative integers appear before all the positive integers.