1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Julli [10]
4 years ago
10

Write a program that takes two ints as input from the keyboard, representing the number of hits and the number of at bats for a

batter. Then calculate the batters hitting percentage and check if the hitting percentage is above .300. If it is, output that the player is eligible for the All Stars Game; otherwise, output that the player is not eligible. Maintain floating point precision when calculating the hitting percentage.
Computers and Technology
1 answer:
andriy [413]4 years ago
8 0

Answer:

void main(){

int noOfHits,atBats;

float hittingPercentage;

printf ("Enter the number of hits and the number of at bats for a batter\n");

scanf("%d%d",&noOfHits,&atBats);

hittingPercentage=(noOfHits/atBats)*100;

if(hittingPercentage>300)

printf("the player is eligible for the All Stars Game\n");

else

printf("the player is not eligible\n");

}

Explanation:

Here we are reading values for noOfHits,atBats from the user and calculated hittingPercentage. if hittingPercentage>300 we are displaying corresponding message if it is not >300 again another message which illustrating the elogibility

You might be interested in
Charles Montesquieu believed that the
kakasveta [241]

Answer:

A. Make Laws

Explanation:

Montesquieu believed the ways to go about limiting the power of a monarch would be to split up power among 3 groups, Judicial, Legislative and Executive. The American Presidential system and Constitution used Montesquieu's writings as a foundation for their principles.

  1. Judicial Interprets laws
  2. Legislative Makes laws
  3. Executive Enforces Law

6 0
3 years ago
Read 2 more answers
The network backbone
NNADVOKAT [17]

Answer:

it would be b

Explanation:

think about it

5 0
3 years ago
Assume that the classes listed in the Java Quick Reference have been imported where appropriate.
Georgia [21]

rcre2nvijrnv

u1bcihdebc

nn

8 0
4 years ago
is there reality in your point of view ? if your answer is yes, is there a couse effect relation ship between reality and appera
zheka24 [161]

Answer: Yes but maybe yes

Explanation: reality does exist pinch yourself

8 0
3 years ago
Read 2 more answers
Answer to get brainiest. I NEED HELP PLEASE!! I am supposed to type a program on base conversion. Starts from base of 10 (decima
Virty [35]

Here's a solution that works except for the leading zeros. Unclear (to me) why they need to be there and what's the logic?


  public static void main(String[] args)  

  {    

       int number, base;

       Scanner Cin = new Scanner(System.in);  

       System.out.print("Enter a decimal number between 1 and 100,000: ");

       number = Cin.nextInt();

       System.out.print("Enter a base from 2-16: ");

       base = Cin.nextInt();          

       System.out.format("The number %d in base %d is %s.", number, base, Integer.toString(number, base).toUpperCase());

  }

6 0
4 years ago
Other questions:
  • ____________ approach involves trying every possible key until an intelligible translation of the ciphertext into plaintext is o
    7·1 answer
  • A(n) ______ is a flash memory storage device that contains its own processor to manage its storage.
    13·1 answer
  • Which command compiles the java source code file welcome.java?
    9·1 answer
  • Sometimes we write similar letters to different people. For example, you might write to your parents to tell them about your cla
    9·1 answer
  • When you want to specify multiple criteria, and all criteria must be true for a record to be included in the results, when the _
    9·1 answer
  • To computer the equivalent units of production, add: A. units completed plus a percentage of the beginning WIP units B. units co
    10·1 answer
  • What is a special character when creating a password?
    8·2 answers
  • What is another word for: a location in memory that contains a value?
    7·2 answers
  • William is an Architect in charge of designing a new library for a city. Which tasks will he need to perform to ensure the proje
    10·2 answers
  • Can you answer this ?​
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!