Question: Write the C++ code that will complete the following tasks. The runs, innings, and earn_avg variables have been properly declared. Make sure to declare any

Write the C++ code that will complete the following tasks. The runs, innings, and earn_avg variables have been properly declared. Make sure to declare any other variables that you use when writing the answer.

  • Store 65 in an integer variable named runs
  • Store 150 in an integer variable named innings
  • Calculate an earned run average by dividing runs by innings and multiplying by 9. Store the calculated earned run average in a double variable named earn_avg .

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres the C code to accomplish the tasks described cpp code include iostream int main Declar... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!