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);
}
}