TrabalhosGratuitos.com - Trabalhos, Monografias, Artigos, Exames, Resumos de livros, Dissertações
Pesquisar

Trabalho Pratica de Programação 2

Por:   •  14/3/2016  •  Trabalho acadêmico  •  7.388 Palavras (30 Páginas)  •  244 Visualizações

Página 1 de 30

        #include

        #include

        

        #define MAX 100

        

                struct Mercadoria {

                        char nome[31];

                        int codigoBarras [13];

                        float custoTotal;

                        float precoTotal;

                        int qtde;

                        float pesoTotal;

                

                        float peso;

                        float valorCusto;

                        float valorVenda;

                        

                };

                typedef struct Mercadoria M;

                

                char menu() {

                        system("color 9f");

                        system("title SISTEMA DE CADASTRO");

                        int o;

                        printf("\t\t....:::CADASTRO DE MERCADORIAS:::....");

                        printf("\n\n");

                        printf("\n\t\t    =============================== ");

                        printf("\n\t\t    = 1. INSERIR MERCADORIA:      = ");

                        printf("\n\t\t    = 2. REMOVER MERCADORIA:      = ");

                        printf("\n\t\t    = 3. PESO TOTAL:              = ");

                        printf("\n\t\t    = 4. CUSTO TOTAL:             = ");

                        printf("\n\t\t    = 5. PRECO TOTAL:             = ");

                        printf("\n\t\t    = 6. Sair:                    = ");

                        printf("\n\t\t    =============================== ");

                        printf("\n\n");

                        printf("INFORME A OPCAO DESEJADA: ");

                        scanf("%d", &o);

                        printf("\n\n");

                        return(o);

                }

                

                void inserirMercadoria(M n[MAX], int q) {

                        system("cls");

                                                                

                        printf("\t\t...::CADASTRAR MERCADORIA::...");

                        printf( "\n\nNOME DO PRODUTO: ");

                        fflush(stdin);//__fpurge(stdin);

                        gets(n[q].nome);

                        

                        printf( "\nCODIGO DE BARRAS: ");

                        scanf("%d", &n[q].codigoBarras);

                        

                        printf( "\nINFORME O VALOR DE CUSTO: ");

                        scanf("%f", &n[q].valorCusto);

                        

                        printf( "\nINFORME O VALOR DE VENDA: ");

                        scanf("%f", &n[q].valorVenda);

                        

                        printf( "\nINFORME A QUANTIDADE: ");

                        scanf("%f", &n[q].qtde);

                        

                        printf( "\nINFORME O PESO: ");

                        scanf("%f", &n[q].peso);

                        

                        printf("CADASTRO EFETUADO COM SUCESSO!!!\n\n\n");

                }        

                

                int  removerMercadoria (M n[MAX], int q) {

                        system("cls");

                        char pesq[31];

                        int i, pos, ctrl=0;

                        

                        printf("\t\t...::REMOVER MERCADORIA::...");

                        printf("\n\nCODIGO DO PRODUTO: ");

                        fflush(stdin);

                        gets(pesq);

                        

                        for(i=0; i

                                if(strcmp(n[i].codigoBarras, pesq)==0){

                                        printf("%d", n[i].codigoBarras);

                                }

                                printf("\n\n");

                        }

...

Baixar como (para membros premium)  txt (10.9 Kb)   pdf (58.4 Kb)   docx (9.7 Kb)  
Continuar por mais 29 páginas »
Disponível apenas no TrabalhosGratuitos.com