1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
#include <stdio.h>
#include <conio.h>
#include <ctype.h>
#include <stdlib.h>
#define s scanf
#define p printf
#define g gotoxy
int main ()
{
int na;
char np[20],ca,mp,rep;
float mta,r1,r2,nap;
do
{clrscr();
g(32,6);puts("Gestion abonnee");
g(10,6);puts("n° abonnee ");
g(10,8);puts("nom abonnee ");
g(10,10);puts("code abonnee (E/S) ");
g(10,12);puts("Mode paiment (M/T/A) ");
g(10,14);puts("Montant abonnement ");
do
{g(37,16);ca=toupper(getch());}
while((ca!='E')&&(ca!='S'));
do
{g(37,17);mp=toupper(getch());}
while((mp!='M')&&(mp!='T')&&(mp!='A'));
g(37,18);s("%f",&mta);
switch(ca)
{
case'E':r1=(mta*5)/100;
break;
default:r1=0;
}
if((ca=='S')&&(mp=='A'))
r2=(mta*5)/100;
else r2=0;
nap=mta-r1-r2;
g(40,13);P("%6.2f",r1);
g(40,14);p("%6.2f",r2);
g(40,16);p("%6.2f",nap);
do
{g(32,18);rep=toupper(getch());}
while((rep!='N')&&(rep!='O'));
}
while ((rep!='N'));
getch();
} |
Partager