Umesh Taglani,Project on C language,Final Year BCA ,Dezyne E'cole College

22
Application on C Language Submitted By Umesh Taglani BCA 2 nd Year Dezyne E’ cole College 106/10, Civil Lines, Ajmer Tel: 0145-2624679 www.dezyneecole.com6 2015-2016

Transcript of Umesh Taglani,Project on C language,Final Year BCA ,Dezyne E'cole College

Page 1: Umesh Taglani,Project on C language,Final Year BCA ,Dezyne E'cole College

Application on C Language

Submitted ByUmesh Taglani

BCA 2nd Year

Dezyne E’ cole College106/10, Civil Lines, Ajmer

Tel: 0145-2624679www.dezyneecole.com6

2015-2016

Page 2: Umesh Taglani,Project on C language,Final Year BCA ,Dezyne E'cole College

Acknowledgement

This application on “C++ Language” was developed at Dezyne E’cole College.

During the making of this project I have learnt a lot and I thank my mentor Mr. Tarun Sharma for helping us during the making of project.

With due Regards,

Umesh Taglani

BCA 2nd Year

Page 3: Umesh Taglani,Project on C language,Final Year BCA ,Dezyne E'cole College

Synopsys :-This project is made by me at Dezyne E’cole College.

Page 4: Umesh Taglani,Project on C language,Final Year BCA ,Dezyne E'cole College

4

Armstrong Calculator

Umesh TaglaniBachelor of Computer Application 2nd YearDezyne E’cole Collegewww.dezyneecole.com

Source Code

#include<iostream.h>#include<conio.h>#include<stdlib.h>class arn{ public:

long int n,l,x;

Page 5: Umesh Taglani,Project on C language,Final Year BCA ,Dezyne E'cole College

5

Armstrong Calculator

Umesh TaglaniBachelor of Computer Application2nd Year Dezyne E’cole Collegewww.dezyneecole.com

void wel(){

for(x=7;x<=17;x++){

gotoxy(23,x);cout<<"*";

}for(x=24;x<=52;x++)

{gotoxy(x,6);cout<<"*";

}for(x=7;x<=17;x++){

gotoxy(52,x);cout<<"*";

}for(x=24;x<=52;x++){

gotoxy(x,18);cout<<"*";

}}void ms(){

bg:wel();

gotoxy(30,8);cout<<"Armstrong Calculator";gotoxy(30,10);

cout<<"1. Using Number";gotoxy(30,12);

cout<<"2. Using 1 to limit";gotoxy(30,14);

cout<<"3. Limit to limit";gotoxy(30,16);cout<<"4. Exit";l1:

n=getch();

Page 6: Umesh Taglani,Project on C language,Final Year BCA ,Dezyne E'cole College

Armstrong Calculator

Umesh Taglani Bachelor of Computer Application2nd Year Dezyne E’cole Collegewww.dezyneecole.com

If(n=='1'){

f1();getch();clrscr();goto bg;

}else if(n=='2'){

f2();getch();clrscr();goto bg;

}else if(n=='3'){

f3();getch();clrscr();goto bg;

}else if(n=='4'){

exit(0);}else{

goto l1;}

}void f1()

