Answer:
Hi!
// First you have to initialize the variables.
int hits = 0;
int atbats = 0;
float percentaje = 0;
function eligible() {
hits = inputHits(); // Function that input the hits.
atbats = inputAtBats(); // Function that input the at bats.
percentaje = hits/atbats; // Now, you can calculate the percentaje.
if( percentaje > 0.300) { //If percentaje if greater than .300 will print Eligible for the All Stars Game.
print('Eligible for the All Stars Game.');
} else { //Otherwise will print Not elegible.
print('Not elegible.');
}
}
}
Step-by-step explanation: