- Write a program in C++ to generate the following series of numbers:
(i)
(ii)
1
2
3
4
5
6
7
8
9
1
1
2
3
4
5
6
7
8
2
1
1
2
3
4
5
6
7
3
2
1
1
2
3
4
5
6
4
3
2
1
1
2
3
4
5
5
4
3
2
1
1
2
3
4
6
5
4
3
2
1
1
2
3
7
6
5
4
3
2
1
1
2
8
7
6
5
4
3
2 1
1
9
8
7
6
5
4
3 2 1
- Write a program in C++ that determines whether a given number is a prime number or not and prints it, using
(i) for loop
(ii) while-do loop
(iii) do-while loop
(Hint: Prime number is a number which is divisible only by 1 and by itself. 3 is a prime number since it is divisible by 1 and 3, whereas 6 is not a prime number because, it is divisible by 1, 2 and 3.)
Q65.
- Write a program in C++ to read a number n from the standard input device, i.e. keyboard, and again read a digit and check whether the digit is present in the number n. If it is so, count how many times it is repeated in the number n.
For example, let n = 12576
digit to be checked 5. The digit is present once.
- Write a program in C++ to read a number n, and digit d, and check whether d is present in the number n. If it is so, find out the position of d in the number n. For example,
Let n = 75689 and d = 5
The digit d, i.e., 5 is present at the position 4 from left to right.
Q66.
- Write a program in C++ to read a number n and find out the sum of the integers from 1 to 2, then from 1 to 3, then 1 to 4, and so on and to display the sum of the integers from 1 to n. For example,
from 1 to 2 = 1
1 to 3 = 3
1 to 4 = 6
1 to 5 = 10
1 to 6 = 18
- Write a program in C++ to read a positive number n and to generate the following series using
(i) for loop
(ii) while-do loop
(iii) do-while loop
(a) number = 1 2 3 4 … n
(b) number = 0 2 4 6 … n
(c) number = 1 3 5 7 … n
(d) number = 1 22 32 42 … n2
(e) number = 1 23 33 43 … n3
Q67.
- Write a program in C++ to read a positive integer number n and to generate the numbers in the following form.
For example,
Enter a number: 5
Output 5 4 3 2 1 0 1 2 3 4 5
Enter a number: 7
Output 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7
- Write a program in C++ to generate the following pyramid of numbers.
0
1
0
1
2
1
0
1
2
3
2
1
0
1
2
3
4
3
2
1
0
1
2
3
4
5 4
3
2
1
0
1
2
3
4 5
6 5 4
3
2
1
0
1
2
3
4 5 6
Q68.
- Write a program in C++ to read a hex number and to find out the 15’s and 16’s complement of the given hex number using comma operator in the for loop.
- Write a program in C++ to read an octal number and to find out the 7’s and 8’s complement of the given octal number using comma operator in the for loop.
- Write a program in C++ to read a set of real numbers from a standard input device and check whether any 0 has been entered. If it is so, using break statement, just stop the execution and display a message “zero entered”.
Q69.
- Write a program in C++ to read a positive integer number n and to generate the following numbers up to n, using goto statement.
number = 1 2 3 4 … n
number = 0 2 4 6 … n
number = 1 3 5 7 … n
number = 1 22 32 42 … n2
- Write a program in C++ to read a positive integer number n from a standard input device and to display the number and digit. For example, n = 5678
Output
5
6
7
8
Q70.
1.A program to demonstrate how to declare and invoke a function in the main program based on the Type 1 category.
2.A program to display the following numbers and invoke a function in the main program based on the Type 1 category.
3.A program to find the area and the circumference of a circle for a given value of radius using a function type 2 category.
4.A program to find the sum of the given two numbers using a function type 2 category.
Q71.
5.A program performs a simple arithmetic operations, such as addition, subtraction, multiplication and division on two numbers using a function of Type-3 category.
6.A program to find the factorial of a given number function of Type 3 category.
7.A program to generate a Fibonacci series of numbers using a function technique.
8.A program to find the sum of the given series of non-negative integers using a function. sum = 1+2+3+4+……..n
Q72.
9.A program to generate power series using a function technique
10.A program to illustrate how to declare the local variable.
11.A program to find the sum of the given numbers using default argument declaration
12.A program to demonstrate how to call up the functions mutually each other in C++.
13.A program that demonstrates how a side effect occurs when a global variable is altered in a function
Q73.
14.A program to demonstrate how to prevent the side effects of global variables being declared as const data type
15.A program to display the number and its square from 0 to 10 using register variables.
16.A program to display 1 to 10 with addition of 100 using the automatic variable
17.A program to display 1 to 10 with addition of 100 using the static variable
Q74.
18.A program to define a variable as an external data type and to display the contents of the variable.
19.A program to define a variable as a const data type and display the contents of the variable.
20.A program to define a variable as a const data type and display the contents of the variable without initialization
Q75.
21.A program to define a variable as a volatile data type and display the contents of the variable.
22.A program to find the sum of given non-negative integer numbers using a recursive function
23.A program for microprocessor simulator using the macro definition
- What is a function? List out the advantages and disadvantages of using functions in C++.
- How a function is declared in C++?
Q76.
- What is meant by call by reference and call by value?
- What is the purpose of the return statement?
- What is meant by the function arguments, function call and return values?
- List out the rules normally governing the use of the return statement.
- In C++, can a function be called from more than one place within a program?
- How is a function declaration different from the function definition?
Q77.
- What is meant by the scope of variables? Summarise the variable types of storage class in C++?
- What is an automatic variable and what is the use of it?
- Explain how data can be initialised in the automatic variable.
- What is meant by the register variable and what is the scope of it?
- How is a register variable different from an automatic variable?
- What is a static variable and what is its scope?
Q78.
- How are data elements initialised in the case of static type variable?
- How is a static variable different from an automatic variable?
- What is the use of the external data type in C++?
- What is a recursive function? List out the merits and demerits of the function.
- How is a recursive function different from an ordinary function?
- What is the storage class used in a recursive function?
Q79.
- What is a preprocessor in C++?
- What is a macro and how is it different from a preprocessor?
- What is a header file in C++? What is the purpose of using these files in C++?
- What is meant by command line arguments?
- What is a standard function and how is it useful for a developing program?
- List out the C++ preprocessor directives and their uses.
Q80.
- What is meant by macro operators?
- Distinguish between a #include and #define.
- What is meant by conditional compilation?
- List out the various operators of library function.
- Summarise the purpose of function.
- What are the different functions involved in ?
Q81.
1.Determine the output of each of the following programs when it is executed.
(a)
include using namespace std;
int main()
void display();
int x = 1;
cout <>x; display();
cout <>< x;=”” return=””>
void display()
(b)
int x = 5;
cout <‘t’><>
include using namespace std; int main()
void display1(void);
void display2(void);
int x = 1;
cout < x;=””>
cout < ‘t’=””><>x; display2();
cout < ‘t’=””>< x;=”” return=””>
void display1()
int x = 5;
cout <‘t’><>
void display2()
(c)
int x = 10;
cout <‘t’><>
include using namespace std;
int main()
void display1(void); int x = 1;
cout < x;=””>
cout <>< x;=”” return=””>
void display1()
void display2(void); int x = 5;
cout <‘t’>< x;=””>
cout <‘t’><>
void display2()
int x = 10;
cout <‘t’><>
(d)
include using namespace std;
int main()
int display1(int x);
int x = 1;
cout x;
x = display1(x); cout <‘t’>< x;=”” return=””>
int display1(int x)
(e)
int y = 5; x += y;
cout <‘t’>< x;=”” return=””>
include using namespace std;
int main()
int display1(int x); int x = 1;
cout x;
x = display1(x); cout <‘t’>< x;=”” return=””>
int display1(int x)
void display2(int x); int y = 5;
x += y;
cout <‘t’>< x;=”” display2(x);=”” return=””>
void display2(int x)
(f)
int y = 10; x += y;
cout <‘t’><>
include using namespace std;
int x = 10;
int main()
void display1(); cout <>
display1();
cout <‘t’>< x;=”” return=””>
void display1()
(g)
int y = 1; x += y;
cout <‘t’><>
include using namespace std;
static int x = 10;
int main()
void display1(); cout < x;=””>
cout <‘t’>< x;=”” return=””>
void display1()
(h)
int y = 1; x += y;
cout <‘t’><>
include using namespace std;
extern int x = 10;
int main()
int display1(); cout <>
x = display1(); cout <>< x;=”” return=””>
int display1()
(i)
static int x = 1; x++ ;
cout <>< x;=”” return=””>
include using namespace std;
extern int x = 10;
int main()
void display1(); cout <>
display1();
cout <>< x;=”” return=””>
void display1()
static int x = 1; x++;
cout <><>
Q82.
2.What will be the output of each of the following programs when it is executed?
(a)
include using namespace std; int main()
int sum (int i,int j); int i = 10,j = 20,total; total = sum (i,j);
cout < “=”” total=”””>< total;=”” return=””>
int sum (int a, int b)
(b)
cout < “i=”””>< a=””>< ‘t’;=”” cout=””>< “j=”””>< b=””>< ‘t’;=”” return=””>
include using namespace std; int main()
int sum (int i,int j); int i = 10,j = 20,total; total = sum (i,j);
cout < “=”” total=”””>< total;=”” return=””>
int sum (int a, int b)
(c)
cout < “i=”””>< a=””>< ‘t’;=”” cout=””>< “j=”””>< b=””>< ‘t’;=””>
include using namespace std; int main()
int display(); int total;
total = display();
cout <“total ==”” ”=””>< total;=”” return=””>
int display()
int i = 10, j = 20, k = 30, m = 40; return (i,j,k,m);
(d)
include using namespace std; int main()
int display (int i); int sum,i = 10;
sum = display (i);
cout <“sum ==”” ”=””>< sum;=”” return=””>
int display (int a)
return (a++);
(e)
include using namespace std; int main()
int display_main (int i); int sum,i = 10;
sum = display_main (i); cout <“sum ==””>< sum;=”” return=””>
int display_main (int i)
int display_one (int i); int a;
a = display_one(i); return (a++);
int display_one (int i)
int display_two (int i); int a;
a = display_two(i); return (a++);
int display_two (int i)
return (i++);
(f)
include using namespace std; int main()
int display_main (int i); int sum,i = 10;
sum = display_main (i); cout <“sum ==””>< sum;=”” return=””>
int display_main (int i)
int display_one (int i); int a;
a = display_one(i); return (++a);
int display_one (int i)
int display_two (int i); int a;
a = display_two(i); return (++a);
int display_two (int i)
return (++i);
(g)
// default function call #include using namespace std;
int main()
int display(); int sum;
sum = display();
cout <“sum ==””><>sum; return 0;
int display()
(h)
// default function call #include using namespace std;
int main()
int display1(); int display2(); int display3();
int sum;
sum = display1()+ display2() + display3(); cout <“sum ==”” ”=””><>
return 0;
int display1()
int display2()
int display3()
Q83.
- Determine the output of each of the following programs when it is executed: (a)
include using namespace std; int main()
void display(); display();
cout < “in=”” main=”” …n”;=”” return=””>
void display()
void display_inner(); display_inner();
cout < “within=”” a=”” function=”” 1=””>
void display_inner()
void display_innermost(); display_innermost();
cout <“now inside=”” the=”” function=”” 2=””>
void display_innermost()
cout < “innermost=””>
(b)
include using namespace std; int main()
int display(int a); int a = 10;
int b = display(a); cout < “=”” b=”””>< b;=”” return=””>
int display(int i)
int display_inner(int a);
int j = display_inner(i); cout < “j=”””>< j;=”” return=””>
int display_inner(int i)
return (++i);
(c)
include using namespace std; int main()
int display(int a); int a = 10; display(a);
cout < “=”” a=”””>< a;=”” return=””>
int display(int i)
int display_inner(int a); display_inner(i);
cout < “i=”””>< i;=”” return=””>
int display_inner(int i)
return (++i);
(d)
include using namespace std; int main()
int display(int a); int a = 10;
a = display(a);
cout < “=”” a=”””>< a;=”” return=””>
int display(int i)
int display_inner(int a); i = display_inner(i); cout < “=”” i=”””>< i;=””> (++i);
int display_inner(int i)
return (++i);
(e)
include using namespace std;
int main()
int display(int a); int a = 10;
a = display(a);
cout < “=”” a=”””>< a;=”” return=””>
int display(int i)
int display_inner(int a); i = display_inner(i); cout < “=”” i=”””>< i;=””> (i++);
int display_inner(int i)
return (i++);
(f)
include using namespace std; int main()
int display(int i); int sum,a;
sum = display(a);
cout < “=”” sum=”””>< sum;=”” return=””>
int display(int i)
return (++i);
(g)
include using namespace std; static int a;
int main()
int display(int i); int sum;
sum = display(a);
cout < “=”” sum=”””>< sum;=”” return=””>
int display(int i)
return (++i);
(h)
include using namespace std; static int a;
int main()
int display(int i); int sum;
sum = display(a) + display(a) + display (a); cout < “=”” sum=”””><>
return 0;
int display(int i)
return (i++);
(i)
include using namespace std; static int a;
int main()
int display(int i); int sum;
sum = display(a) + display(a) + display (a); cout < “=”” sum=”””><>
return 0;
int display(int i)
return (++i);
(j)
include using namespace std; int main()
const volatile int display (const volatile int a); const volatile int a = 10;
cout < “=”” value=”” of=”” a=”” (in=”” main)=”””>< a=””>< ‘n’;=”” display=””>
cout < “=”” value=”” of=”” a=”” (after=”” function=”” call)=”””>< a;=”” cout=””><>
return 0;
const volatile int display (const volatile int a)
cout < “=”” value=”” of=”” a=”” (inside=”” function)=”””>< a;=”” cout=””><>
include using namespace std; int main()
const static int a = 10; cout < “a=”””>< a=””> ‘n’;
Q84.
- Write a function in C++ to generate a Fibonacci series of ‘n’ numbers, where n is defined by a programmer.
(The series should be: 1 1 2 3 5 8 13 21 32 and so on.)
- Write a function in C++ to generate the following series of numbers:
(a) number = 1 2 3 4 … n
(b) number = 0 2 4 6 … n
(c) number = 1 3 5 7 … n
(d) number = 1 22 32 42 … n2
(e) number = 1 23 33 43 … n3
- Write a function in C++ to generate the following pyramid of numbers:
0
1
0
1
2
1
0
1
2
3
2
1
0
1
2
3
4
3
2
1
0
1
2
3
4
5 4
3
2
1
0
1
2
3
4 5
6 5 4
3
2
1
0
1
2
3
4 5 6
Q85.
- Develop a program in C++ to find the largest of any three numbers using a macro definition.
- Write a macro in C++ to find the odd and even numbers from a given set of numbers.
- Write a macro in C++ to find the cube of any three numbers.
- Write a macro to find the power of given numbers.
- Write a macro in C++ to swap two data items.
- Write a macro in C++ to find the factorial of a given number.
- Write a macro in C++ to find the sum of the following series: (i) sum = 1-3+5-7…n
(ii) sum = 22 +44 +66+ … nn
(iii) sum = 1 +
1 + 1
2! 3!
- … 1
n!
Q86.
1.A program to initialise a set of numbers in an array and to display them onto a standard output device along with a newline character (n) between the elements.
2.A program to initialise a set of numbers in an array and to display them onto a standard output device along with a tab space character (t) between the elements.
3.A program to demonstrate how to use the iomanip functions for formatting the elements of an array:
Q87.
include using namespace std; int main() int a[10] = 0,1,2,3,4,5,6,7,8,9; int i; cout <<“Contents of the array ” << endl; for (i = 0; i <= 9; ++i) cout << setw(5) << a[i]; return 0; “>
4.A program to read ‘n’ numbers from the keyboard (where‘n’ is defined by the programmer) to store it in an one-dimensional array and to display the content of that array onto the video screen
5.A program to read a set of numbers from the keyboard and to find out the largest number in the given array (the numbers are stored in a random order).
6.A program to read a set of numbers from the standard input device and to sort them in ascending order.
Q88.
7.A program to read a set of numbers from the keyboard and to find out the sum of all elements of the given array using a function.
8.A program to read a set of numbers from the keyboard and to sort out the given array of elements in ascending order using a function.
9.A program to read a number n, and print it out digit by digit, as a series of words. For example, the number 756, should be printed as “Seven Five Six”.
Q89.
10.A program to read a set of numbers and to store it as a one-dimensional array; again read a number ‘d’ and check whether the number ‘d’ is present in the array. If it is so, print how many times the number ‘d’ is repeated in the array.
11.A program to read a set of numbers and store it as a one-dimensional array; again read a number n and check whether it is present in the array. If it is so, print the position of n in the array and also check whether it is repeated in the array.
Q90.
12.A program to read the elements of a given matrix of order n × n and to display the contents of the matrix on the screen.
13.A program to initialise a set of numbers in a two-dimensional array and to display the content of the array on the screen.
14.A program to initialise only a few elements of a two-dimensional array and to display the content of the array on the screen.
Q91.
15.A program to read the elements of the given two matrices of order n × n and to perform the matrix addition.
16.A program to read the elements of the given two matrices of order n × n and to perform the matrix subtraction
17.A program to read the elements of the given two matrices of order n × n and to perform the matrix multiplication.
Q92.
18.A program to find the sum of the elements of a given three dimensional array in which data are read from the keyboard.
19.A program to initialise a set of characters in a one-dimensional character array and to display the content of the given array.
20.A program to initialise a string of characters in a one-dimensional array and to display the content of the array.
Q93.
21.A program to read a set of lines from the keyboard and to store it in a one-dimensional array and to display the content of the array on the screen.
22.A program to read a set of lines from the keyboard; store it in a one-dimensional array; find the number of characters of a given text and also display the contents of the array on the screen.
Q94.
23.A program to read a set of lines from the keyboard; store it in a one-dimensional array; find the number of characters and lines in a given text and also display the contents of the array on the screen.
24.A program to read a set of lines from the keyboard; store it in a one-dimensional array A; remove white spaces such as horizontal tab, vertical tab, back space, line feed and new line from the contents of the array and display the contents of array.
Q95.
- What is an array? Explain how an array variable is different from an ordinary variable.
- What is an array indexing?
- Explain how the individual elements are accessed and processed in an array.
- State the rules used to declare a one-dimensional array.
- What is meant by array initialisation?
- Explain the salient features of an array and their uses.
- How are arrays usually processed in C++?
Q96.
- Can an array name be used as an argument to a function? Explain.
- Summarise the rules for passing arrays to a function.
- What is a multidimensional array and how is it different from a one-dimensional array?
- Summarise the syntatic rules to be governed for declaring a multidimensional array.
- How are data elements intilialised in a multidimensional array? What are the scope rules for the multidimensional array?
- Explain how the individual elements of a multidimensional array are accessed and processed.
Q97.
- What is a character array? How is it different from other data type arrays?
- Distinguish between a character array and a string.
- Can a list of strings be stored within a two-dimensional array?
- Explain the differences between an array of characters and an array of integers.
- Explain the pros and cons of a multidimensional array over a single dimensional in C++.
- Summarises the various formats for declaring two-dimensional arrays in C++.
Q98.
1.Determine the output of each of the following program when it is executed.
(a)
include using namespace std; int main()
(b)
const int a[6] = 1,2,3,4;
cout <“contents of=”” the=”” arrayn”;=”” for=”” (int=”” i=”0;” i=””><= 5;=””>
cout < a[i]=””>< ‘t’;=”” return=””>
include using namespace std; int main()
int a[5] = 1,2,3,4,5;
cout <“contents of=”” the=”” arrayn”;=”” for=”” (int=”” i=”0;” i=””><= 4;=”” ++i)=””>
a[i] = i*i;
cout < a[i]=””><>
(c)
return 0;
include using namespace std;
int main()
const int a[5] = 1,2,3,4,5; cout <“contents of=””> arrayn”; for (int i = 0; i <= 4;=””>
a[i] = i*i;
cout < a[i]=””><>
(d)
return 0;
include using namespace std; int main()
static int a[5] = 1,2,3,4,5; void display (int a[],int n); int n = 5;
cout <“contents of=”” the=”” array=”” in=”” mainn”;=”” for=”” (int=”” i=”0;” i=””><= n-1;=”” ++i)=””>
a[i] = i*i;
cout < a[i]=””><>
display(a,n); return 0;
}
void display(int a[],int n)
cout <“ncontents of=”” the=”” array=”” in=”” functionn”;=”” for=”” (int=”” i=”0;” i=””><= n-1;=”” ++i)=””>
a[i] = i*i;
cout < a[i]=””><>
}
(e)
include using namespace std; int main()
static int a[5] = 1,2,3,4,5; void display (int a[],int n); int n = 5;
cout <“contents of=”” the=”” array=”” in=”” mainn”;=”” for=”” (int=”” i=”0;” i=””><= n-1;=”” ++i)=””>
a[i] = a[i] % 2;
cout < a[i]=””><>
display(a,n); return 0;
}
void display(int a[],int n)
cout <“ncontents of=”” the=”” array=”” in=””>
for (int i = 0; i <= n-1;=”” ++i)=”” =”” a[i]=”i” %=””>
cout < a[i]=””><>
(f)
include using namespace std; int main()
int a[] = 1,2,3,4,5;
cout <“contents of=”” the=”” arrayn”;=”” for=”” (int=”” i=”0;” i=””><= 4;=””>
cout <“a[”>< i=””><“] ==”” ”=””>< a[i]=””>< ‘n’;=”” return=””>
Q99.
- What will be the output of each of the following program when it is executed? (a)
include #include using namespace std; int main()
int a[3][3] =
1,
0,1,
0,0,1
;
cout <“contents of=”” the=”” array=”” n”;=”” for=”” (int=”” i=”0;” i=””><= 2;=”” ++i)=””>
for (int j = 0; j <= 2;=”” ++j)=”” cout=””>< a[i][j]=””><>
cout <>
(b)
}
return 0;
include #include using namespace std; int main()
int sum(int a[3][3], int n); void display(int a[3][3],int n); int n = 3,total;
int a[3][3] =
1,
0,1,
0,0,1
;
display(a,n); total = sum(a,n);
cout < “sum=”” of=”” all=”” elements=”” in=”” the=”” array=””><>
void display (int a[3][3],int n)
cout <“contents of=”” the=”” array=”” n”;=”” for=”” (int=”” i=”0;” i=””><= n-1;=”” ++i)=””>
for (int j = 0; j <= n-1;=”” ++j)=”” cout=””>< a[i][j]=””><>
cout <>
}
int sum (int a[3][3],int n)
int temp = 0;
for (int i = 0; i <= n-1;=”” ++i)=”” =”” for=”” (int=”” j=”0;” j=””><= n-1;=””>
temp = temp+a[i][j];
(c)
return (temp);
include #include using namespace std; int main()
int sum(int a[3][3], int n); void display(int a[3][3],int n); int n = 3,total;
int a[3][3] =
1,2,13,
4,15,6,
17,8,9
;
display(a,n); total = sum(a,n);
cout < “sum=”” of=”” all=”” diagonal=”” elements=”” in=”” the=”” array=””><>
void display (int a[3][3],int n)
cout <“contents of=”” the=”” array=”” n”;=”” for=”” (int=”” i=”0;” i=””><= n-1;=”” ++i)=””>
for (int j = 0; j <= n-1;=”” ++j)=”” cout=””>< setw(6)=””><>
cout <>
}
int sum (int a[3][3],int n)
int temp = 0, max = n-1;
for (int i = 0; i <= n-1;=”” ++i)=”” =”” for=”” (int=”” j=”0;” j=””><= n-1;=””>
if ( j == max)
temp = temp+a[i][j]; max—–;
(d)
return (temp);
include #include using namespace std; int main()
int sum(int a[3][3], int n); void display(int a[3][3],int n); int n = 3,total;
int a[3][3] =
1,2,13,
4,15,6,
17,8,9
;
display(a,n); total = sum(a,n);
cout < “sum=”” of=”” all=”” diagonal=”” elements=”” in=”” the=”” array=””><>
void display (int a[3][3],int n)
cout <“contents of=”” the=”” array=”” n”;=”” for=”” (int=”” i=”0;” i=””><= n-1;=”” ++i)=””>
for (int j = 0; j <= n-1;=”” ++j)=”” cout=””>< setw(6)=””><>
cout <>
}
int sum (int a[3][3],int n)
int temp = 0;
for (int i = 0; i <= n-1;=”” ++i)=”” =”” for=”” (int=”” j=”0;” j=””><= n-1;=””>
if ( i == j)
temp = temp+a[i][j];
(e)
return (temp);
include using namespace std; int main()
int a[5] = 1,2,3,4,5;
int sum (int a[],int n); int n = 5,total = 0;
cout <“contents of=”” the=”” array=”” in=”” mainn”;=”” for=”” (int=”” i=”0;” i=””><= n-1;=”” ++i)=””>
a[i] = a[i] % 5;
cout < a[i]=””><>
total = sum(a,n);
cout < “n=”” sum=”” of=”” all=”” elements=”””>< total=””>< “n”;=”” return=””>
}
int sum (int a[],int n)
int temp = 0;
for (int i = 0; i <= n-1;=”” ++i)=”” temp=””>
return (temp);
Q100.
- Write a program in C++ to read an integer number and find out the sum of all the digits till it reduces to a single digit using an array. For example,
(i) n = 1256
sum = 1+2+5+6 = 14
sum = 1+4 = 5
(ii) n = 7896
sum = 7+8+9+6 = 30
sum = 3+0 = 3
- Write a program in C++ to read a set of numbers up to n (where n is defined by the programmer) and print the contents of the array in reverse order.
For example, for n = 4, let the set be
26 56 51 123
which should be printed as
123 51 56 26
Q101.
- Write a program in C++ to read n numbers (where n is defined by the programmer) and find the average of the non-negative integer numbers. Find also the deviation of the numbers.
- Write a program in C++ to read a set of numbers and store it in a one-dimensional array; to find the largest and the smallest number. Find also the difference between the two numbers. Using the difference, find the deviation of the numbers of the array.
Q102.
- Write a program in C++ to read a set of numbers to store it in a one-dimensional array A; copy the elements into another array B in the reverse direction; find the sum of the individual elements of the array A and B. Store the results in another array C and display all the three arrays.
- Write a program in C++ to read a four digit positive integer number n and generate all the possible permutation of numbers using the above digits. For example, n = 7812 then the permutations are
7821
8721
8712
2871
2817
(Hint: Read a number n and separate it digit by digit and store it in an array and then generate a permutation.)
Q103.
- Write a program in C++ to read a two-dimensional square matrix A and display its transpose. Transpose of matrix A is obtained by interchanging all the elements of rows and columns of original matrix A.
- Write a program in C++ to read a two-dimensional array and find the sum of the elements in each row and column separately and display the sum of the elements in the rows and columns.
- Write a program in C++ to generate a magic square A, where the sum of the elements in each row and column are the same.
- Write a program in C++ to read a set of lines and find out the number of characters, words, and lines in a given text.
Q104.
- Write a program in C++ to read a line and find out the number of vowels (a, e, i, o, u) and consonants present in the given line.
- Write a program in C++ to read a set of lines from the stdin and print out the longest line.
- Write a program in C++ to read a line, encode the line and display the original and encoded form.
The encode should be
a b c d … z
z y x w … a
- Write a program to read an encoded form of a line given in the above problem (No 16) and display the decoded form on the stdout.
- Write a program to read any four characters and print out all the possible combinations. For example, for ABCD
ACBD ADBC ADCB
.
.
.
Q105.
- Write a program to read a student’s name and his average mark. If a student gets less than 40 then declare that he has failed or else passed. Prepare a computer list to give the list of names in alphabetical order separately for passed and failed students.
- Write a program to read the names of books, authors and accession numbers of all books in a library. Check whether the given accession number is present in the array, if it is not, print the name of the book and the author’s name.
- Write a program to read a set of lines from stdin and store them in an array A. Again read a string S from the stdin and check whether the given string S is in the array A. If it is so, print that line and also how many times the string is repeated in the array A.
Q106.
- Write a program to read a set of lines from stdin and store them in an array A. Again read a string S from the stdin and check whether the given string S is in the array A. If it is not, remove string S from the array A and print the updated array on the stdout. For example,
A = concatenate S = cat
The updated A is conenate
- Write a program to read a set of lines from stdin and store them in an array A. Again read strings S1 and S2 from the stdin and check whether the given string S1 is in the array A. If it is not, replace the string S1 with string S2 and print the updated array. For example,
A = concatenate S1 = cat
S2 = 123
The updated A is con123enate
Q107.
1.A program to assign an address of an integer variable to the pointer variable and display the content of and address of the pointer
2.A program to assign a character variable to the pointer and display the content of the pointer
3.A program to display the address and the content of a pointer variable
4.A program to assign the pointer variable to another pointer and display the contents of both the pointer variables.
Q108.
5.A program to display the memory address of a variable using pointer before incrementation and after incrementation.
6.A program to display the memory address of a variable using pointer before decrementation and after decrementation
7.A program to display the memory address of a variable using a pointer; add an integer quantity with the pointer and to display the contents of the pointer
Q109.
8.A program to display the address and content of a pointer variable; subtract with an integer quantity and to display the address of and the contents the pointer variable
9.A program to display the contents of the pointer variables using arithmetic operation
10.A program to display the contents of a pointer variable before and after incrementation
11.A program to display the contents and the address of a pointer variable using different types of incrementation.
Q110.
12.A program to display the content of a pointer variable using an ordinary and pointer arithmetic
13.A program to exchange the contents of two variables using a call by value
14.A program to display the contents of a variable using call by value in both main and a function.
15.A program to exchange the contents of two variables using call by reference (version 1).
16.A program to exchange the contents of two variables using call by reference (version 2).
Q111.
17.A program to display the contents of a variable using call by reference in both main and a function
18.A program to display the contents of a variable and its memory address using call by reference in both main and a function
19.A program to find the sum of three numbers using a pointer to function method.
20.A program to demonstrate how a pointer to a function is declared to perform simple arithmetic operations such as addition, subtraction, multiplication and division of two numbers
Q112.
21.A program to demonstrate how a function can be passed to another function as a formal argument. This program peforms addition and subtraction of two floating point numbers by another function which takes the formal arguments of the functions add (), sub () and returns the result
23.A program to display the content of an array using a pointer arithmetic (version 2)
24.A program to display the contents of a two-dimensional array using a pointer arithmetic.
Q113.
25.A program to display the contents of pointers using an array of pointers
26.A program to read a string from the stdin and to display it in the video screen using a pointer technique
27.A program to find the number of characters in a given string using a pointer method.
28.A program to copy the contents of one string to another string using a pointer method.
Q114.
29.A program to concatenate the given two strings into a one string using a pointer method
30.A program to declare the pointer to pointer variable and display the contents of these pointers.
31.A program to declare the pointer to a pointer to a pointer variable and display the contents of these pointers
Q115.
- What is a pointer? What are the uses of pointers in C++?
- How is a pointer variable different from an ordinary variable?
- What is meant by the address of a memory cell?
- What is meant by address operator?
- What are the scope rules of a pointer variable?
- What is the use of an indirection operator?
- How is a pointer variable declared in C++?
Q116.
- What is the relationship between a pointer and an array?
- How can an indirection operator be used to access a multidimensional array?
- Explain how a portion of an array can be passed onto a function.
- How can a one-dimensional array of pointers be used to represent a collection of strings?
- Under what conditions two pointer variables can be added?
- Under what conditions two pointer variables can be subtracted?
Q117.
- Under what conditions two pointer variables can be compared?
- What is the relationship between a pointer and a function name?
- What is meant by pointer to pointer? What is its advantage?
- What is meant by the call by value and call by reference?
- What are the advantages of declaring a pointer variable in a function declaration?
Q118.
- Under what conditions the call by reference is preferred than the call by value?
- What is meant by pointers to pointers?
- What is an array of pointers?
- What is the difference between the array of pointers and pointer to the array?
- Explain how a pointer to function can be declared in C++.
- What is meant by passing a function to another function as an argument?
Q119.
1.Determine the output of each of the following program when it is executed.
(a)
include using namespace std;
int main()
(b)
int a = 10; int *ptr1; ptr1 = &a;
cout < “=”” ++(ptr1)=”””>< ++(ptr1)=””><“n”; return=””>
include using namespace std;
int main()
(c)
int a = 10; int *ptr1; ptr1 = &a;
cout < “=”” (ptr1)++=”””>< (ptr1)++=””><“n”; return=””>
include using namespace std;
int main()
(d)
int a = 10; int *ptr1; ptr1 = &a;
cout < “=”” *ptr1++=”””>< *ptr1++=””><“n”; return=””>
include using namespace std;
int main()
int a = 10; int *ptr1; ptr1 = &a;
(e)
cout < “=”” ++ptr1=”””>< ++ptr1=””><“n”; return=””>
include using namespace std;
int main()
(f)
int a = 10; int *ptr1; ptr1 = &(++a);
cout < “=”” *ptr1=”””>< *ptr1=””><“n”; return=””>
include using namespace std;
int main()
int a = 10; int *ptr1; ptr1 = &(a++);
cout < “=”” *ptr1=”””>< *ptr1=””><“n”; return=””>
(g)
include using namespace std; int main()
(h)
bool ag = false; bool *ptr1;
ptr1 = & ag;
cout < “=”” *ptr1=”””>< *ptr1=””><“n”; return=””>
include using namespace std; int main()
(i)
bool ag = true; bool *ptr1;
ptr1 = & ag;
cout < “=”” *ptr1=”””>< *ptr1=””><“n”; return=””>
include using namespace std; int main()
void display (int *abc);
int a = 10, *ptr; ptr = &a; display(ptr); return 0;
void display(int *abc)
cout <“*ptr ==”” ”=””>< *abc;=”” cout=””><>
Q120.
2.What will be the output of each of the following program when it is executed?
(a)
include
using namespace std; int main()
void display (int *abc); int a = 10, *ptr;
ptr = &a;
cout < *ptr=””>< ‘t’;=””>
cout < *ptr=””>< endl;=”” return=””>
void display(int *abc)
cout < (*abc)++=””><>
(b)
include using namespace std; int main()
void display (int *abc); int a = 10, *ptr;
ptr = &a;
cout < *ptr=””>< ‘t’;=””>
cout < *ptr=””>< endl;=”” return=””>
void display(int *abc)
cout < ++(*abc)=””><>
(c)
include using namespace std; int main()
void display (int *); int a = 10, *ptr;
ptr = &a;
cout < *ptr=””><>
display(ptr);
cout < *ptr=””>< ‘t’;=”” return=””>
void display(int *abc)
void display2(int ); cout < ++(abc)=””><>‘t’; display2(abc);
void display2(int *a)
cout < ++(*a)=””><>
(d)
include using namespace std; int main()
void display (int *); int a = 10, *ptr;
ptr = &a;
cout < *ptr=””>< ‘t’;=””>
cout < *ptr=””>< ‘t’;=”” return=””>
void display(int *abc)
void display2(int ); cout < ++(abc)=””><>‘t’; display2(abc);
cout < *abc=””><>
void display2(int *a)
cout < ++(*a)=””><>
(e)
include using namespace std; int main()
void display (int *); int a = 10, *ptr;
ptr = &a;
cout < *ptr=””>< ‘t’;=””>
cout < *ptr=””>< ‘t’;=”” return=””>
void display(int *abc)
void display2(int ); cout < ++(abc)=””><>‘t’; display2(abc);
cout < *abc=””><>
void display2(int *a)
cout < (*a)++=””><>
(f)
include using namespace std; int main()
void display (int *); int a = 10, *ptr;
ptr = &a;
cout < *ptr=””>< ‘t’;=””>
cout < *ptr=””>< ‘t’;=”” return=””>
void display(int *abc)
void display2(int ); cout < ++(abc)=””><>‘t’; display2(abc);
cout < *abc=””><>
void display2(int *a)
cout < —(*a)=””><>
(g)
include using namespace std; int main()
void display(int *ptr); const int x = 10;
cout < “=”” x=”””>< x=””>< endl;=””>
cout < “=”” x=”””>< x=””>< endl;=”” return=””>
void display(int *ptr)
cout < “=”” x=”””>< *ptr=””><>
Q121.
- Determine the output of each of the following program when it is executed. (a)
include
using namespace std; int main()
(b)
static char *ptr[4]; ptr[0] = “Hyderabad”; ptr[1] = “Mumbai”; ptr[2] = “Chennai”; ptr[3] = “New Delhi”; cout < ptr[3]=””>< endl;=”” cout=””>< ptr[2]=””>< endl;=”” cout=””>< ptr[1]=””>< endl;=”” cout=””>< ptr[0]=””>< endl;=”” return=””>
include using namespace std; int main()
(c)
static char *ptr[4]; ptr[0] = “Hyderabad”; ptr[1] = “Mumbai”; ptr[2] = “Chennai”; ptr[3] = “New Delhi”;
for (int i = 0; i <= 3;=”” ++i)=”” cout=””>< ptr[i]=””><>
return 0;
include using namespace std; int main()
(d)
int *ptr1; int **ptr2; int data; data = 100;
ptr1 = &(++data); ptr2 = &ptr1;
cout < “contents=”” of=”” ptr1=”””>< *ptr1;=”” cout=””>< “n=”” contents=”” of=”” ptr2=”””> **ptr2; return 0;
include using namespace std; int main()
int *ptr1; int **ptr2; int ***ptr3; int data; data = 10; ptr1 = &data;
(e)
ptr2 = &ptr1; ptr3 = &ptr2;
cout < “n=”” contents=”” of=”” ptr1=”””>< *ptr1;=”” cout=””>< “n=”” contents=”” of=”” ptr2=”””>< **ptr2;=”” cout=””>< “n=”” contents=”” of=”” ptr3=”””>< ***ptr3;=”” return=””>
include using namespace std; int main()
(f)
int a = 2, b = 3, c = 5; int *ptr;
cout < a=””>< ‘t’=””>< b=””>< ‘t’=””>< c;=”” cout=””><>
ptr = &a;
*ptr = 10; ptr = &b;
*ptr = 20; ptr = &c;
*ptr = 30;
cout < a=””>< ‘t’=””>< b=””>< ‘t’=””>< c;=”” cout=””><>
return 0;
include using namespace std; int main()
(g)
int abc = 10; int *ptr = &abc;
cout < “*ptr=”””>< *ptr=””><>
++abc;
cout < “*ptr=”””>< *ptr=””>< endl;=”” return=””>
include using namespace std; int main()
int abc = 10;
int *ptr1, *ptr2; ptr1 = &abc;
cout < “*ptr1=”””>< *ptr1=””><>endl; ptr2 = ptr1;
++abc;
cout < “*ptr1=”””>< *ptr1=””>< endl;=”” cout=””>< “*ptr2=”””>< *ptr2=””>< endl;=”” return=””>
Q122.
- Write a program in C++ to read a set of characters using a pointer and to print in the reverse order. Input : ravic
Output : civar
- Write a program in C++ to find a given string in a line of text using a pointer.
- Write a program in C++ to compare the two given strings using a pointer.
- Write a program in C++ to check whether a given string is a palindrome or not using the pointer method.
(Note that a palindrome is a string that reads the same both forward and backward. For example, madam, radar, malayalam, otto, 12321, etc.)
Q123.
- Write a program in C++ to find the number of words in a set of lines using a pointer.
- Write a program in C++ to sort out a set of names in the alphabetical order using pointer technique.
- Write a program in C++ to find the number of vowels in each word of a given text using a pointer.
- Write a program to read a set of lines from stdin; store them in an array A; again read a string S from the stdin and check whether the given string S is in the array A. If it is, then print that line and also how many times it repeats in the array A using pointer method.
Q124.
- Write a program to read a set of lines from stdin; store them in an array A; again read a string S from the stdin and check whether the given string S is in the array A. If is, then remove the string S from the array A and print the updated array on the stdout using pointer. For example,
A = concatenate S = cat
The updated A is concatenate
Q125.
- Write a program to read a set of lines from stdin and store them in an array A; again read strings S1 and S2 from the stdin and check whether the given string S1 is in the array A. If it is, then replace the string S1 with string S2 and print the updated array using pointer. For example,
A = concatenate S1 = cat
S2 = 123
The updated A is con123enate
Q126.
1.A program to demonstrate how to initialise the members of the structure and display the contents of the structure onto the video screen
2.A program to assign some values to the member of a structure and to display the structure on the video screen using the structure tag.
3.A program to declare the same field name for the different data types in two structures; assign some values into the corresponding fields and to display the contents of the structure.
Q127.
4.A program to assign some values to the member of a structure and copy the contents of the one structure into another and display the contents of the structure on the video screen.
5.A program to assign some values to the member of a structure and compare the contents of one structure into another and display the result of structure comparison on the video screen.
6.A program to initialise the members of a structure and display the contents of the structure on the screen
Q128.
7.A program to initialise some members of a structure and display the contents of the structure.
8.A program to demonstrate how a call by value of the function with structure data type in its arguments is realised.
9.A program to demonstrate how a call by reference of the function with structure data type in its arguments is realized
Q129.
10.A program to perform the following arithmetic operations of a complex number using a structure data type.
11.A program to demonstrate how data items are intialised in the array of structures and display the contents of the variables onto the screen.
12.A program to initialise a few members of an array of structures and display the contents of all the structures.
Q130.
13.A program to demonstrate how data items are intialised in the array of structures and display the contents of the variables onto the screen. This program illustrates how to define, declare and realise the array within the array of structures
14.A program to read a set of names from the keyboard and to sort the names in an alphabetical order. This program demonstrates how to implement and realise the array within the array of structures.
Q131.
15.A program to read students’ information such as name, roll number, age, sex, height and weight from the keyboard and to sort student’s structures in an alphabetical order in which name is key for sorting. The sorted and unsorted structures are displayed onto the video screen.
16.A program to demonstrate how to define, declare and realise a nested structure in C++.
17.A program to demonstrate how to define, declare and realise a deep nested structure in C++.
Q132.
18.A program to read a students’ information such as name, roll number, sex and date of joining like day, month and year of the institute from the keyboard and to sort the student’s structures in an alphabetical order in which name is key for sorting. The sorted and unsorted structures are displayed onto the video screen.
19.A program to assign some values to the member of a structure using an indirection operator.
Q133.
20.A program to assign some values to the member of a structure using a pointer structure operator.
21.A program to read a set of values from the keyboard using a pointer to structure operator and display the contents of the structure on the screen.
22.A program to declare a pointer variable as a member of a structure and display the contents of the structure
Q134.
23.A program to initialise the members of a union and display the contents of the union.
24.A program to declare a member of a union as a structure data type and to display the contents of the union.
25.A program to declare a union as a pointer data type and display the contents of the union using pointer operator.
Q135.
26.A program to declare the member of a structure using a bit field data type and display the contents of the structure.
27.A program to declare the member of a structure as a bit field data type using a const definition and display the contents of the structure.
28.A program to initialise the member of a structure as a bit field data type using a const definition and display the contents of the structure.
Q136.
29.A program to define the variables using typedef and to display the contents of the variable
30.A program to declare the member of a structure using typedef and to display the contents of the structure.
31.A program to declare the enumeration data type and to display the integer values on the screen.
Q137.
- What is a structure and what are its uses?
- Distinguish a structure data type with other data type variables.
- How is a structure different from an array?
- Summarise the rules governing the declaration of a structure.
- Describe how a structure can be initialised and what are the scope rules for that.
- What is meant by a member or field of a structure?
Q138.
- What is the difference between declaration of a structure and initialisation of a structure?
- What is meant by an array of fields in a structure and how is it different from an array?
- How are the data elements of a structure accessed and processed?
- What is meant by an array of structure?
- How does the formal argument of a structure passed in a function call?
- Can the return statement be used within a calling function of a structure?
- What is meant by a structure within a structure?
Q139.
- Summarize a few real life applications of a structure data type.
- What is a bit field and what is its use?
- Describe how a bit field can be used within a structure declaration.
- What is meant by a union? Differentiate between a structure data type and a union.
- What is the advantage of using a union in C++?
Q140.
- Explain how a bit field can be used within a union data type.
- What is a user-defined data type? List its merits and demerits.
- Explain the salient features of the typedef.
- How many data items can be stored in a union at any given time?
- Is the structure tag required? Give an example of a structure with no tag.
Q141.
- List the merits and demerits of the enumeration data types.
- What is the use of declaring an anonymous union in C++?
- Summarise a few real-life applications of a structure data type.
- Explain how the structures of two different types of fields can be compared and assigned.
- Explain the various methods of declaring structures in C++.
Q142.
- Determine the output of each of the following program when it is executed. (a)
include using namespace std; int main()
struct sample int x;
int y;
(b)
;
struct sample *ptr,obj; ptr = &obj;
(*ptr).x = 100;
(*ptr).y = -200;
cout <“contents of=”” x=”””>< ++(ptr).=”” x=””> ‘n’; cout <“contents of=”” y=”””>< ++(ptr).=”” y=””> ‘n’; return 0;
include using namespace std; int main()
struct sample int *x; int *y;
;
struct sample *ptr,obj; int ix = 10,iy = -20; ptr = &obj;
ptr->x = &ix; ptr->y = &iy;
cout <“contents of=”” x=”””>< (ptr).x=””><>
(c)
cout <“contents of=”” y=”””>< (ptr).y=””>< ‘n’;=”” return=””>
include using namespace std; int main()
struct sample int *x; int *y;
(d)
;
struct sample *ptr,obj; int ix = 10,iy = -20; ptr = &obj;
ptr->x = &ix; ptr->y = &iy;
cout <“contents of=”” x=”””>< ++((ptr).x)=””><>‘n’; cout <“contents of=”” y=”””>< ++((ptr).y)=””><>‘n’; return 0;
include using namespace std; int main()
struct sample int *x; int *y;
(e)
;
struct sample *ptr,obj; int ix = 10,iy = -20; ptr = &obj;
(*ptr).x = &ix;
(*ptr).y = &iy;
cout <“contents of=”” x=”””>< ++(ptr-=””>x) <>‘n’; cout <“contents of=”” y=”””>< ++(ptr-=””>y) <>‘n’; return 0;
include using namespace std; int main()
struct sample int x;
int y;
;
struct sample *ptr,obj; ptr = &obj;
ptr->x = 10;
ptr->y = -20;
cout <“contents of=”” x=”””>< ++(ptr).x=””>< ‘n’;=”” cout=””><“contents of=”” y=”””>< ++(ptr).y=””><>
return 0;
Q143.
- What will be the output of each of the following program when it is executed. (a)
include using namespace std; int main()
struct sample int x;
int y;
(b)
;
struct sample *ptr,obj; ptr = &obj;
ptr->x = 10;
ptr->y = -20; (*ptr).x++;
(*ptr).y++;
cout <“contents of=”” x=”””>< (ptr).x=””><>‘n’; cout <“contents of=”” y=”””>< (ptr).y=””><>‘n’; return 0;
include using namespace std; int main()
struct sample int x;
int y;
(c)
;
struct sample *ptr,obj; ptr = &obj;
ptr->x = 10;
ptr->y = -20;
++ptr->x;
++ptr->y;
cout <“contents of=”” x=”””>< ptr-=””>x <>‘n’; cout <“contents of=”” y=”””>< ptr-=””>y <>‘n’; return 0;
include using namespace std; int main()
struct sample int x;
int y;
;
struct sample *ptr,obj; ptr = &obj;
ptr->x = 10;
ptr->y = -20;
(d)
(ptr++)->x;
(ptr++)->y;
cout <“contents of=”” x=”””>< ptr-=””>x <>‘n’; cout <“contents of=”” y=”””>< ptr-=””>y <>‘n’; return 0;
include using namespace std; int main()
struct sample int *ptr1; int *ptr2;
(e)
;
struct sample *abc,obj;
int value1 = 10,value2 = -20; abc = &obj;
abc->ptr1 = &value1; abc->ptr2 = &value2;
cout <“contents of=”” x=”””>< *abc-=””>ptr1 <>‘n’; cout <“contents of=”” y=”””>< *abc-=””>ptr2 <>‘n’; return 0;
include using namespace std; int main()
struct sample int *ptr1; int *ptr2;
(f)
;
struct sample *abc,obj;
int value1 = 10,value2 = -20; abc = &obj;
abc->ptr1 = &value1; abc->ptr2 = &value2; abc->ptr1++;
abc->ptr2++;
cout <“contents of=”” x=”””>< *abc-=””>ptr1 <>‘n’; cout <“contents of=”” y=”””>< *abc-=””>ptr2 <>‘n’; return 0;
include using namespace std; int main()
struct sample int *ptr1; int *ptr2;
;
struct sample *obj,ptr;
int value1 = 10,value2 = -20; obj = &ptr;
obj->ptr1 = &value1; obj->ptr2 = &value2;
++(obj->ptr1);
++(obj->ptr2);
cout <“contents of=”” x=”””>< *obj-=””>ptr1 <>‘n’; cout <“contents of=”” y=”””>< *obj-=””>ptr2 <>‘n’; return 0;
Q144.
1.(a) Develop a program in C++ to create a database for the on-line Banking system. Your database should consist of the following information:
1.customer name
2.customer code
3.Type of Account (Savings, Current, Fixed)
4.Amount deposited
5.Contact Address
6.Email ID
(b)Your program should do the following things:
- build a master table
2.list a table
3.insert a new entry
4.delete an old entry
5.edit entry
6.search for a structure to be printed
7.sort entries
Q145.
- Develop a program in C++ to create a data base with the following items using a structure data type: name of the patient
sex age
ward number bed number
nature of the illness date of admission
Your program should have the facilites as in 1 (b).
- Develop a program in C++ to create a pay roll system of an organisation assuming that the following information can be read from the keyboard
employee name employee code designation account number date of joining basic pay
DA, HRA and CCA
deductions like PPF, GPF, CPF, LIC, NSS, NSC, etc.
Your program should have the facilities as in 1(b).
Q146.
- Develop a program in C++ to prepare the mark sheet of a university examination assuming that the following items are read from the keyboard:
name of the student roll number
subject code subject name internal marks external marks
Your program should have the facilities as in 1(b).
- Develop a program in C++ to create a library information system accession number
name of the author title of the book year of publication publisher’s name cost of the book
Your program should have the facilities as in 1(b).
Q147.
- Develop a program in C++ to create a data base of the personnel information system containing name
date of birth blood group height weight
insurance policy number contact address telephone number
driving licence number, etc.
Your program should have the facilities as in 1(b).
- Develop a program in C++ to create a database for the Employee Information System (EIS) of an organisation and your data base should consist of the following information:
employee name employee code designation
years of experience age
Your program should have the facilities as in 1(b).