Advertisements
Advertisements
Write the type of C++ token (keywords) and the User-defined identifier from the following.
1) else
2) Long
3) 4Queue
4) _count
Concept: undefined > undefined
Rewrite the following C++ code after removing any/all syntactical error with each correction underline
Note: Assume all required header files are already included in the program.
Typedef Count(int);
void main()
(
Count C;
cout<<"Enter the count:";
cin>>C;
for (K = 1 ; K<=C;K++)
cout<< C "*" K <<end1;
}
Concept: undefined > undefined
Advertisements
Write the type of C++ tokens (keywords and user-defined identifiers) from the following:
1) new
2) While
3) case
4) Num_2
Concept: undefined > undefined
Rewrite the following C++ code after removing any/all syntactical errors with each correction underlined.
Note: Assume all required header files are already being included in the program.
void main()
{
cout<<"Enter an Alphabet:" ;
cin>>CB ;
switch(CH)
case 'A' · cout<<"Ant"; Break ;
case 'B' · cout<<"Bear"; Break;
}
Concept: undefined > undefined
Find the correct identifiers out of the following, which can be used for naming Variable, Constants or Functions in a C++ program.
For, while, INT, NeW, delete, lstName, Add+Subtract, namel
Concept: undefined > undefined
Observe the following C++ code very carefully and rewrite it after removing any/all syntactical errors with each correction underlined.
Note: Assume all required header files are already being included in the program
#Define float MaxSpeed=60.5;
void main()
{
int MySpeed
char Alert='N';
cin>>MySpeed;
if MySpeed>MaxSpeed
Alert='Y';
cout<<A1ert<<endline;
}
Concept: undefined > undefined
Write the output of the following C++ program code :
Note: Assume all required header files are already being included in the program.
void Location(int &X,int Y=4)
{
Y+=2;
X+=Y;
}
void main()
{
int PX=l0,PY=2;
Location(PY);
cout<<PX<<","<<PY<<endl;
Location(PX,PY);
cout<<PX<<", "<<PY<<endl;
}
Concept: undefined > undefined
Write the output of the following C++ program code:
Note: Assume all required header files are already being included in the program.
class Eval
{
char Level;
int Point;
public:
Eval(){Level='E'; Point=O;}
void Sink(int L)
{
Level~=L;
}
void Float(int L)
{
Level+=L;
Point++;
}
void Show()
{
cout<<Level<<"#"<<Point<<endl;
}
};
void main ()
{
Eval E;
E.Sink(3);
E.Show();
E.Float(7);
E.Show();
E.Sink(2);
E.Show();
}
Concept: undefined > undefined
Study the following program and select the possible output(s) from the options (i) to (iv) following it. Also; write the maximum and the minimum values that, can be ·assigned to the variable VAL
Note:
-Assume all required header files are already being included in the program.
- random(n) function generates all integer 6, and n-1.
void main ()
{
randomize();
int VAL;
VAL=random(3)+2;
char GUESS[] ="ABCDEFGHIJK";
for(int I = 1, I = 1;I <= VAL; I++)
{
for (int J=VAL; J<= 7; J++)
cout<<GUESS[J];
cout<<endl;
}
}
1)
2)
3)
4)
Concept: undefined > undefined
Observe the following table carefully and· write the names of the most appropriate columns, which can be considered as (i) candidate keys and. (ii) primary key:
Code | Item | Qty | Price | Transaction Date |
1001 | Plastic Folder 14" | 100 | 3400 | 2014-12-14 |
1004 | Pen Stand Standard | 200 | 4500 | 2015-01-31 |
1005 | Stapler Mini | 250 | 1200 | 2015-02-28 |
1009 | Punching Machine Small | 200 | 1400 | 2015-03-12 |
1003 | Stapler Big | 100 | 1500 | 2015-02-02 |
Concept: undefined > undefined
Observe the following tables VIDEO and MEMBER carefully and write the name of the RDBMS operation out of (i) SELECTION (ii) PROJECTION (iii) UNION (iv) CARTESIAN PRODUCT, which has been used to produce the output as shown below. Also, find the
Degree and Cardinality of the final result.
TABLE: VlDEO
VNO | VNAME | TYPE |
F101 | The Last Battle | Fiction |
C101 | Angels and Devils | Comedy |
A102 | Daredevils | Adventure |
TABLE: MEMBER
MNO | MNAME |
M101 | Namish Gupta |
M102 | Sana Sheikh |
M103 | Lara James |
TABLE: FINAL RESULT
VNO | VNAME | TYPE | MNO | MNAME |
F101 | The Last Battle | Fiction | M101 | Namish Gupta |
F101 | The Last Battle | Fiction | M102 | Sana Sheikh |
F101 | The Last Battle | Fiction | M103 | Lara James |
C101 | Angels and Devils | Comedy | M101 | Namish Gupta |
C101 | Angels and Devils | Comedy | M102 | Sana Sheikh |
C101 | Angels and Devils | Comedy | M103 | Lara James |
A102 | Daredevils | Adventure | M101 | Namish Gupta |
A102 | Daredevils | Adventure | M102 | Sana Sheikh |
A102 | Daredevils | Adventure | M103 | Lara James |
Concept: undefined > undefined
What kind of data gets stored in cookies and how is it useful ?
Concept: undefined > undefined
Write the definition of a function SumEO(int VALUES[], int N) in C++, which should display the 4 sum of even value and sum of odd values of the array separately.
Example: If the array VALUES contains
25 | 20 | 22 | 21 | 53 |
Then the functions should display the output as:
Sum of even values = 42 (i.e., 20+22)
Sum of odd values= 99 (i.e., 25+21+53)
Concept: undefined > undefined
Write a definition for a function UpperHalf(int Mat[4][4]) in C++ which displays the elements in the same way as per the example is shown below.
For example, if the content of the array Mat is as follows:
25 | 24 | 23 | 22 |
20 | 19 | 18 | 17 |
15 | 14 | 13 | 12 |
10 | 9 | 8 | 7 |
Thew function should display the content in the following format:
Concept: undefined > undefined
Let us assume Data[20][15] is a two-dimensional array, which is stored in the memory along the row with each of its elements occupying 2 bytes. Find the address of the element Data(10][5], if the element Data[10][l5] is stored at the memory location 15000.
Concept: undefined > undefined
Write SQL queries for (i) to (iv) and find outputs for SQL queries (v) to (viii) which are based on the table.
TABLE: Account
ANO | ANAME | ADDRESS |
101 | Nirja Singh | Bangalore |
102 | Rohan Gupta | Chennai |
103 | Ali Reza | Hyderabad |
104 | Rishabh Jain | Chennai |
105 | Simran Kaur | Chandigarh |
TABLE: TRANSACT
TRNO | ANO | AMOUNT | TYPE | DOT |
T001 | 101 | 2500 | Withdraw | 2017-12-21 |
T002 | 103 | 3000 | Deposit | 2017-06-01 |
T003 | 102 | 2000 | Withdraw | 2017-0S-12 |
T004 | 103 | 1000 | Deposit | 2017-10-22 |
T005 | 101 | 12000 | Deposit | 2017-11-06 |
1) To display details of all transaction of TYPE Depos1t from Table TRANSACT.
2) To display the ANO and AMOUNT of all Depos1ts and Withdrawals done in the month of October 2017 from table TRANSACT.
3) To display the last date of the transaction (DOT) from the table TRANSACT for the Accounts having ANO as 103
4) To display all ANO, ANAME and DOT of those persons from tables ACCOUNT and TRANSACT who have done transactions less than or equal to 3000?
5) SELECT ANO, ANAME FROM ACCOUNT WHERE ADDRESS NOT IN ('CHENNAI', 'BANGALORE');
6) SELECT DISTINCT ANO FROM TRANSACT
7) SELECT ANO, COUNT(*), MIN(AMOUNT) FROM TRANSACT GROUP BY AND HAVING COUNT(*) > 1;
8) SELECT COUNT(*), SUM(AMOUNT) FROM TRANSACT WHERE DOT <= '2017-06-01'
Concept: undefined > undefined
State any one Absorption Law of Boolean Algebra and verily it using truth table.
Concept: undefined > undefined
ARR[15] ft:20] is a two-dimensional array, which is stored in the memory along the row with each of its elements occupying 4 .bytes. Find the .address of the element ARR[5)[15], if the element ARR[lO] [5] is stored at the memory location 35000.
Concept: undefined > undefined
Observe the following table MEMBER carefully and write the name of the RDBMS operation out of (i) SELECTION (ii) PROJECTION (iii) UNION (iv) CARTESIAN PRODUCT, which has been used to produce the output as shown in RESULT. Also, find the Degree and Cardinality of the RESULT :
MEMBER
NO | MNAME | STREAM |
M001 | JAYA | SCIENCE |
M002 | ADITYA | HUMANITIES |
M003 | HANSRAJ | SCIENCE |
M004 | SHIVAK | COMMERCE |
RESULT
NO | MNAME | STREAM |
M002 | ADI'l'YA | HUMANITIES |
Concept: undefined > undefined
Write SQL queries for (i) to (iv) and find outputs for SQL queries (v) to (viii), which are based on the tables.
DVD
DCODE | DTITLE | DTYPE |
F101 | Henry Martin | Folk |
C102 | Dhrupad | Classical |
C101 | The Planets | Classical |
F102 | Universal Soldier | Folk |
R102 | A day in life | Rock |
MEMBER
MID | NAME | DCODE | ISSUEDATE |
101 | AGAM SINGH | R102 | 2017-11-30 |
103 | ARTH JOSEPH | F102 | 2016-12-13 |
102 | NISHA HANS | C101 | 2017-07- 24 |
1) To display all details from the table MEMBER in descending order of ISSUEDATE
2) To display the DCODE and DTITLE of all Folk Type DVDs from the table DVD.
3) To display the DTYPE and number of DVDs in each DTYPE from the table DVD.
4) To display all NAME and ISSUEDATE of those members from the table. MEMBER who have DVDs issued (i.e., ISSUEDATE) in the year 2017
5) SELECT MIN(ISSUEDATE) FROM MEMBER
6) SELECT DISTINCT DTYPE FROM DVD;
7) SELECT D.DCODE, NAME, DTITLE FROM DVD D, MEMBER M WHERE D.DCODE=M.DCODE;
8) SELECT DTITLE FROM DVD WHERE DTYPE NOT IN ("Folk", "Classical" ) ;
Concept: undefined > undefined