{clrscr();wel();gotoxy(30,8);

cout<<"Enter number : ";cin>>n;long int co,c,t,m,st,s;

Page 7: Umesh Taglani,Project on C language,Final Year BCA ,Dezyne E'cole College

Armstrong Calculator

Umesh TaglaniBachelor of Computer Application2nd Year Dezyne E’cole Collegewww.dezyneecole.com

t=co=n;c=s=0;while(co>0){

c++; co=co/10;}while(t>0){ m=t%10;

st=1;for(int j=1;j<=c;j++){

st=st*m;}s=s+st;t=t/10;}

if(s==n){gotoxy(30,10);

cout<<"Number is armstrong";}else{gotoxy(30,10);

cout<<"Number Not armstrong";}

} void f2(){

clrscr();wel();gotoxy(30,8);cout<<"Enter Limit : ";cin>>n; int xc=26,yc=10;

Page 8: Umesh Taglani,Project on C language,Final Year BCA ,Dezyne E'cole College

Armstrong Calculator

Umesh TaglaniBachelor of Computer Application2nd Year Dezyne E’cole Collegewww.dezyneecole.com

for(int i=1;i<=n;i++){

long int co,c,t,m,st,s;t=co=i;c=s=0;

while(co>0){

c++;co=co/10;

}while(t>0)

{m=t%10;st=1;for(int j=1;j<=c;j++){ st=st*m;}

s=s+st;t=t/10;

}if(s==i)

{gotoxy(xc,yc);cout<<i;xc+=5;if(xc>=50){ xc=26; yc+=2;

}}

Page 9: Umesh Taglani,Project on C language,Final Year BCA ,Dezyne E'cole College

Armstrong Calculator

Umesh TaglaniBachelor of Computer Application2nd Year Dezyne E’cole Collegewww.dezyneecole.com

void f3(){

clrscr();wel();gotoxy(28,7);

cout<<"Starting Limit : ";cin>>n;gotoxy(28,8);

cout<<"Ending Limit : ";cin>>l;int xc=26,yc=10;for(int i=n;i<=l;i++){

long int co,c,t,m,st,s;t=co=i;c=s=0;while(co>0){

c++ co=co/10;

}while(t>0){ m=t%10 st=1;for(int j=1;j<=c;j++){ st=st*m;}s=s+st;t=t/10;

}if(s==i){

gotoxy(xc,yc);cout<<i;xc+=5;if(xc>=50)

{

xc=26;

yc+=2;

}}

}}

};

Page 10: Umesh Taglani,Project on C language,Final Year BCA ,Dezyne E'cole College

Armstrong Calculator

Umesh TaglaniBachelor of Computer Application2nd Year Dezyne E’cole Collegewww.dezyneecole.com

xc+=5;if(xc>=50){

xc=26;yc+=2;

}}

} }};

void main(){

clrscr();arn a;a.wel();a.ms();getch();

}

Page 11: Umesh Taglani,Project on C language,Final Year BCA ,Dezyne E'cole College

Diamond Printer

Umesh TaglaniBachelor of Computer Application2nd Year Dezyne E’cole Collegewww.dezyneecole.com

Diamond Printer

Source Code

#include<iostream.h>#include<conio.h>void main(){

int i,j,k,x,c,h,n=7,f=0;clrscr();cout<<"Enter your limit::";cin>>n;c=n/2;h=c;x=0;n=n+((n%2==0)?1:0);for(i=1;i<=n;i++){

for(k=1;k<=c+1;k++){

cout<<"*";}for(j=1;j<=(i+f-x);j++){

Page 12: Umesh Taglani,Project on C language,Final Year BCA ,Dezyne E'cole College

Diamond Printer

Umesh Taglani Bachelor of Computer Application2nd Year Dezyne E’cole Collegewww.dezyneecole.com

if(j==1 || j==(i+f-x)) {

cout<<"*"; }

else {

cout<<" "; } cout<<" ";}for(k=1;k<=c+1;k++){

cout<<"*";}if(i<=h){

c--;f++;}else{

c++;f--;x=x+2;

}cout<<endl;

}getch();

}

Page 13: Umesh Taglani,Project on C language,Final Year BCA ,Dezyne E'cole College

Marksheet Generator

Umesh TaglaniBachelor of Computer Application2nd Year Dezyne E’cole Collegewww.dezyneecole.com

Marksheet Generator

Page 14: Umesh Taglani,Project on C language,Final Year BCA ,Dezyne E'cole College

Marksheet Generator

Umesh Taglani Bachelor of Computer Application2nd Year Dezyne E’cole Collegewww.dezyneecole.com

