Question
C++ Program: The program uses a string to number conversion function, atoi . It allows the user to enter a series of values, or the
C++ Program: The program uses a string to number conversion function, atoi. It allows the user to enter a series of values, or the letters 'Q' or 'q' to quit. The average of the numbers are then calculated and displayed. Fill in the missing codes.
// This program demonstrates the strcmp and atoi functions. #include
// Get the first number for the user. cout << "This program will average a series of numbers. "; cout << "Enter the first number or Q to quit: "; cin >> input; --> (not sure if this is correct) // Process the number and subsequent numbers. while (_____________________ != 'q') {
_______________________; // Keep a running total
__________________________; // Count the numbers entered // Get the next number. cout << "Enter the next number or Q to quit: ";
___________________________; } // If any numbers were entered, display their average. if (______________) //avoid dividing by zero { average = static_cast
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started