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
A basketball player throws the ball at the different angles. At which of the following angles will the ball achieve the maximum height? A. 35.0° B. 45.0° C. 65.0° D. 70.0°
Write a program to create two Threads. 1st Thread printing the table of the number (each after a period of 1 sec) entered by the user and 2nd Thread printing each character of the sentence after a period of 1s. Thread 1 must be executed first completely before starting of thread 2.
3.2 Constituency Office Otuani
• The Otuani constituency office for the Opuwo Rural Constituency is nearing completion. There will be 5 employees with computers and IP phones, a computer lab with 25 places, a network printer for employees, a network printer for the lab, and 3 servers.
• The office only has an ISDN BRI link to the outside world. Provide Quality of Service such that the IP phones operate properly.
• The capital expenditure for this network (routers + switches + IP phones, but excluding PCs, laptops, printers) is capped at 100,000 N$.
Question 1: From the above scenario, design a network topology (using Packet Tracer).
For example if the given two strings A and B are "ramisgood" "goodforall"
The output should be "good"
Use nested while loop to print this shape
+----------+
| ^^ |
| ^ ^ |
| ^ ^ |
| ^^ |
| ^ ^ |
| ^ ^ |
+----------+
|v v|
| v v |
| vv |
|v v|
| v v |
| vv |
+----------+
Write a program to take input your name. Now write a function to print your name
in reverse order (eg. RAM KUMAR becomes RAMUK MAR). Then Write one more
function to find sum of ASCII values of all the characters (including space) in your
name using function.
Assume that a bank maintains two kinds of customers, one called as savings account and other as
current account. The saving account provides compound interest and withdrawal facilities but no
cheque book facility. The current account provides cheque book facility but no interest. Current
account holders should also maintain a minimum balance and if the balance falls below this level, a
service charge is imposed
Create classes as per below structure and add below functionalities
1. Add getter and setter member functions and display function in student, Test and sports
classes.
2. Result class only display all the data of Student, sports and test. and also calculate the total as
Total= marks of subject+ score for sports and display that also.
word count problem:
input: hello world welcome to python world
output:
hello: 1
world: 2
welcome: 1
to: 1
python: 1