Question

C ++ program i have 75% correct. im missing the part where you mention which option...

C ++ program

i have 75% correct. im missing the part where you mention which option 3 is best. also the final calculation for options 1 & 2

#include <iostream>
#include <iomanip>

using namespace std;

int main()
{
double option1, option2, option3, copiesSold, priceperCopy, tenPercent, fourteenPercent;
double finalManu, published;
  
cout << fixed << showpoint << setprecision(2);

cout<<"Enter price of each copy: ";
cin>>priceperCopy;
cout<<"Estimated number of copies sold: ";
cin>>copiesSold;

finalManu = 5000, published = 20000;

  
if (copiesSold <= 4000)
tenPercent = (priceperCopy * copiesSold) * 0.1;
  
if (copiesSold > 4000)
fourteenPercent = ((priceperCopy * copiesSold) - 4000) * 0.14;

option1 = finalManu + published;
option2 = (priceperCopy * copiesSold) * 0.125;
option3 = tenPercent + fourteenPercent;


cout<<"Royalties under option 1: $"<<finalManu<<" upon delivery of final transcript and "<<endl;
cout<<"$"<<published<<" when novel is published so total is $"<<option1<<endl;
cout<<endl;
cout<<"Royalties under option 2: $"<<option2<<" total paid for "<<endl;
cout<<"\n 12.5% of the net price of the novel for \n"<<copiesSold<<"\n copies sold. \n"<<endl;
cout<<endl;
cout<<"Royalties under option 3: $"<<option3<<" total paid for "<<copiesSold<<" copies sold."<<endl;
cout<<endl;

if(option1 > option2 && option1 > option3)
cout<<"Option 1 is the best option you can choose for maximum royalties.";
if(option2 > option1 && option2 > option1)
cout<<"Option 2 is the best option you can choose for maximum royalties.";
if(option3 > option1 && option3 > option2)
cout<<"Option 3 is the best option you can choose for maximum royalties.";

return 0;

}

0 0
Add a comment Improve this question Transcribed image text
Answer #1

//Note:- if you have any queries then comment below. i will help you

#include <iostream>
#include <iomanip>

using namespace std;

int main()
{
double option1, option2, option3, copiesSold, priceperCopy, tenPercent, fourteenPercent;
double finalManu, published;

cout << fixed << showpoint << setprecision(2);

cout<<"Enter price of each copy: ";
cin>>priceperCopy;
cout<<"Estimated number of copies sold: ";
cin>>copiesSold;

finalManu = 5000, published = 20000;


if (copiesSold <= 4000)
tenPercent = (priceperCopy * copiesSold) * 0.1;

if (copiesSold > 4000)
fourteenPercent = ((priceperCopy * copiesSold) - 4000) * 0.14;

option1 = finalManu + published;
option2 = (priceperCopy * copiesSold) * 0.125;
option3 = tenPercent + fourteenPercent;


cout<<"Royalties under option 1: $"<<finalManu<<" upon delivery of final transcript and "<<endl;
cout<<"$"<<published<<" when novel is published so total is $"<<option1<<endl;
cout<<endl;
cout<<"Royalties under option 2: $"<<option2<<" total paid for "<<endl;
cout<<"\n 12.5% of the net price of the novel for \n"<<copiesSold<<"\n copies sold. \n"<<endl;
cout<<endl;
cout<<"Royalties under option 3: $"<<option3<<" total paid for "<<copiesSold<<" copies sold."<<endl;
cout<<endl;

if(option1 > option2 && option1 > option3)
cout<<"Option 1 is the best option you can choose for maximum royalties.";
else if(option2 > option1 && option2 > option3)
cout<<"Option 2 is the best option you can choose for maximum royalties.";
else if(option3 > option1 && option3 > option2)
cout<<"Option 3 is the best option you can choose for maximum royalties.";

return 0;

}

Add a comment
Know the answer?
Add Answer to:
C ++ program i have 75% correct. im missing the part where you mention which option...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • How can I modify my program to return the option with the highest amount ? //A...

    How can I modify my program to return the option with the highest amount ? //A new author is in the process of negotiating a contract for a new romance novel. //The publisher is offering three options. //1. The author is paid $5,000 upon delivery of the final manuscript and $20,000 when the novel is published. //2. In the second option, the author is paid 12.5% of the net price of the novel for each copy of the novel sold....

  • c++ programming : everything is done, except when you enter ("a" ) in "F" option ,...

    c++ programming : everything is done, except when you enter ("a" ) in "F" option , it does not work. here is the program. #include <iostream> #include <string> #include <bits/stdc++.h> #include <iomanip> #include <fstream> using namespace std; #define MAX 1000 class Inventory { private: long itemId; string itemName; int numberOfItems; double buyingPrice; double sellingPrice; double storageFees; public: void setItemId(long id) { itemId = id; } long getItemId() { return itemId; } void setItemName(string name) { itemName = name; } string...

  • im writing a c++ code and getting stuck on two parts. The first part, when I...

    im writing a c++ code and getting stuck on two parts. The first part, when I go to write the customer order out to the file, it writes everything but the price out right. I'll get a weird number like 5.95828e-039 or nan. When I printout to the console it works fine so not sure what's wrong. Second After I write the order out to the file, I then have to go in and read the file and calculate the...

  • I need a detailed pseudocode for this code in C ++. Thank you #include <iostream> #include...

    I need a detailed pseudocode for this code in C ++. Thank you #include <iostream> #include <string> #include <iomanip> using namespace std; struct Drink {    string name;    double cost;    int noOfDrinks; }; void displayMenu(Drink drinks[], int n); int main() {    const int size = 5;       Drink drinks[size] = { {"Cola", 0.65, 2},    {"Root Beer", 0.70, 1},    {"Grape Soda", 0.75, 5},    {"Lemon-Lime", 0.85, 20},    {"Water", 0.90, 20} };    cout <<...

  • In c++ programming, can you please edit this program to meet these requirements: The program that...

    In c++ programming, can you please edit this program to meet these requirements: The program that needs editing: #include <iostream> #include <fstream> #include <iomanip> using namespace std; int cal_avg(char* filenumbers, int n){ int a = 0; int number[100]; ifstream filein(filenumbers); if (!filein) { cout << "Please enter a a correct file to read in the numbers from"; }    while (!filein.eof()) { filein >> number[a]; a++; } int total = number[0]; for (a = 0; a < n; a++) {...

  • I've written this program in C++ to compare 2 pizzas using classes and it works fine....

    I've written this program in C++ to compare 2 pizzas using classes and it works fine. I need to convert it to java using both buffered reader and scanner and can't get either to work. //C++ driver class for Pizza program #include <iostream> #include <string> #include <algorithm> #include <iomanip> using std::cout; using std::cin; using std::string; using std::endl; using std::transform; using std::setprecision; using std::ios; using std::setiosflags; #include "Pizza.h" int main() {             char response = 'Y';             while (response == 'Y')...

  • I need to get this two last parts of my project done by tonight. If you...

    I need to get this two last parts of my project done by tonight. If you see something wrong with the current code feel free to fix it. Thank you! Project 3 Description In this project, use project 1 and 2 as a starting point and complete the following tasks. Create a C++ project for a daycare. In this project, create a class called child which is defined as follows: private members: string First name string Last name integer Child...

  • C++ i have started the program i just need help finishing it. This chapter is on...

    C++ i have started the program i just need help finishing it. This chapter is on functions. If you write this assignment without creating functions (main itself does not count) then the maximum score you can receive is 10% of the grade even if the output is perfectly correct. Write a modular program with the following Functions: Main, PrintHeading, PrintTuitionTable The Main Function should ask the user for a Tuition like assignment 6. Then it should call the PrintHeading function,...

  • My program works fine with if else conditions but when it is not working when I...

    My program works fine with if else conditions but when it is not working when I try to implement it using a for loop. Can you fix my for loop and please show me how to do this using loops? I would appreciate if you could explain the loop that you are using. /* Programming Challenge: Shipping Charges The Fast Freight Shipping Company charges the following rates: Weight of Package (in Kilograms) Rate per 500 Miles Shipped 2 kg or...

  • THIS IS FOR C++ PROGRAMMING USING VISUAL STUDIO THE PROGRAM NEEDS TO BE IN C++ PROGRAMMING #inclu...

    THIS IS FOR C++ PROGRAMMING USING VISUAL STUDIO THE PROGRAM NEEDS TO BE IN C++ PROGRAMMING #include "pch.h" #include #include using namespace std; // Function prototype void displayMessage(void); void totalFees(void); double calculateFees(int); double calculateFees(int bags) {    return bags * 30.0; } void displayMessage(void) {    cout << "This program calculates the total amount of checked bag fees." << endl; } void totalFees() {    double bags = 0;    cout << "Enter the amount of checked bags you have." << endl;    cout <<...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT