Posts

XII-CS--A PROG TO COUNT ALPHABETS , CONSONANTS AND VOWELS IN A GIVEN TEXT FILE

#include<conio.h> #include<stdio.h> #include<fstream.h> #include<iostream.h> #include<string.h> int main() { //clrscr(); cout<<"\n..... A PROG TO COUNT ALPHABETS , CONSONANTS AND VOWELS IN A GIVEN  TEXT FILE ....\n";   char c; int alpha=0,conso=0,vow=0; ifstream fin1("abc1.txt"); cout<<"\n .. Content of file 1 is ..\n"; while(fin1) { c=fin1.get(); if ((c>='a' && c<='z')||(c>='A' && c <= 'Z')) {              alpha++;             if (c=='a' || c=='e'|| c=='i' || c=='o'|| c=='u'||c=='A'||c=='E'||c=='I'||c=='O'||c=='U') vow++;                        else conso++; } cout<<c; }                 ...

XII-CS-A PROG TO CONCAT GIVEN TWO TEXT FILE AND SAVE IN A THIRD FILE

#include<conio.h> #include<stdio.h> #include<fstream.h> #include<iostream.h> #include<string.h> int main() { //clrscr(); cout<<"\n..... A PROG TO CONCAT GIVEN TWO TEXT FILE AND SAVE IN A THIRD FILE....\n";   char c; ifstream fin1("abc1.txt"); ifstream fin2("abc2.txt"); ofstream fout1("abc3.txt"); cout<<"\n .. Content of file 1 is ..\n"; while(fin1) { c=fin1.get(); fout1<<c; cout<<c; } cout<<"\n .. Content of file 2 is ...\n"; while(fin2) { c=fin2.get(); fout1<<c; cout<<c; } fin2.close(); fin1.close(); fout1.close(); cout<<"\n\n  concatenated file 3 is...\n "; ifstream f1("abc3.txt"); while(f1) { c=f1.get(); cout<<c; } f1.close(); getch(); }

XII-CS SAMPLE PRACTCAL QUESTION-PAPER

Central Board of Secondary Education All India Senior Secondary Certificate Examination – 2013 Subject: Computer Science   (083)   Date- S.No. Description Marks 1 Problem Solving using Java 10 2 SQL Queries 5 3 Practical Record 5 4 Project Work 5 5 Viva Voce 5   Evaluation of Practical Examination:   SECTION – A Attempt any one C++ Programming assignment given below (Question is randomly selected based on chit drawn) Q1. Write a menu based program to perform the following operations on matrices (a) Add two matrixes (b) Multiply two matrixes   (c) Subtract two matrixes Q2.Write an OOP to perform the mathematical operations on complex numbers : 1-Add   2-Substract    3-Multiply Q3. Write a program to perform   following string operations w...

XII-COMPUTER SCIENCE--DATA STRUCTURE POGRAMS-2013-14 (STACK,QUEUE-- DYNAMIC LINKED LIST and ARRAY IMPLEMENTATION)

// PROG-5  Array (static) implementation of STACK #include <iostream.h> #include<ctype.h> #include<conio.h> #define MAXSIZE 10 int stack[MAXSIZE]; int top=-1;  //index pointing to the top of stack int main() { void push(int); int pop(); char ch='y';int d; while(ch=='y') {    cout<<"\n  Enter a data to be entered/pushed in stack  :  ";    cin>>d;   push(d); cout<<"\n press y to continue   PUSH  "; cin>>ch; } ch='y'; while(ch=='y') {    cout<<"\n  NOW- CURRENT data present at top of   stack  IS:  ";   cout<<pop(); cout<<"\n press y to continue POP     "; cin>>ch; } getch(); return 0; } void push(int y) {    if(top==MAXSIZE-1)    {    cout<<endl<<"STACK FULL--STACK OVERFLOW OCCURED";    return;    }    else   ...

XII-COMPUTER SCIENCE--DATA STRUCTURE POGRAMS-2013-14 (BINARY SEARCH, INSERTION,SELECTION SORT)

//PROG-1  INSERTION SORT #include<conio.h> #include<iostream.h> void main() { int a[100]; int i,j,n,temp; clrscr(); cout<<"\n                     INSERTION SORT  \n"; cout<<"   ENTER TOTAL NO. OF ELEMENTS ( N<=100 )TO BE SORTED :   "; cin>>n; cout<<"   NOW START DATA ENTRY...  \n"; for(j=0;j<n;j++) {   cout<<"\n Enter element no. "<<(j+1)<<'\t';   cin>>a[j]; } for(i=0;i<n-1;i++) {     temp=a[i+1];        j=i;       while((a[j]>temp)&&(j>=0))                {                    a[j+1]=a[j];      ...

XI C++ HOME ASSIGNMENT--SOLUTION (TEST C++ SKILLS)

CRACK TOUGH NUTS IN C++ Test your skills in C++ PART-1 “Useful for XI Computer Science Students to test their understanding lavel in C++ “ QUESTIONS WITH SOLUTION 1.Smallest Program in C++ : main(){} 2.Identify the erroes if any: main(){ return 5;} // 0 error….Because “By default main() function returns an integer”. int main(){ return 5; } //no error int main(){ return; // return <integral expression> Here function must return an integral value; }//or write void instead of int as return type of main() function. void main(){ return;} // no error char main(){ char c=65; return c; } //error- main must return an int or void no other data type int main(){ char c=65; return c; }// No error..because c has its ASCII Code as its value and that is an integer int main(){ return int(5.8999); }//0 error 0 warning int main(){ return 5.8999; } // [warning] converting to “int” from “double”—loss of data due to truncation of fractional part int main(){ return 5.8; }// [war...