Help...

M

Maria Mela

Hello everyone...
Anybody can help me on this project??
Thks for your time...


Requirements Information: of the Card Each card will have a set of
information associated. These information include information of the usuary,
last transactions and balance. Thus for each card, the following information
must exist in the system:

Information Type of Data
Example

N.º Card Int
145
Name Usuary Characters (Max: 255)
"Bruno Silva"
Type Usuary Enumeration {"Pupil", "Employee", "Professor"}
dates Emission Dates
5/12/2006
Balance (Euros) Real
24,55
Last Transactions TRANSACCAO
(To see next table)

Details:
the numbers of the cards will have automatic and to be attributed of
incremental form.
This archetype only needs to keep last the 10 last transactions.

Information of Transaction:
For transaction any use of the card is considered, either it a shipment, a
debit or a transference. The information that must consist on each
transaction is the following one:

Information Type of Data
Example

Data Date
6/12/2006
Type Enumeration {"CRG", "DBT", "TRF"}
DBT
Sum (Euros)
-0,35
New Balance (Euros) Real
24,20
Comments Enumeration {"Bar", "Bookstore",
"Refectory",
"Another one", "Card_<NumCard>"}
Bar


Details:
the Sum will have to be negative whenever to leave money the account.
the New Balance keeps the resultant balance of the transaction.
In shipment case ("CRG") the Comments must contain "Another one".
In transference case ("TRF") the Comments must contain "Card_<NumCard>".
After each transaction the Balance of the card will have to be changed!

Operations on Cards:
The program will have to allow the following operations:
1) To create Card - Being filled all the necessary data of the card.
2) To annul Card - Indicating the number of the card and asking for
cancellation confirmation.
3) To modify Data of Card - Indicating the number of the card and cahnge the
data of the same, except the date of emission.
4) Information of Card - After indication of the card number, the
information of the same it will have to be shown, as well as the last
transactions.
5) To carry through transactions:
.. Shipment - Indicating the amount that will be credited and the
number of the card.
b. Debit - the balance not to allow a debit, the operation will
not have to be efectuada.
c. Transference - Indicating the number of origin card and
destination and asking for confirmation. If the origin account will not have
enough balance for the transference, the operation
will not have to be effected.

Listings
The program will have to allow to generate some general listings:
1) Listing Cards - the cards of the system Will have to be listed all,
indicating in the end the minimum balance, maximum balance and average
balance of all the existing accounts, for statistical effect.

2) Commanded listing of Cards - The same that in the previous operation, but
the choice in the way of ordinance of the listing will have to be given to
the user. The ways are:

.. It dates Emission, Name;
b. Name;
c. Balance, Dates Emission, Name.

3) Listing of Movements - After the introduction of the card number will
have to be created a text filing-cabinet contends the information of the
card and the last efectuados movements. The name of the filing-cabinet will
have to be Card_< N.ºCard>.txt.

4) Transferences between Cards - After the introduction of the card number
will have to be created a text filing-cabinet contends the efectuadas
information of the card, transferences and the information on the involved
cards in the transferences. The name of the filing-cabinet will have to be
Transactions_Card_< N.ºCard>.txt.

Implementation of the Project
Language and Codification will have to be developed using language C.
 
J

jacob navia

-------------------------------------------------------------------------
Dear customer

We are ready to fulfill your request, and we thank you for the
confidence you give us by placing your order.

Please buy products for US$ 200 at our website. When your VISA
card payments are accepted we will gladly send you the requested
program.

Yours sincerely

J.K. OB

Customer support.

P.S.
Our website address:
www.DoMyHomework.com
 
M

Maria Mela

I´m sorry about my english...
My doubts are in the way as I must start the project..
.. All the data are dynamic and will be lost in the end of use.
.. How I must start? To define "struct type"? can you help me please?
 
M

mark_bluemel

Maria said:
I´m sorry about my english...

That's OK - my portuguese would be much worse...
My doubts are in the way as I must start the project..
. All the data are dynamic and will be lost in the end of use.
. How I must start? To define "struct type"? can you help me please?

I assume this is a class assignment (or "homework"). Would it be
appropriate for you to start by discussing this with your instructor or
tutor?

I don't fully understand the details of the specification, but I would
suggest that you should probably define a "struct" for your card data.
To hold your data, given that you've been told you only need to store
the last 10 transactions, you could use an array.

To do a job like this, don't try and do it all at once.

Start by writing a program which simply defines a struct to hold card
data, creates one such struct, fills in some fixed data and displays
it. Use separate functions for filling in and displaying the struct.

Then look at extending the filling in function to get input from the
user.

Then look at maintaining an array of structures and so on...

Come back to us with your attempts, if you like, but remember we are
more inclined to help you when you've made an effort and failed, rather
than when you fail to make an effort...

