} f.close(); cout<<"Number of words starting with amend are "<<cnt; } 2 marks for the correct any correct program which gives correct output (c) void search( long MNo) { ifstream ifile(“COMPUTER.DAT”, ios::in | ios::binary); if(!ifile) { cout<<”could not open COMPUTER.DAT file”; exit(-1); } else { COMPUTER c; int found = 0; while(!ifile.read( ( char *) &c, sizeof(c))) { 3 if( c.getModelNo( ) ==MNo) { c.stockdisplay( ); found = 1; break; } } } if(found = =0) cout<< “Given Model No is Not found”; ifile.close( ); } ½ marks for declaring stream ½ marks for opening and closing the stream 2 marks for writing any correct code which give the correct idea of function 5. (a) Data Independence is the ability to modify a scheme definition in one level without affecting a scheme definition in the next higher level. There are two levels of data independence: Physical and Logical Physical Data Independence: refers to the ability to modify the scheme followed at the physical level without affecting the scheme followed at the conceptual level. i.e 2 the application programs remains the same even though the scheme at the physical level gets modified. Logical Data Independence: refers to the ability to modify the conceptual scheme without causing any changes in the schemes followed at view level. The logical data independence ensures that the application programs remains the same. ½ marks for defining data independence. ½ mars for giving the name of both the data independence 1 mark for defining Physical and Logical data independence. (b) (i). SELECT CnorID from CONSIGNOR 1 WHERE City = ‘Mumbai’; (ii). SELECT CneeID, CnorName, CnorAddress, CneeName, CneeAddress FROM CONSIGNOR, CONSIGNEE WHERE CONSIGNOR.CnorID = CONSIGNEE.CnorID; 1
} f.close(); cout<<"Number of words starting with amend are "<<cnt; } 2 marks for the correct any correct program which gives correct output (c) void search( long MNo) { ifstream ifile(“COMPUTER.DAT”, ios::in | ios::binary); if(!ifile) { cout<<”could not open COMPUTER.DAT file”; exit(-1); } else { COMPUTER c; int found = 0; while(!ifile.read( ( char *) &c, sizeof(c))) { if( c.getModelNo( ) ==MNo) { c.stockdisplay( ); found = 1; break; } } } if(found = =0) cout<< “Given Model No is Not found”; ifile.close( ); } 3 ½ marks for declaring stream ½ marks for opening and closing the stream 2 marks for writing any correct code which give the correct idea of function 5. (a) Data Independence is the ability to modify a scheme definition in one level without affecting a scheme definition in the next higher level. There are two levels of data independence: Physical and Logical Physical Data Independence: refers to the ability to modify the scheme followed at the physical level without affecting the scheme followed at the conceptual level. i.e the application programs remains the same even though the scheme at the physical level gets modified. Logical Data Independence: refers to the ability to modify the conceptual scheme without causing any changes in the schemes followed at view level. The logical data independence ensures that the application programs remains the same. 2 ½ marks for defining data independence. ½ mars for giving the name of both the data independence 1 mark for defining Physical and Logical data independence. (b) (i). SELECT CnorID from CONSIGNOR WHERE City = ‘Mumbai’; (ii). SELECT CneeID, CnorName, CnorAddress, CneeName, CneeAddress FROM CONSIGNOR, CONSIGNEE WHERE CONSIGNOR.CnorID = CONSIGNEE.CnorID; 1 1
513150762sample_paper_cpp_class_xii.docx