Write C++ void function called averageTemperature() that asks the user to enter integers with a sentinel value...

80.2K

Verified Solution

Question

Programming

Write C++ voidfunction called averageTemperature() that asks theuser to enter integers with a sentinel value of -999 to stopentering numbers. Then average the numbers and print theaverage.

You will need an intacculumator for the temperatures and an int acculumator for thenumber of temperatures entered. Use the accumulators to calculatethe average which will need to be a decimal number.

Call the function fromthe main() function.

Answer & Explanation Solved by verified expert
3.7 Ratings (664 Votes)
Answerincludeusing namespace stdvoid averageTemperature function definition startshere float avg    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students