A number is called a happy number, if you start with the given number
and arrive at 1 by repeating the following process (as illustrated in the below example): (a)
compute the sum of the squares of given number digits (b) if the resultant value is 1, then
the number is happy number, else execute point (a) for the newly produced number.
Note that if a number is not a happy number, there will be an endless loop to this execution.
Goal: In this question, you are required to write C++ code that checks whether the number entered by the user is a happy number or not for 10 cycles/iterations only.
Example: Assume a number 19
Number Computation Result cycle/iterations
19 1^2 + 9^2 82 1
82 8^2 + 2^2 68 2
68 6^2 + 8^2 100 3
100 1^2 + 0^2 +0^2 1 4
Write a program to find the table of numbers using a while loop. Your program should ask the size of the table. That size defines the rows and columns. Sample output:
IT must be done using WHILE loop.
Enter size: 6
1 2 3 4 5 6
------------------------------------------
1* 1 2 3 4 5 6
2* 2 4 6 8 10 12
3* 3 6 9 12 15 18
4* 4 8 12 16 20 24
5* 5 10 15 20 25 30
6* 6 12 18 24 30 36
What is delta S, the change in entropy of ten moles of an ideal monatomic gas that is expanded slowly and isothermally at a temperature of 293K from a pressure of 2 atm to a pressure of 1 atm?
a) 57.6 J/K
b) 203.4 J/K
c) 21.7 J/K
A function is defined on R such that f(x) = (C^2)x when x≤1 and 5Cx-6 when x>1 . Determine the values of C so that f becomes continues on R
write A C++ program to display output using while loop only
+------+
| ^^ |
| ^ ^ |
|^ ^|
| ^^ |
| ^ ^ |
|^ ^|
+------+
|v v|
| v v |
| vv |
|v v|
| v v |
| vv |
+------+
Consider the autocatalytic reaction A --+ R, with -rA = 0.001 CACR moll
1iter.s. We wish to process 1.5 litersls of a CAo = 10 mollliter feed to the
highest conversion possible in the reactor system consisting of four 100-
liter mixed flow reactors connected as you wish and any feed arrangement.
Sketch your recommended design and feed arrangement and determine
CAf from this system
Let X be a discrete random variable with the following PMF: pX(x) = 1/2 for x = 0 1/3 for x = 1 1/6 for x = 2 0 otherwise (i) Compute SX, the range of the random variable X. (ii) Calculate P(X ≤ 0.5). (iii) Calculate P(0.25 < X < 0.75). (iv) Calculate P(X = 0.2|X < 0.6).
Two systems have thermodynamic probabilities of 3.0 * 10^27 and 1.8 10*28 respectively calculate the entropies of the individual systems as well as their in composite systems and verify the boltzsmen relation
a patient in a hospital is often administered an intravenous (IV) drip contains an aqueous solution, this aqueous solution contains 0.85% (mass by volume) of sodium chloride or 5% (mass by volume) of glucose. calculate the molarity of both these solution.