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
podryga [215]
2 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 batter’s 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:
Ludmilka [50]2 years ago
5 0

Answer:

#include <iostream>

using namespace std;

int main() {

int nhits,nbats;//declaring number of hits and number of bats..

cin>>nhits>>nbats;//promting nhits and nbats..

float perc=(float(nhits)/nbats)*100;//calculating percentage..

if(perc>300)//checking eligibility.

{

   cout<<"Eligible for ALL STARS GAME"<<endl;

}

else

cout<<"NOT Eligible"<<endl;

return 0;

}

Output:-

55

7

Eligible for ALL STARS GAME.

Explanation:

I have taken two integer variables nhits and nbats for number of hits and number of bats.Prompting them from the user.After that i am calculating the percentage and it needs to be a float variable.So I have done typecasting for the that converting 1 integer to float so that the answer will come in float.After that checking the eligibility and printing the message.

You might be interested in
mapa mental con la explicación de que medios de comunicación y redes sociales intervienen en la construcción de tu identidad​
lisov135 [29]

Answer:

este presente yo cuando me pidieron eso

5 0
2 years ago
Which of the these is tool for creating mobile apps? A:C# B:Apple Pie C:Appy Pie D:C++​
Ratling [72]

Answer:

bhsjsbsbsb

Explanation:

<h3><em>bejwnsusb</em></h3>
4 0
2 years ago
Read 2 more answers
____ map a set of alphanumeric characters and special symbols to a sequence of numeric values that a computer can process.
Neporo4naja [7]
The answer is : coding schemes
4 0
2 years ago
When comparison shopping, all of these hint at a good deal EXCEPT_____________________.
pav-90 [236]

Answer:

lower-priced models offer more features

Explanation:

4 0
3 years ago
Which tab on the Table Tools contextual tab is used to control the style and formatting of the table as it relates to colors for
laila [671]

Answer: The answer would be the "Home Tab"

Explanation:

4 0
2 years ago
Other questions:
  • Which is the most likely reason why scientists change a model?
    12·2 answers
  • Create a simple main() that solves the subset sum problem for any vector of ints. Here is an example of the set-up and output. Y
    12·1 answer
  • Dana downloads music into her computers random access memory, or ram, without authorization. this is?
    15·1 answer
  • In controlling network traffic to minimize slow-downs, a technology called ________ is used to examine data files and sort low-p
    15·1 answer
  • What would happen if you clicked on the Show Desktop icon on your computer screen? The system tray would appear. All open window
    9·2 answers
  • This needs to be written in Java.
    11·1 answer
  • Which of the following things could you do in order to tell if a pair of colors has strong contrast? A. Look at the colors on th
    12·1 answer
  • FOR DIGITAL DESIGN/ PHOTOGRAPHY
    5·2 answers
  • 9.4 Code Practice: Your task is to determine whether each item in the array above is divisible
    14·1 answer
  • Please be my friend. my best and only friend isn't talking to me for some reason
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!