0
How to do the coding for this output?
You have successfully captured 10 pokemons Pikachu:4 Zubat:2 Eevee:2 Flamingo:2
16 Réponses
+ 4
Just captured 10 pokemons? Where is complete question?
+ 2
What are inputs? How to identify which character is captured how many times?
+ 1
Given 20 pokeballs and you are successfully captured 10 pokemons. How many pokemon you had captured for each different character?
Sample out:
Pikachu:4
Zubat:2
Eevee:2
Flamingo:2
+ 1
CML I entered my
name
age
yes
enter
then hit submit
all 4 types of Pokemon displayed but it stated 0 captured
+ 1
https://code.sololearn.com/cEGKI7N7QQGr/?ref=app
I think you want to do this
+ 1
import java.util.Scanner;
public class Program
{
public static void main(String[] args) {
Scanner sc= new Scanner(System.in);
System.out.println("enter the number of total ");
int pokemon = sc.nextInt();
System.out.println("Enter the name of pikacku and how many captured");
System.out.println("Enter the name of pikacku and how many captured");
int pika1 = sc.nextInt()
System.out.println("Enter the name of pikacku and how many captured");
int pika2 = sc.nextInt()
System.out.println("Enter the name of pikacku and how many captured");
int pika3 = sc.nextInt()
int pika4 = pika1+pika2+pika3
System.out.println(pika1+\n +pika2+ \n+pika3 )
}
}
0
Why the total captured keep on zero when i run the programme?
0
I don't know
0
Send me a message and we'll discuss everything there.
0
It seems to be the same program as here:
https://www.sololearn.com/Discuss/3006752/?ref=app
I gave you an example in the other thread. How you need format the output depends on how you stored your data.
0
1.provide player the number of object(such as pokeball)
2.spawn the characters randomly(minimum 5 characters)
3.set the encounter rate and capture rate randomly(the result will be different every time the program run)
4.able to calculate and display the total number of characters captured
5 able to display the number of captured for every single character
0
print(“””You have successfully captured 10 pokemons
Pikachu:4
Zubat:2
Eevee:2
Flamingo:2”””)
I think this might be a simple print statement.
0
This is java bye the way
0
Print ("You have successfully captured 10 pokemons
Pikachu:4
Zubat:2
Eevee:2
Flamingo:2")