Develop a febonacci series of 20 numbers . Now push these elements into stack and then pop them . After pop , each element should get inserted into queue and after dequeuing each element should get inserted in linked list and then print that linked list .
Write a program using vectors that simulates the rolling of a single die a hundred times. The program should store 100 rolls of the die. After the program rolls the die, the program then goes through the 100 elements in the vector and tallies up the number of 1 rolls, the number of 2 rolls, the number of 3 rolls, the number of 4 rolls, the number of 5 rolls, and the number of 6 rolls. The program then displays the number of the respective rolls to the user.
Develope a Fibonacci series of 20 numbers. Now push these elements into stack and then pop them.After pop each element should get inserted into queue and after dequeuing each element get inserted in link list and then print that linked list.
What is the purpose of commenting and how should it be done?
Each frame except for the tenth consists of one or
two balls, or attempts to knock down the ten pins at the end of the alley. Doing so on the
first ball of the frame is called a strike, and the second ball of the frame is not rolled.
Knocking down all ten pins with both balls (having left some up with the first ball) is called a
spare. If both attempts to knock down the pins leave some standing, the frame is called an
open frame. A spare in the tenth frame gives the bowler one extra ball; a strike in the tenth
gives him or her two extra balls. A bowling score is computed as follows. A strike counts as
10 points plus the sum of the next two balls. A spare counts as 10 points plus the next ball.
Suppose for example that the sequence of balls was
9 1 10 10 10 6 2 7 3 8 2 10 9 0 9 1 1 0
The score for the ten frames would be
Frame score
----- ----- 1 10
2 30
3 56
4 74
5 82
6 100
7 120
8 139
9 148
10 168
write a program that create the following number patern.
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7
1 2 3 4 5 6
1 2 3 4 5
1 2 3 4
1 2 3
If the originally x=2 ,y=1 and z=1, what are the value of x, y, z after executing the
following code?
Switch(x)
{
case 0 : x = 2;
y =3;
case 1 : x =4;
Default:
y = 3;
x = 1;
}
Re write the following code fragment using one switch statement
if (ch = = ‘E’|| ch= = ‘e’)
cout<<" this is either the value of ‘E’ or ‘e’";
else if (ch = = ‘A’|| ch= = ‘a’)
cout<<" this is either the value of ‘A’ or ‘a’";
else if (ch = = ‘r’|| ch= = ‘i’)
cout<<" this is either the value of ‘i’ or ‘r’";
else
cout<<" Enter the correct choice";
Write a C++ program for the following flowchart. N.B Let the user enter the
initial value of X and Y, finaly your program should return the value of X, Y and
Z.
Write a program that prompts the user to input an integer and then outputs both the individual digits of the number and the sum of the digits. For example, it should output the individual digits of 3456 as 3 4 5 6, output the individual digits of 8030 as 8 0 3 0, output the individual digits of 2345526 as 2 3 4 5 5 2 6, output the individual digits of 4000 as 4 0 0 0, and output the individual digits of -2345 as 2 3 4 5.