Thread: program - pokemon

  1. #1
    Registered User
    Join Date
    Jan 2017
    Posts
    16

    program - pokemon

    Hi, i am very new to c programming and I'm asked to write a c program to calculate the maximum amount of experience points (XP) that a Pokémon Go player can earn by using a Lucky Egg bonus timer and evolving Pidgey pokemons.
    The program must:

    1) Read 2 input numbers. The first input is the number of Pidgey pokemons and the second input is the amount of pidgey candy that the player currently has in their inventory.

    2) Display the maximum amount of XP that the player can earn by using a Lucky Egg bonus timer and evolving Pidgey pokemons.

    3) Display informative error messages for unexpected or missing input values.

    Will appreciate any sort of help! thank you.
    (users will need 12 or above candies to evolve 1 pidgey. 1 evolve gives 500 exp. with lucky egg the exp is doubled, in this case 1000xp bare evolve.


    How do I make a code so that once the user inputs the amount of pidgeys they got, whatever the input is, it is multipled by 1000, and as a new output for ( exp gained)

    e.g.

    User puts in 10 pidgeys,
    10*1000 = 10000
    exp earned = 10,000

    Code:
    #include <stdio.h>
    int main()
    {
       int number1, number2, number3, a = 1000;
    printf("Enter number of Candies: ");
    scanf( "%d", &number1 );
        if  ( number1 >= 12 )
    printf( "Number is above of 12. You have enough Candies \n" );
        if (number1 < 12 )
            {
    printf ("You do not have enough Candies.!");
        exit(-1);
            }
    
    printf("Enter number of pidgeys: ");
    scanf( "%d", &number2 );
        if ( ( number1 > 0 ) )
    printf( "Number is above of 0. You have enough Pidgies \n" );
        if (number1 < 1 )
            {
    printf ("You do not have enough Pidgeys.!");
                   exit(-1);
            }
    
    }

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Yeah, cut down on the posting of the same code please.
    Pokemon - repost
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Pokemon - repost
    By sureme in forum C Programming
    Replies: 16
    Last Post: 01-10-2017, 12:17 PM
  2. C program - pokemon
    By sureme in forum C Programming
    Replies: 4
    Last Post: 01-03-2017, 09:29 AM
  3. Developing a C program - Pokemon
    By water lily in forum C Programming
    Replies: 19
    Last Post: 11-28-2016, 03:39 PM
  4. Developing a C program - Pokemon
    By water lily in forum General AI Programming
    Replies: 0
    Last Post: 11-18-2016, 08:15 PM
  5. Pokemon MMORPG?
    By FiftyNine50 in forum Projects and Job Recruitment
    Replies: 4
    Last Post: 07-25-2007, 04:05 PM

Tags for this Thread