Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Finish the methods in the following code. DO NOT CHANGE THE MAIN METHOD. The instructions for each method are in a comment in the template.

Finish the methods in the following code. DO NOT CHANGE THE MAIN METHOD. The instructions for each method are in a comment in the template. DO NOT CHANGE THE MAIN METHOD!!!! #include  #include  using namespace std; int summationBetween(int num1, int num2); void printEvensBetween(int num1, int num2); void printVowels(string str); double calculateAverage(); int main() { int answer = 0; int value1 = 0; int value2 = 0; double average = 0; string string1 = ""; string string2 = ""; cout << "Enter string1: "; getline(cin, string1); cout << "Enter value1: "; cin >> value1; cout << "Enter value2: "; cin >> value2; cout << endl; cout.setf(ios::fixed); cout.precision(2); answer = summationBetween(value1, value2); cout << "The summation is: " << answer << endl; cout << endl; cout << "The even numbers between are: "; printEvensBetween(value1, value2); cout << endl; cout << "The vowels are: "; printVowels(string1); cout << endl; average = calculateAverage(); cout << endl; cout << "The average is: " << average << endl; return 0; } // This function adds all the numbers between two numbers. It adds the starting number // and the ending number into the sum as well. The total is returned. int summationBetween(int num1, int num2) { } // This function prints the even numbers separated by a space. If the first or last is even, // it is also printed. The function ends with an endline. void printEvensBetween(int num1, int num2) { } // This function prints the vowels from the string separated by a space. The function ends with an endline. void printVowels(string str) { } // This function queries the user for values. It returns the average of the numbers. double calculateAverage() { } 

Sample output using VSCode. Part of the output comes from the main method.

Enter string1: Testing the string now. Enter value1: 45 Enter value2: 68 The summation is: 1356 The even numbers between are: 46 48 50 52 54 56 58 60 62 64 66 68 The vowels are: e i e i o Type a -1 to exit. Enter a number: 0 Enter a number: 2 Enter a number: 3 Enter a number: 5 Enter a number: 9 Enter a number: -1 The average is: 3.80

DO NOT CHANGE THE MAIN METHOD!!!!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Principles Programming And Performance

Authors: Patrick O'Neil

1st Edition

1558603921, 978-1558603929

More Books

Students also viewed these Databases questions

Question

b. What groups were most represented? Why do you think this is so?

Answered: 1 week ago