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]
3 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]3 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
A data set includes data from 500 random tornadoes. The display from technology available below results from using the tornado l
EastWind [94]

Answer:

The answer is:

H_0:\mu=2.2\\H_1:\mu> 2.2

Explanation:

H_0:\mu=2.2\\H_1:\mu> 2.2

The test value of statistic t= \frac{\bar x-\mu}{\frac{s}{\sqrt{n}}}

                                               =\frac{2.31688-2.2}{0.206915}\\\\=0.56

The value of P = P(T>0.56)

                          =1-P(T<0.56)

                          =1-0.712

                          =0.288

  • Since the P value exceeds its mean value (0.288>0.05), the null assumption must not be rejected.  Don't ignore H0.
  • This assertion, it mean length of the tornado is greater than 2.2 miles also isn't backed by enough evidence.
6 0
3 years ago
Which of the following is a right of a user of information systems?
Eva8 [605]

Answer:

Option A is the correct option for the following question.

Explanation:

The following option is correct because this option is one of among four rights of the user of an information system which is collectively important for those users who working in any organization, company or firm. It always requires the new and the upcoming features or the function of the system.

Option B is wrong because it is not the right of the user and the right is don't disclose the secrets of your firm or company to any outsiders or any person who are not reliable.

Option C is wrong because it is not the right of the user.

Option D is wrong because it is not the right of the user and it is the responsibility of all computer users to keep their systems fit and fine.

4 0
4 years ago
whenever I try to make an account it says it can't sign me up at this time or something- can you help?-
Rus_ich [418]

Answer:

You can try emailing tech support and describing your issue. In order to get the best help as quickly as possible, try providing screenshots of what happens when you sign in or describe everything you see on the screen when the problem occurs, and quote error messages directly when possible.

5 0
3 years ago
To generate integers between and including -10 to 10 you would use:
ollegr [7]

Answer: I have no clue my dude use google

Explanation: go to google and look it up. ;) <3

8 0
3 years ago
Read 2 more answers
What is a list of items to discussed or acted upon? O Agenda 0 Minutes 0 Letter 0 Memo?​
vaieri [72.5K]

Answer:

c

Explanation:

got 100

BRAINLEST

8 0
3 years ago
Other questions:
  • Which of these is an application? Microsoft Windows Linux Microsoft Word Apple ios​
    9·2 answers
  • What is one advantage of top-down programming design?
    13·2 answers
  • A __________ acts as separate network that rests outside the secure network perimeter so untrusted users can access web servers
    10·1 answer
  • How does a author develop a character in a story?
    14·2 answers
  • URGENT!!! If Pete selects the green square or little green camera icon on his camera dial, what mode is he selecting?
    15·1 answer
  • Case Project 9-4: Troubleshoot an IP configurationYou work at a help desk and have just received a call from an employee who say
    11·1 answer
  • which network component connects a device to transmission media and allows the device to send and receive messages?
    7·1 answer
  • Online education provides _____.
    8·1 answer
  • Hiiiiiiiiihwdawdfgthnythgrfergthyjuhgfd
    12·2 answers
  • What enforces the location in which an app can function by tracking the location of the mobile device?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!