Computer Practical File for class 12

download Computer Practical File for class 12

of 19

Transcript of Computer Practical File for class 12

  • 8/12/2019 Computer Practical File for class 12

    1/19

  • 8/12/2019 Computer Practical File for class 12

    2/19

    This is to certify that this project has

    been made by GIRISH ARORA ofclass XII Aon this topic under theguidance of our computer teacherMrs. Sangeeta mamand hasbeen completed it successfully.

    Teacher signature

  • 8/12/2019 Computer Practical File for class 12

    3/19

    I would like to express my special thanks of gratitude to

    my teacher Mr. Sangeeta mam as well as our principal

    Mrs.S.Chatterjee who gave me the golden opportunity

    to do this wonderful project, which also helped me indoing a lot of Research and I came to know about so

    many new things

    I am really thankful to them.

    Secondly I would also like to thank my parents and

    friends who helped me a lot in finishing this project

    within the limited time.

    I am making this project not only for marks but to also

    increase my knowledge.

    Thanks again to all who helped me.

  • 8/12/2019 Computer Practical File for class 12

    4/19

    Program 1: student managementsystem

    Program 2: stock management Program 3: serial/episode

    Program 4: clothing system

    Content

  • 8/12/2019 Computer Practical File for class 12

    5/19

    Program to count upper casealphabets

    Program to count blank space Program to count vowels Program to count no. of the Program to count no. of lines

    starting with A

    4/4/2013

    Program 1#include#include

    #include

    #include

    #include

    class student

    {

    private:

    char name[20];int roll_no;

    int admin_no;

    float a,b,c;

    float total;

    char school[30];

    float percentage;

    char grade[10];

    void assign(){total=a+b+c;

  • 8/12/2019 Computer Practical File for class 12

    6/19

    percentage=total/3;

    if(percentage>90)

    strcpy(grade,"A");

    else if(percentage>=80 && percentage=70 && percentage=60 && percentage>b>>c;

    }

    void display()

    {clrscr();

    assign();cout

  • 8/12/2019 Computer Practical File for class 12

    7/19

    }

    };

    int main()

    {

    clrscr();

    int ch;

    do

    {

    student s1;

    s1.enter();

    s1.display();

    { ofstream abc("student.txt",ios::binary);abc.write((char*)&s1,sizeof(s1));

    ofstream fout("student1.txt",ios::app);

    fout.write((char*)&s1,sizeof(s1));

    ofstream bin("student2.dat",ios::binary);

    bin.write((char*)&s1,sizeof(s1));

    ofstream fin("student3.dat",ios::app);

    fin.write((char*)&s1,sizeof(s1));

    }

    cout

  • 8/12/2019 Computer Practical File for class 12

    8/19

    4/4/13

    Program 2#include

    #include

    #include

    class stock{

    int icode;

    char item[20];

    float price;

    long int qty;

    float discount;

    void finddisc()

    {if(qty50 && qty100)

    discount=10;

    }public:

    void buy(){cout>icode;

    coutprice;

    cout>qty;finddisc();

  • 8/12/2019 Computer Practical File for class 12

    9/19

    }

    void showall()

    {cout

  • 8/12/2019 Computer Practical File for class 12

    10/19

    7/4/13

    Program 3#include

    #include

    #include

    #include

    class serial

    {

    private:

    int serialcode;

    char title[20];float duration;

    int noofepisodes;

    public:

    serial()

    {

    serialcode=0;

    duration=30;

    noofepisodes=10;strcpy(title,"null");

    }

    void newserial()

    {

    cout>serialcode;

    coutduration;

    cout>noofepisodes;

    }

  • 8/12/2019 Computer Practical File for class 12

    11/19

    void dispdata()

    {

    cout

  • 8/12/2019 Computer Practical File for class 12

    12/19

    7/4/13

    Program 4#include

    #include

    #include

    #include

    class clothing

    {

    char code[20];

    char type[20];float price;

    int size;

    char material[20];

    void calc_price()

    {

    float factor;

    if(!strcmp(material,"cotton"))

    factor=1;else

    factor=0.75;

    if(!strcmp(type,"trouser"))

    price=1500*factor;

    else

    price=1200*factor;

    }

    public:clothing()

    {

    strcpy(code,"not assigned");

    strcpy(type,"not assigned");

    strcpy(material,"not assigned");

    size=0;

    price=0;

    }void enter()

  • 8/12/2019 Computer Practical File for class 12

    13/19

    {

    cout

  • 8/12/2019 Computer Practical File for class 12

    14/19

    Program to count upper case alphabets{

    Iftream fin(books.txt);

    While(fin.eof());

    {fin.read(str,sizeof(str));

    For(int i=0;i

  • 8/12/2019 Computer Practical File for class 12

    15/19

    Program to count blank space{

    Iftream fin(books.txt);

    While(fin.eof());

    {fin.read(str,sizeof(str));

    For(int i=0;i

  • 8/12/2019 Computer Practical File for class 12

    16/19

    }

    Program to count vowels{

    Iftream fin(books.txt);While(fin.eof());

    {fin.read(str,sizeof(str));

    For(int i=0;i

  • 8/12/2019 Computer Practical File for class 12

    17/19

    count++;

    }

    Fin.close();

    Cout

  • 8/12/2019 Computer Practical File for class 12

    18/19

    Fin>>word;

    If(strcmp(word,the)==0)

    Count++;

    }

    Fin.close();

    Cout

  • 8/12/2019 Computer Practical File for class 12

    19/19

    Program to count no of lines startingwith A{

    Iftream fin(books.txt);

    While(fin.eof());

    {fin.read(str,sizeof(str));

    For(int i=0;i