Thread: Urgent help

  1. #1
    Registered User
    Join Date
    Dec 2018
    Posts
    6

    Urgent help

    Someone can make me a simple program.

    You need to register and log in from an undetermined number of users. It is a simple program does not need functions. Thank you

    Sketch:
    Code:
    #include <stdio.h>
    #include <stdlib.h>
    #include <locale.h>
    #include <string.h>
    
    
    typedef struct
        {
            char nome[20];
            char pass[20];
        }dado;
    
    int main()
    {
        setlocale(LC_ALL,"");
        char op, nome, pass;
        int i;
        dado utili[30];
        do {
            printf("|'''''''''''''''|\n");
            printf("| Jogo da Forca |\n");
            printf("|...............|\n\n");
    
    
            printf("E - Entrar\n");
            printf("R - Registar\n");
            printf("S - Sair\n\n");
            fflush(stdin);
            printf("Escolha uma opção: ");
            scanf(" %c", &op);
            op = toupper(op);
            if (op == 'E')
                {
                    system("CLS");
                    printf("|'''''''''''''''|\n");
                    printf("| Jogo da Forca |\n");
                    printf("|...............|\n\n");
    
    
                    printf("LOGIN\n\n");
                    printf("Introduza o Utilizador: ");
                    scanf(" %s", &nome);
                    printf("Introduza a Password: ");
                    scanf(" %s", &pass);
                    for (i=0; i < 30; i++)
                    {
                        if(nome==utili[i].nome && pass==utili[i].pass)
                        {
                            system("CLS");
                            jogo();
                        }
                    }
                }
            if (op == 'R')
                {
    
    
                printf("|'''''''''''''''|\n");
                printf("| Jogo da Forca |\n");
                printf("|...............|\n\n");
                printf("REGISTO\n\n");
                printf("Introduza o Utilizador: ");
                scanf(" %s", &utili[i].nome);
                printf("Introduza a Password: ");
                scanf(" %s", &utili[i].pass);
                printf("\nREGISTADO COM SUCESSO");
                getch();
                system("CLS");
                main();
                }
            }
        while (op == "S");
            system("EXIT");
    }

  2. #2
    Registered User Kernelpanic's Avatar
    Join Date
    Sep 2018
    Location
    Berlin
    Posts
    103
    Try to write a simple program with three people are registered. Two functions:
    1. Registration, example:
    a) xyz
    b) Name: Camilla Ribeiro
    Passport number: 123456-BR
    ID: cr1004
    c) xyz

    2. A login function that to determine whether the person is already registered; here Camilla Ribeiro

    That would be the basis for a greater program.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Needs urgent help !!!
    By Bilal Zaman in forum C++ Programming
    Replies: 6
    Last Post: 12-26-2012, 06:22 AM
  2. urgent help !
    By Ehsan Sharif in forum C Programming
    Replies: 3
    Last Post: 11-24-2012, 02:58 PM
  3. Urgent help please
    By watsee in forum C Programming
    Replies: 14
    Last Post: 02-09-2010, 12:44 PM
  4. Please help me (urgent)
    By forfor in forum C Programming
    Replies: 3
    Last Post: 12-05-2002, 03:32 PM
  5. in need of urgent HELP!!!!!!!!!
    By Kaz in forum C++ Programming
    Replies: 3
    Last Post: 06-26-2002, 07:23 AM

Tags for this Thread