Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

:Optimize it using function template #include using namespace std; int maximumInt(int v1, int v2, int v3) { int maximumValue = v1; if (v2 > maximumValue)

:Optimize it using function template

#include using namespace std;

int maximumInt(int v1, int v2, int v3) { int maximumValue = v1; if (v2 > maximumValue) maximumValue = v2; if (v3 > maximumValue) maximumValue = v3; return maximumValue; }

double maximumDouble (double v1, double v2, double v3) { double maximumValue = v1; if (v2 > maximumValue) maximumValue = v2; if (v3 > maximumValue) maximumValue = v3; return maximumValue; } char maximumchar(char v1, char v2, char v3) { char maximumValue = v1; if (v2 > maximumValue) maximumValue = v2; if (v3 > maximumValue) maximumValue = v3; return maximumValue; } int main() { int i1, i2, i3; cout << "input three integer values:"; cin >> i1 >> i2 >> i3; cout << "The maximum integer value is:" << maximumInt(i1, i2, i3);

double d1, d2, d3; cout << " Input three double values: "; cin >> d1 >> d2 >> d3; cout << "The maximum double value is:" << maximumDouble(d1, d2, d3);

char c1, c2, c3; cout << " Input three double char:"; cin >> c1 >> c2 >> c3; cout << " The maximum character value is" << maximumchar(c1, c2, c3) << endl; return 0; }student submitted image, transcription available below

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

Expert Oracle Database Architecture

Authors: Thomas Kyte, Darl Kuhn

3rd Edition

1430262990, 9781430262992

Students also viewed these Databases questions

Question

5. Do you have any foreign language proficiency?

Answered: 1 week ago