Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I have passed two of the three trials pls help pass the last one ASAP - Status: PASSED! Check: 1 Test: Successful Output Reason: None
I have passed two of the three trials pls help pass the last one ASAP Status: PASSED!
Check:
Test: Successful Output
Reason: None
Timestamp: ::
Status: FAILED!
Check:
Test: Successful Output II
Reason: Unable to find Royalty option: 'Royalty option: 'Royalty option: in the program's output.
Please enter the net price per copy: Please also enter the estimated amount of copies that will sell: Royalty option:
Royalty option:
Royalty option:
The best option for you is Option
Error : AssertionError Unable to find Royalty option: in the program's output.
Timestamp: ::
Status: PASSED!
Check:
Test: Check for constant declaration innamespace
Reason: namespace royaltyRates was found in the program.None
Timestamp: :: and here is my code #include
#include
using namespace std;
namespace royaltyRates
const double OPTIONFIXEDROYALTY ;
const double OPTIONROYALTYRATE ;
const double OPTIONFIRSTRATE ;
const double OPTIONOVERRATE ;
void calculateRoyalties
double netPricePerCopy;
int estimatedCopiesSold;
cout fixed setprecision;
Input net price per copy and estimated copies sold
cout "Please enter the net price per copy: ;
cin netPricePerCopy;
if netPricePerCopy
cout "Invalid input for net price per copy. It must be nonnegative.
;
return;
cout "Please also enter the estimated amount of copies that will sell: ;
cin estimatedCopiesSold;
if estimatedCopiesSold
cout "Invalid input for estimated copies sold. It must be nonnegative.
;
return;
double optionRoyalty OPTIONFIXEDROYALTY;
double optionRoyalty netPricePerCopy estimatedCopiesSold OPTIONROYALTYRATE;
double optionRoyalty;
if estimatedCopiesSold
optionRoyalty netPricePerCopy estimatedCopiesSold OPTIONFIRSTRATE;
else
optionRoyalty netPricePerCopy OPTIONFIRSTRATE
estimatedCopiesSold netPricePerCopy OPTIONOVERRATE;
Output royalties for each option
cout "Royalty option: optionRoyalty endl;
cout "Royalty option: optionRoyalty endl;
cout "Royalty option: optionRoyalty endl;
Determine the best option
if optionRoyalty optionRoyalty && optionRoyalty optionRoyalty
cout "The best option for you is Option
;
else if optionRoyalty optionRoyalty && optionRoyalty optionRoyalty
cout "The best option for you is Option
;
else
cout "The best option for you is Option
;
using namespace royaltyRates;
int main
calculateRoyalties;
return ;
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