Source Code

#include<iostream.h>#include<conio.h>#include<iomanip.h>class stu1{ public:

int roll,m1,m2,m3,m4,m5,m6,i;char name[25],clas[20];void border(){

for(i=8;i<=70;i+=2){ gotoxy(i,3); cprintf("%c",254);}for(i=5;i<70;i+=2){ gotoxy(i,23); cprintf("%c",254);}for(i=23;i>=4;i--){ gotoxy(70,i); cprintf("%c",254);}for(i=3;i<=22;i++){ gotoxy(5,i); cprintf("%c",254);}

}

Page 15: Umesh Taglani,Project on C language,Final Year BCA ,Dezyne E'cole College

Marksheet Generator

Umesh Taglani Bachelor of Computer Application2nd Year Dezyne E’cole Collegewww.dezyneecole.com

void input() {

gotoxy(25,2);cout<<"Marksheet Generator";gotoxy(20,5);

cout<<"Please enter the name of Student::>";cin>>name;gotoxy(20,6);cout<<"Please enter the roll no.::>";cin>>roll;gotoxy(20,7);cout<<"Please enter the class::>";cin>>clas;gotoxy(20,9);

cout<<"Please enter marks in Subject::>";gotoxy(20,10);cout<<"Computer Graphics::>";cin>>m1;

gotoxy(20,11); cout<<"Communication Skills ::>";

cin>>m2;gotoxy(20,12);cout<<"C++ Programming ::>";cin>>m3;gotoxy(20,13);cout<<"Java Programming::>";cin>>m4;gotoxy(20,14);cout<<"Client Server Technology::>";cin>>m5;gotoxy(20,15);

cout<<"Database Management System::>";cin>>m6;

}};

Page 16: Umesh Taglani,Project on C language,Final Year BCA ,Dezyne E'cole College

Marksheet Generator

Umesh TaglaniBachelor of Computer Application2nd Year Dezyne E’cole Collegewww.dezyneecole.com

class stu2{

public:int m7,m8,m9;void input (){

gotoxy(20,17); cout<<"Please enter marks in Practical::>";

gotoxy(20,18);cout<<"C++::>";cin>>m7;gotoxy(20,19);cout<<"FoxPro::>";cin>>m8;gotoxy(20,20);cout<<"Java::>";cin>>m9;

}

};class stu3:public stu1,public stu2{

public:float sum;float per;void show(){

clrscr();gotoxy(22,5);cout<<"MAHARSHI

DAYANAND SARASVATI UNIVERSITY"; gotoxy(16,7);

cout<<"Name::"<<name;gotoxy(16,8);

cout<<"Roll number::"<<roll;cout<<"\t\tclass::"<<clas;gotoxy(16,10);

Page 17: Umesh Taglani,Project on C language,Final Year BCA ,Dezyne E'cole College

Marksheet Generator

Umesh TaglaniBachelor of Computer Application2nd Year Dezyne E’cole Collegewww.dezyneecole.com

cout<<"S. No.\tSUBJECTS\t\t MARKS"; gotoxy(16,11);

cout<<1<<"\tComputer Graphics\t\t"<<m1;gotoxy(16,12);

cout<<2<<"\tCommunication Skills\t\t"<<m2;gotoxy(16,13);

cout<<3<<"\tC++ Programming\t\t\t"<<m3;gotoxy(16,14);

cout<<4<<"\tJava Programming\t\t"<<m4;gotoxy(16,15);

cout<<5<<"\tClient Server Technology "<<m5;gotoxy(16,16);;

cout<<6<<"\tDatabase Management System "<<m6;gotoxy(16,17);

cout<<7<<"\tC++ Practical\t\t\t"<<m7;gotoxy(16,18);

cout<<8<<"\tFoxPro Practical\t\t"<<m8;gotoxy(16,19);

cout<<9<<"\tJava Practical\t\t\t"<<m9;}void result(){

per=0; sum=m1+m2+m3+m4+m5+m6+m7+m8+m9;

gotoxy(16,21);cout<<"Total of marks is::>"<<sum;per=(sum*100)/450;gotoxy(16,22);cout<<"Percentage

is::>"<<setprecision(2)<<per;if(per>=60){

cout<<"\tFirst division";}else if(per>=48){ cout<<"\tsecond division";}

Page 18: Umesh Taglani,Project on C language,Final Year BCA ,Dezyne E'cole College

Marksheet Generator

Umesh TaglaniBachelor of Computer Application2nd Year Dezyne E’cole Collegewww.dezyneecole.com

else if(per>=60){ cout<<"\tThird division";}else{

cout<<"\tFail";}

}

};void main(){

clrscr();stu1 a;a.border();stu3 z;z.input();z.inputp();z.show();z.result();a.border();getch();

}

Page 19: Umesh Taglani,Project on C language,Final Year BCA ,Dezyne E'cole College

Sorted and Unique array elements

Umesh TaglaniBachelor of Computer Application2nd Year Dezyne E’cole Collegewww.dezyneecole.com

Sorted and Unique array elements

Page 20: Umesh Taglani,Project on C language,Final Year BCA ,Dezyne E'cole College

Sorted and Unique array elements

Umesh TaglaniBachelor of Computer Application 2nd YearDezyne E’cole Collegewww.dezyneecole.com

Source Code

#include<iostream.h>#include<conio.h>#include<stdio.h>#include<stdlib.h>class bor{

public:int i,x,y;void border(){ for(i=8;i<=70;i+=2) {

gotoxy(i,3);cprintf("%c",254);

} for(i=5;i<70;i+=2) {

gotoxy(i,23);cprintf("%c",254);

} for(i=23;i>=4;i--)

{gotoxy(70,i);cprintf("%c",254);

} for(i=3;i<=22;i++) {

gotoxy(5,i);cprintf("%c",254);

}}

};

Page 21: Umesh Taglani,Project on C language,Final Year BCA ,Dezyne E'cole College

Sorted and Unique array elements

Umesh TaglaniBachelor of Computer Application2nd Year Dezyne E’cole Collegewww.dezyneecole.com

void main(){

int a[10],n,j,i,e,temp;char ch;clrscr();bor b;b.border();gotoxy(22,8);

cout<<"Array with Sorting and Unique elements::";gotoxy(30,12);cout<<"enter size of array::";cin>>n;gotoxy(30,15);

cout<<"Please enter data in unsorted form";clrscr();b.border();int c=5,d;for(i=0;i<n;i++,c++){ lb:

gotoxy(30,c); cout<<"element no::"<<i+1<<"::"; cin>>a[i]; for(j=0;j<i;j++) {

if(a[i]==a[j]){ clrscr(); b.border();

for(int k=0,d=5;k<i;k++,d++) {

gotoxy(30,d) cout<<"element no::"<<k+1<<"::"<<a[k]; }

goto lb; } }

}

Page 22: Umesh Taglani,Project on C language,Final Year BCA ,Dezyne E'cole College

Sorted and Unique array elements

Umesh TaglaniBachelor of Computer Application2nd Year Dezyne E’cole Collegewww.dezyneecole.com

for(i=0;i<n;i++){

for(j=i+1;j<n;j++){ if(a[i]>a[j]) { temp=a[i]; a[i]=a[j]; a[j]=temp; }}

}clrscr();

b.border();gotoxy(20,8);

cout<<"Data after sorting and with Unique elements::\n";

cout<<endl;int w=10;for(i=0;i<n;i++,w++){

gotoxy(30,w);cout<<"Elements are::";cout<<a[i]<<endl;

}gotoxy(24,21);cout<<"Press 1 for continue....else 0\n";ch=getche();if(ch=='1'){

main();}else{

exit(0);}

getch();}