πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: chile.comp.programacion
Article #2163

ayuda

#2163
From: Slipknot
Date: Wed, 22 Feb 2006 01:22
76 lines
2681 bytes
hola es mi prmera vez en este grupo y necesito por favor me ayuden
urgentemente en este programa ya que estoy batallando bastante, este es
el codigo (el programa a a lo que es P.O.O):
(diganme donde esta el error)

class promedios{
float calif[4][20];
float promgral;
int iNoAlu;
public:
void inicio (void){iNoAlu=0;}
void setcalif(float, float, float);
void calculapromgral(void);
int retNoAlu(void){return iNoAlu;}
float retcalif(int calif,int alu){return A[calif][alu];}
float retpromgral(void){return promgral;}



};


void promedios::setcalif(float A,float B,float C)
{
calif[0][iNoAlu]=A;
calif[1][iNoAlu]=B;
calif[2][iNoAlu]=C;
calif[3][iNoAlu]=(A+B+C)/3;
iNoAlu++;

}


void promedios::calculapromgral(void)
{
float fsuma=0;
for(int i=0;i<iNoAlu;i++)
fsuma+=calif[3][i];
promgral=fsuma/iNoAlu;


}


void __fastcall TForm1::Button1Click(TObject *Sender)
{
oprom.setcalif(StrToFloat(Edit1->Text),StrToFloat(Edit2->Text),StrToFloat(EΒ­dit3->Text));

oprom.calculapromgral();
for(int i=0;i<oprom.retNoAlu();i++)
{
SG->Cells[0][i]=oprom.retcalif(0,i);
SG->Cells[1][i]=oprom.retcalif(1,i);
SG->Cells[2][i]=oprom.retcalif(2,i);
SG->Cells[3][i]=oprom.retcalif(3,i);

}


ppromgral->Caption=oprom.retpromgral();

}


//-------------------------------------------------------------------------Β­--

void __fastcall TForm1::FormCreate(TObject *Sender)
{
oprom.inicio();

}


//-------------------------------------------------------------------------
Technical Details
Message-ID: <1140571372.146486.214840@g47g2000cwa.googlegroups.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!g47g2000cwa.googlegroups.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 1593cb,52bf958ab277f91c,start
X-Google-Attributes: gid1593cb,public
X-Google-Language: ENGLISH,ASCII
Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!g47g2000cwa.googlegroups.com!not-for-mail
From: "Slipknot" <mama_mesta@latinmail.com>
Newsgroups: chile.comp.programacion
Subject: ayuda
Date: 21 Feb 2006 17:22:52 -0800
Organization: http://groups.google.com
Lines: 77
Message-ID: <1140571372.146486.214840@g47g2000cwa.googlegroups.com>
NNTP-Posting-Host: 201.132.86.55
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1140571393 9814 127.0.0.1 (22 Feb 2006 01:23:13 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 22 Feb 2006 01:23:13 +0000 (UTC)
User-Agent: G2/0.2
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; {71D505E0-6E52-11D9-BA28-00079507C809}; (R1 1.5)),gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: g47g2000cwa.googlegroups.com; posting-host=201.132.86.55;
   posting-account=G-7GQQ0AAAAlEYHmedB-IN6cYlJjYqF_