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
Practice using word processing software, including creating, formatting, and saving a document.
irakobra [83]

When writing the cover letter, the following points are important:

  • Keep it short.
  • Proofread.
  • Avoid cliches.
  • Be creative.

<h3>What is a cover letter?</h3>

A cover letter simply means a document that's written alongside a CV when an individual applies for jobs.

The cover letter should be addressed to a specific person and should describe one's accomplishments and achievements.

Learn more about cover letters on:

brainly.com/question/3602860

6 0
2 years ago
Until the 1990s scaling up was almost always a more cost-effective strategy to increase available computer power because communi
salantis [7]

Answer:

The answer is "Option A"

Explanation:

A single computer component also known as a single-board computer, it is a total machine, which is built on a single silicon chip with functional devices like microcontroller, (I / O), and storage.  

  • It normally uses a device, which has a fanless, small-power computation system, and small-profile design.
  • This model provides very slow communication between the components of single computers, that's why the given statement is true.

8 0
3 years ago
Which of the following factors will have the greatest impact on your credit score? I. Length of Credit History II. Payment Histo
Veseljchak [2.6K]
<span>the one that would have the greatest impact on my credit score would be : B. II and III If you had a troublesome payment history, it would be very likely that you'll end up with credit score because you make yourself became untrustworthy and if you have a low Debt, people will trust your current financial condition and you will be more likely to earn high credit score</span>
5 0
3 years ago
Read 2 more answers
Write the statement that includes a friend function named before in the class dateType that takes as parameters two objects of t
Lerok [7]

Answer:

In opp friend function is a function that gives the same access to private and protected data. It is declared in class that is granting access.

Explanation:

#include<iostream.h>

using namespace std;

class Sum

{

 int a, b, add;

 public:

 void input()  

{

 cout << "Enter the value of l and m:";

 cin >> l>>m;     taking input from users

}

 friend void add(sum &t);

 void display()  

{

  cout << "The sum is :" << z;

}

};

 void add(sum & p)  

{

  p.add = p.a + p.b;

}

 int main()  

{

  sum p1;

  p1.input();

  add(p1);

  p1.display();

  return false;  

if(display==5)  

{

 return true;  //true is returned if sum is equal to 5

}

else        //if they are not the same

{

 return false;

}

}

8 0
3 years ago
HELP!! WHATS THE ANSWER??
dsp73

Answer:

"sing" that is the answer

Explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • You have a website that sells widgets, and you have a category page specifically for blue widgets. After some extensive outreach
    5·1 answer
  • Why are prepositions, conjunctions, and pronouns usually considered poor choices to use as key words?
    5·2 answers
  • Illustrate the process of using an operating system to manipulate a computer’s desktop, files and disks.
    12·1 answer
  • Data ____ travel over the Internet from router to router until reaching their destinations.
    7·1 answer
  • Ex: If the input is: Pat Silly Doe the output is: Doe, P.S.
    9·1 answer
  • When one user could perform a query to determine which recordings had a track length of four minutes or more, and another user c
    9·1 answer
  • Look at the four schematic symbols shown in the figure above. Each of the symbols is labeled with a number. Which of the followi
    11·1 answer
  • Xercise 1<br>1.<br>What is system? Explain the components of system in brief.​
    12·1 answer
  • WAP to find area of circle​
    12·1 answer
  • A local pizza shop is selling a large pizza for $9.99. Given the number of pizzas to order as input, output the subtotal for the
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!