Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CA4E4 (4 points-C++ Program Exclude any existing source code files that may already be in your IDE project and add two new ones naming C1A4E4

image text in transcribed
CA4E4 (4 points-C++ Program Exclude any existing source code files that may already be in your IDE project and add two new ones naming C1A4E4 main.cpp in any other file but you must include CIA4E4 MaxOf.h in any file that needs its contents them C1A4E4-MaxOf.h and C1A4E4-main.cpp You may not include (#include) File C1A4E4 MaxOf.h must contain a 2-parameter macro named mMaxof2, a 3 parameter macro amed mMaxof3, a 2-parameter "inline function named fMaxof2 and 3-parameter inline" function named fMaxof3, as follows mMaxOf2, mMaxOf3, fMaxOf2, and fMaxOf3 must: 1. return the maximum of their parameter values 2. support any arithmetic values within th 3. not use variables other than their formal parameters: 4. not need #define or #include, except for the #defines used to define mMax0f2 and e range and precision of type long double mMaxof3 5. not use literal values 6. not use assignment, addition, subtraction, multiplication, or division; 7. not use if. switch, or looping statements 8. not display anything mMaxOf3 and fMaxOf3 must: use the conditional operator (2:) or any relational/equality operators (. --, etc.) mMaxOf3 must: 1. do any needed comparisons using only mMaxof2, calling it no more than twice. fMaxOf3 must: 1. do any needed comparisons using only fMaxof2, calling it no more than twice File ClA4E4 main.cpp must contain function main, which must the user to enter any three space-separated decimal numeric values on the same line: 1. prompt 2. pass the user-entered values to both mMaxof3 and fMaxOf3 as arguments 3. display the results of both calls using the following 2-line format, where the question marks represent the values passed to and returned from the macro and function: mMaxof3(?,?,?) returned ? fMaxof3(?, ?,?) returned? Do not attempt to detect cases where the user input values are equal. Instead, simply treat them xactly like any other values Do not define any functions or macros other than main, mMaxOf2, mMaxOf3, fMaxOf2, and fMaxof3 nually re-run your program several times testing with at least the following 4 sets of user input values ch set represents the argument values in left-to-right order 3.8 -3.5 -3.2 -3.2 -3.5 -3.8 3.5 -3.8 -3.2 8.4e3 6.2e-1 .02e2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions