CATEGORII DOCUMENTE |
APLICATII IN LIMBAJ C++, UTILE IN PROIECTAREA ASISTATA
Exercitii introducere de date in C++
Ex1a
#include <iostream.h>
void main(void)
Ex1b
#include <iostream.h>
void main(void)
Ex2
#include <iostream.h>
void main(void)
Ex3
#include <iostream.h> //C++
#include <stdio.h> //C
void main(void)
Ex4
#include<iostream.h> //biblioteci de functii C++
void main(void) //functie principala
Ex5 Declaratii de date
#include<iostream.h>
void main(void)
Ex6
#include<iostream.h>
void main(void)
Ex7
#include <iostream.h>
int global_name = 1001;
void main(void)
Ex8
#include <iostream.h>
#include <iomanip.h>
void main(void)
listeaza: 0.000123
1.230000e-04
Ex
#include<iostream.h> //biblioteci de functii
float m; //decaratii
int a, b, c;
void main(void) //functia main
Ex
#include<iostream.h> //biblioteci de functii
float m; //decaratii
int a, b, c;
float media(void)
void main(void) //functia main
Ex9
#include <iostream.h>
#include <iomanip.h>
void main(void)
Ex10
#include <iostream.h>
void main(void)
#include <iostream.h>
void main(void)
Ex12
#include<iostream.h> //biblioteci de functii C++
int values[5] = ;
int i;
void main(void)
Ex13 introducere de date
#include <iostream.h>
void main(void)
Ex
#include<iostream.h> //biblioteci de functii
void hello_world(void)
void main(void)
Ex14
#include<iostream.h>
int a,b,c;
int main()
Ex15
#include<iostream.h>
int SQ(int a, int c);
int main()
int SQ(int a, int c) //definire de functii in afara functiei principale
Ex16
#include<iostream.h>
int k;
float Td;
void main(void)
Ex17
#include<iostream.h>
#include <ctype.h> //toupper
#include<conio.h> //pentru functia getch
char inf;
void main(void)
}while(inf!='D' && inf!='N');}
Ex18
#include<iostream.h>
#include <ctype.h> //toupper
#include<conio.h> //pentru functia getch
#include<stdio.h> //biblioteci de functii
#include<conio.h>
char prel;
void alezare(void)
void falezare(void)
void main(void)
}while(prel!='1' && prel!='2');
}
Ex19
#include<iostream.h> //biblioteci de functii C++
#include<conio.h>
#include<stdlib.h> //exit
#include<stdio.h> //gets
#include<string.h> //strcpy
int a,b,c;
void inceput (void) //introducere parola
else cout<<'Corect !';}
int main()
Ex20
#include<iostream.h>
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<string.h>
#include<ctype.h>
void rezultate(void);
void display(void);
int a,b,c;
char list;
int main()
void rezultate(void)
}while(list!='1' && list!='2'); }
void display(void)
Exercitiul 21 citirea unui fisier de date
#include<fstream.h>
#include<mem.h>
void calcule(void);
char v1[6],v1a[6],v2[6],v2a[6];
int a,b,c,fa;
main()
cout<<'rn Introduceti date:';
cout<<'rn Numar reper:';
cin>>v1;
cout<<'rn Cota de reparatie:';
cin>>v2;
}while(m1!=0 || m2!=0);
calcule();
fp.close();
return 0;}
void calcule(void) //exemplu de calcule
Fisierul date.txt
11100 ST
11100 R1
11110 ST
11110 R1
Exercitiul 22
#include<iostream.h> //biblioteci de functii
#include<fstream.h>
#include<conio.h>
#include<mem.h>
void calcule(void);
int sfarsit(void);
char V1[6],V1a[6],V2[6],V2a[6];
int a,b,c,fa;
float Lsemifabricat;
main()
cout<<'rn Introduceti date:';
cout<<'rn Numar reper:';
cin>>V1;
cout<<'rn Cota de reparatie:';
cin>>V2;
do
else return 0;}
}while(m1!=0 || m2!=0);
calcule();
cout<<'rn Scrie b='<<b; //verificare
fp.close();
return 0;}
void calcule(void)
int sfarsit(void)
Exercitiul 23 introducere de date
#include<iostream.h>
#include<fstream.h>
char V1[6], aliaj;
void fisier1(void)
void main(void)
Exercitiul 24 utilizarea functiilor
#include<fstream.h>
void Al_Sn(void);
void Cu_Pb(void);
char V1[6], V2[6], aliaj;
void fisier1(void)
void Al_Sn(void)
void Cu_Pb(void)
void main(void)
Exercitiul 25 Definirea unui proiect din douǎ fisiere Proj1.cpp si Proj2.cpp, cu introducerea parolei
Proj1.cpp
#include<iostream.h> //biblioteci de functii
#include<stdio.h>
#include<fstream.h>
#include<conio.h>
#include<mem.h>
void calcule(void);
int sfarsit(void);
char V1[6],V1a[6],V2[6],V2a[6];
int a,b,c,fa;
void inceput (void) //introducere parola
else cout<<'Corect !';}
main()
cout<<'rn Introduceti date:';
cout<<'rn Numar reper:';
cin>>V1;
cout<<'rn Cota de reparatie:';
cin>>V2;
do
else return 0;}
}while(m1!=0 || m2!=0);
cout<<'rn Scrie b='<<b; //verificare
calcule();
cout<<'rn Scrie b='<<b; //verificare
fp.close();
return 0;}
#include<iostream.h> //biblioteci de functii
#include<fstream.h>
#include<conio.h>
//#include<string.h>
float Lsemifabricat;
extern int a,b; //date declarate in Proiect1.cpp
void calcule(void)
int sfarsit(void)
Date.txt
11100 16 12 34
11110 24 11 12
11111 36 22 23
11112 42 21 45
#include<iostream.h> //biblioteci de functii
#include<stdio.h>
#include<fstream.h>
#include<conio.h>
#include<mem.h>
#include<stdlib.h>
#include<string.h>
#include<ctype.h>
void calcule(void);
int sfarsit(void);
void display(void);
void printer(void);
void informatii(void);
void script(void);
void rezultate(void);
char V1[6],V1a[6];
float a,b,c,fa; //*
float Lsemifabricat;
char list, inf;
void inceput (void) //introducere parola
else cout<<'Corect !';}
void help(void)
}while(inf!='D' && inf!='N');}
void informatii(void)
main()
cout<<'rn Introduceti date:';
cout<<'rn Numar reper:';
cin>>V1;
do
else return 0;}
}while(m1!=0);
calcule();
rezultate();
script();
fp.close();
return 0;}
void calcule(void)
SCRIPT.CPP
#include<iostream.h> //biblioteci de functii
#include<stdio.h>
#include<fstream.h>
#include<conio.h>
#include<mem.h>
#include<stdlib.h>
#include<string.h>
#include<ctype.h>
void calcule(void);
int sfarsit(void);
void display(void);
void printer(void);
void informatii(void);
void script(void);
void rezultate(void);
extern char V1[6],V1a[6];
extern float a,b,c,fa; //*
extern float Lsemifabricat;
extern char list, inf;
void rezultate(void)
}while(list!='1' && list!='2'); }
void display(void)
void printer(void)
void script(void)
fprintf(b1,'LAYER S text n');
fprintf(b1,'TEXT S iso 197,238 0 %%%%c%.1fn',a); //*
fprintf(b1,'TEXT S iso 197,227 0 %%%%c%.1fn',b);
fprintf(b1,'TEXT S iso 267,187 90 %.1fn',c);
fprintf(b1,'TEXT S iso 364,24 0 %sn',V1);
cout<<'rn S-a creat fisierul script1.scr' ;
getche();
fclose(b1);}
int sfarsit(void)
POO
#include <iostream.h>
#include <iomanip.h>
#include <string.h>
class Book
;
void Book::show_title(void)
;
float Book::get_price(void)
;
void Book::show_book(void)
;
void Book::assign_publisher(char *name)
;
void Book::show_publisher(void)
;
void main(void)
Ex
#include <iostream.h>
class object
;
object::object(void) : a(1), b(2), c(3) ;
void object::show_object(void)
void main(void)
Politica de confidentialitate | Termeni si conditii de utilizare |
Vizualizari: 1189
Importanta:
Termeni si conditii de utilizare | Contact
© SCRIGROUP 2024 . All rights reserved