/* jasen.cpp */ /* Kerho-ohjelman j„sen-luokan k„sittely. ** ** Tekij„t: Vesa Lappalainen ** Tehty: 09.12.1995 ** Muutettu ** Mit„ muutettu: ** */ #include #include #include #include #include #include "jasen.h" //---------------------------------------------------------------------------- // J„senen k„sittely: //---------------------------------------------------------------------------- void cJasen::alusta() { nimi = ""; hetu = ""; katuosoite = ""; postinumero = ""; postiosoite = ""; kotipuhelin = ""; tyopuhelin = ""; autopuhelin = ""; liittymisvuosi = 0; jmaksu = 0; maksu = 0; lisatietoja = ""; } void cJasen::vastaa_aku_ankka() { char apuhetu[50]; sprintf(apuhetu,"%02d%02d%02d-%03d%c", rand()%31+1,rand()%12+1,rand()%91+1,rand()%1000,rand()%25+'A'); apuhetu[11]=0; nimi = "Ankka Aku"; hetu = apuhetu; katuosoite = "Ankkakuja 6"; postinumero = "12345"; postiosoite = "ANKKALINNA"; kotipuhelin = "12-1234"; tyopuhelin = ""; autopuhelin = ""; liittymisvuosi = 1996; jmaksu = 50.00; maksu = 30.00; lisatietoja = "Velkaa Roopelle"; } void cJasen::tulosta(ostream &os) const { os << " " << nimi << " " << hetu << "\n"; os << " " << katuosoite << " " << postinumero << " " << postiosoite << "\n"; os << " k: " << kotipuhelin << " t: " << tyopuhelin << " a: " << autopuhelin << "\n"; os << " Liittynyt " << liittymisvuosi << "."; cout.precision(2); cout.setf(ios::showpoint); os << " J„senmaksu " << jmaksu << " mk." " Maksettu " << maksu << " mk.\n"; os << " " << lisatietoja << "\n"; }