If you have problems, please put a small but complete testcase in your
posting, so we can see what you are doing.
 
M

Maria Mela

Here´s my code until now...

typedef enum tipo_user {Aluno=1, Empregado,Docente}TUSER;
typedef struct data
{
int dia, mes, ano;
}TDATA;

typedef struct saldo
{
float balance;
}TSALDO;

typedef struct mov
{
TDATA data;

typedef struct info_card
{
int numero;
char nome[255];
TDATA data;
TUSER tipo_user;
TSALDO saldo;
TMOV mov;
}TCARTAO;
.........
void AlterarData(VECT_CLI, int, int); This is to change data... if i want
change the name, i i´ve to put "char" to??

<[email protected]> escreveu na mensagem

Maria said:
I´m sorry about my english...

That's OK - my portuguese would be much worse...
My doubts are in the way as I must start the project..
. All the data are dynamic and will be lost in the end of use.
. How I must start? To define "struct type"? can you help me please?

I assume this is a class assignment (or "homework"). Would it be
appropriate for you to start by discussing this with your instructor or
tutor?

I don't fully understand the details of the specification, but I would
suggest that you should probably define a "struct" for your card data.
To hold your data, given that you've been told you only need to store
the last 10 transactions, you could use an array.

To do a job like this, don't try and do it all at once.

Start by writing a program which simply defines a struct to hold card
data, creates one such struct, fills in some fixed data and displays
it. Use separate functions for filling in and displaying the struct.

Then look at extending the filling in function to get input from the
user.

Then look at maintaining an array of structures and so on...

Come back to us with your attempts, if you like, but remember we are
more inclined to help you when you've made an effort and failed, rather
than when you fail to make an effort...

If you have problems, please put a small but complete testcase in your
posting, so we can see what you are doing.
 
R

Randy Howard

I´m sorry about my english...
My doubts are in the way as I must start the project..

int main(void)
{
return 0;
}

Is probably a good start.
. All the data are dynamic and will be lost in the end of use.

Look at the documentation for malloc() and free().
. How I must start? To define "struct type"? can you help me please?

Does your instructor allow you to have people on the internet do your
class assignments for you? Should you consider talking to your
instructor during office hours, a teaching assistant or lab monitor?

Reading the textbook(s) for the course?
 
O

osmium

<attributions garbled by the fact that sender is using Micosoft's Outlook
Express>

Maria Mela said:
Here´s my code until now...

typedef enum tipo_user {Aluno=1, Empregado,Docente}TUSER;
typedef struct data
{
int dia, mes, ano;
}TDATA;

typedef struct saldo
{
float balance;
}TSALDO;

It is customary in C to use double to represent real numbers. Structures
are used to represent aggregates of data. There is no aggregate here.
typedef struct mov
{
TDATA data;

typedef struct info_card
{
int numero;
char nome[255];
TDATA data;
TUSER tipo_user;

// TSALDO saldo; replace with line below
double balance;
TMOV mov;
}TCARTAO;
........
void AlterarData(VECT_CLI, int, int); This is to change data... if i want
change the name, i i´ve to put "char" to??

I don't understand the question. To replace a string, use something from
<string.h>, perhaps strcpy().

I think you over use typedefs. Each time you use one, justify it in your
own mind in some way.

There are some terrible natural language problems here. As near as I can
figure out "usuary" means beneficiary or recipient. Is that about right?
Also the superscript 0 means nothing to me.

I think you need two structures and the right place to start is, as you have
done,. define the structures. The other one is a transaction. The archive
will consist of a group of zero to ten recent transactions. I guess this is
a double entry bookkeeping thing? But the only participants seem to be
pupils, employees and professors? I think your instructor wants you to use
some C enums, which I don't see in your code above.

<[email protected]> escreveu na mensagem



That's OK - my portuguese would be much worse...

I don't see the written requirement to save between sessions, but to do so
will require writing a file at the end of one session and reading at the
start of the next session.
 
M

Maria Mela

Hello again...

One more question and doubt...
How can i increment my "printf" in my code??

void trans_cartao (PtrCl *lista) /* Insert data */
{
PtrCl aux=NULL, inicio=NULL;
int cod=0,cont;


if ((*lista) != NULL)
{
printf ("\nNumero do cartao -> ");
scanf ("%d", &cod);
aux=(*lista);
while (aux!=NULL && aux->num_cartao!=cod)
aux=aux->next;
if (aux!=NULL)
{

clrscr();
printf ("Dados da Transaccao\n\n");
printf ("\n Data da transaccao (dd/mm/aa):");
printf ("\n Dia");
scanf("%d",&aux->diatrans);
printf ("\n Mes");
scanf("%d",&aux->mestrans);
printf ("\n Ano");
scanf("%d",&aux->anotrans);
printf ("\n Tipo de Transaccao:\n 1 - CRG\n 2 - DBT\n 3 - TRF\n");
scanf("%d",&aux->trans_tipo);
printf ("Dados inseridos.");
getch ();

}
else
Erro ("cartao inexistente !!!");
}
else
Erro ("\nNao existem cartoes !!!");
}





void Ver_cartoes (PtrCl *lista) /*print data*/
{
PtrCl aux=(*lista);

if (aux!=NULL)
{
while (aux!=NULL)
{
clrscr();
printf ("cartoes existentes\n\n");
printf ("num_cartao -> %d\n", aux->num_cartao);
printf ("nome -> ");
puts (aux->nome);
printf ("Tipo de Utente -> ");
switch(aux->tipo_utente)
{
case Aluno: printf("Aluno");
break;

case Funcionario: printf("Funcionario");
break;

case Docente: printf("Docente");
}
printf ("\nData de emissao ->%d /%d /%d",aux->dia,aux->mes,aux->ano);

printf ("\nSaldo -> ");
do
{
printf ("\nTransaccoes Efetuadas : ");
printf ("\nTipo de Transaccao -> ");
switch(aux->trans_tipo)
{
case CRG: printf("CRG");
break;

case DBT: printf("DBT");
break;

case TRF: printf("TRF");
}
printf ("\nData de transaccao ->%d /%d
/%d",aux->diatrans,aux->mestrans,aux->anotrans);

}while (aux=??????); ****** what i must put here!!???****
printf ("\nPrima uma tecla para continuar...");
getch ();
aux=aux->next;
}
}
else
Erro ("Nao existem cartoes !!!");
}


Thks for your time...
 
B

Barry Schwarz

Hello again...

One more question and doubt...
How can i increment my "printf" in my code??

What does this phrase mean?
void trans_cartao (PtrCl *lista) /* Insert data */
{
PtrCl aux=NULL, inicio=NULL;
int cod=0,cont;


if ((*lista) != NULL)
{
printf ("\nNumero do cartao -> ");
scanf ("%d", &cod);
aux=(*lista);
while (aux!=NULL && aux->num_cartao!=cod)
aux=aux->next;
if (aux!=NULL)
{

clrscr();

This is a non-standard function which you probably don't need.
printf ("Dados da Transaccao\n\n");
printf ("\n Data da transaccao (dd/mm/aa):");
printf ("\n Dia");
scanf("%d",&aux->diatrans);
printf ("\n Mes");
scanf("%d",&aux->mestrans);
printf ("\n Ano");
scanf("%d",&aux->anotrans);
printf ("\n Tipo de Transaccao:\n 1 - CRG\n 2 - DBT\n 3 - TRF\n");
scanf("%d",&aux->trans_tipo);
printf ("Dados inseridos.");
getch ();

Another non-standard function.
}
else
Erro ("cartao inexistente !!!");
}
else
Erro ("\nNao existem cartoes !!!");
}





void Ver_cartoes (PtrCl *lista) /*print data*/
{
PtrCl aux=(*lista);

if (aux!=NULL)
{
while (aux!=NULL)
{
clrscr();
printf ("cartoes existentes\n\n");
printf ("num_cartao -> %d\n", aux->num_cartao);
printf ("nome -> ");

Did you really want "nome" to immediately follow the number?
puts (aux->nome);
printf ("Tipo de Utente -> ");
switch(aux->tipo_utente)
{
case Aluno: printf("Aluno");
break;

case Funcionario: printf("Funcionario");
break;

case Docente: printf("Docente");
}
printf ("\nData de emissao ->%d /%d /%d",aux->dia,aux->mes,aux->ano);

printf ("\nSaldo -> ");
do
{
printf ("\nTransaccoes Efetuadas : ");
printf ("\nTipo de Transaccao -> ");
switch(aux->trans_tipo)
{
case CRG: printf("CRG");
break;

case DBT: printf("DBT");
break;

case TRF: printf("TRF");
}
printf ("\nData de transaccao ->%d /%d
/%d",aux->diatrans,aux->mestrans,aux->anotrans);

}while (aux=??????); ****** what i must put here!!???****

I think your lack of indenting has confused you. aux does not change
in this block of code. If you execute this block in a loop as you
appear to want to, it will produce the same output repeatedly.

aux does change three statements below. Do you really want to change
it at different places within the same while loop? Does not the
looping through the linked list with the while loop output all the
data you want?
printf ("\nPrima uma tecla para continuar...");
getch ();
aux=aux->next;
}
}
else
Erro ("Nao existem cartoes !!!");
}


Thks for your time...


Remove del for email
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top