Question

In: Computer Science

Create a module to calculate the amount of royalties that Parker Schnabel must pay Tony Beets...

Create a module to calculate the amount of royalties that Parker Schnabel must pay Tony Beets at the end of the gold mining season based on the following contractual agreement. When the amount of gold mined is 3000 ounces or less the rate is 15% of the gold value. This lower royalty rate is stored in a variable named lowerRate. When the amount of gold mined is greater than 3000 ounces the royalty rate is 20%. This higher rate is stored in a variable named goldRushRate and is applied only to the amount over 3000 ounces. The price of gold is currently $1200.00. This amount is stored in a variable defined as priceGold. The number of ounces mined is stored in a variable integer ouncesMined. You should ask Parker to input the number of ounces that he mined this season and print out “Based on x ounces mined, you paid y in royalties.”  You will need to multiply the ounces of gold mined by the price by the royalty rate to produce the proper royalties.

Solutions

Expert Solution

//This is c++ code

#include<iostream>
#include<iomanip>
using namespace std;
int main()
{

   int ouncesMined = 0;
   /*The price of gold is currently $1200.00. */
   double lowerRate=0, priceGold = 1200.00 , goldRushRate=0,royaltyRate=0;
   /* The number of ounces mined is stored in
   a variable integer ouncesMined.
   You should ask Parker to input the
   number of ounces that he mined*/
   cout << "Enter the number of ounces mined in this season: ";
   cin >> ouncesMined;
   /* When the amount of gold mined is 3000 ounces or
   less the rate is 15% of the gold value. */
   if (ouncesMined <= 3000)
   {
       lowerRate = 0.15;
       royaltyRate = priceGold * ouncesMined * lowerRate;
   }
   /*. When the amount of gold mined is greater
   than 3000 ounces the royalty rate is 20%.*/
   else
   {
       goldRushRate = 0.20;
       royaltyRate = 3000*0.15*priceGold+(ouncesMined - 3000) * priceGold * goldRushRate;
   }
   cout << fixed << setprecision(2);
   cout << "Royalty = $" << royaltyRate << endl;
   //pause
   system("pause");
   return 0;
}

//Output

if you need any help regarding this solution....... please leave a comment ......... thanks


Related Solutions

Write a program in python to calculate the amount each person must pay toward the bill...
Write a program in python to calculate the amount each person must pay toward the bill and toward the tip, for a group of friends who are eating out together. Since you are all friends, it is okay to split the costs evenly. Your program should take as input: The restaurant bill (without tax or tip) as a floating point number The sales tax rate as a floating point number (for example: an 8% tax rate would be 0.08) The...
Calculate the amount of water (in grams) that must be added to (a) 9.00 g of...
Calculate the amount of water (in grams) that must be added to (a) 9.00 g of urea [(NH2)2CO] in the preparation of a 8.10 percent by mass solution: (b) 28.9 g of MgBr2 in the preparation of a 2.90 percent mass solution:
Create a C module convertTo_csv.c that will implement the function loadAndConvert(const char* file) The code must...
Create a C module convertTo_csv.c that will implement the function loadAndConvert(const char* file) The code must be split into 2 files (.h file and a .c file). The convertTo_csv.c will have the function implementation in ti and the The convertTo_csv.h file will have the declaration. One argument will be given to the function, that is the name of the input file that needs to be converted. A function will create a new csv file called output.csv Know that the loadAndConvert...
Which of the following statement is incorrect? a. A given amount of money you must pay...
Which of the following statement is incorrect? a. A given amount of money you must pay out today is a greater burden than the same amount paid in the future. b. Most of the answers are correct. c. With an amortized loan, the amount of interest increases each year, and the amount contributed to principal decreases each year. d. With an amortized loan, the amount of interest decreases each year, and the amount contributed to principal increases each year. e....
Calculate the amount of money that a person must have in a bank today (the beginning...
Calculate the amount of money that a person must have in a bank today (the beginning of the year) to be able to withdraw $375 at the end of each year for the next 10 years if the bank pays interest compounded yearly at j1 = 5.8% pa. Give your answer in dollars and cents to the nearest cent. Account balance = $ Calculate the simple interest rate pa that must be earned for $60,000 invested on 29 October 2019...
Calculate the amount of heat that must be absorbed by 50.0 grams of ice at -12.0oC...
Calculate the amount of heat that must be absorbed by 50.0 grams of ice at -12.0oC to convert it to water at 20.0oC. (specific heat capacity of ice = 2.09 J/g.K; specific heat capacity of liquid water = 4.18 J/g.K; specific heat capacity of water vapor = 1.84 J/g.K; heat of fusion of ice = 334 J/g
Write a program to help a small company calculate the amount of money to pay its...
Write a program to help a small company calculate the amount of money to pay its employees. In this simplistic world, the company has exactly three employees. However, the number of hours per employee may vary. The company will apply the same tax rate to every employee The program must be written in Java. Prompt the user for the inputs and store the values in variables Must include all the inputs and outputs listed here and perform the calculations correctly...
Using C++ Write a program to calculate the amount a customer should pay in a checkout...
Using C++ Write a program to calculate the amount a customer should pay in a checkout counter for the purchases in a bagel shop. The products sold are bagels, cream cheese, and coffee. Use the pseudo code discussed in the class to write the program. Make reasonable assumptions about the prices of bagel, cream cheese, and coffee. Declare prices of bagel, cream cheese, and coffee as constants.
Using C++ write a program to calculate the amount a customer should pay in a self...
Using C++ write a program to calculate the amount a customer should pay in a self checkout counter for his purchases in a bagel shop. The products sold are everything bagels, garlic bagels, blueberry bagels, cream cheese, and coffee. Using "doWhile loops" write the program to display the menu of the Bagel shop. Make the user buy multiple items of different choices. Finally display the total amount for the purchases. Below is my current code to work with. Please add...
Create a program that calculate the amount of a mortgage payment. Refer to the appropriate video...
Create a program that calculate the amount of a mortgage payment. Refer to the appropriate video or any online source for how the mathematics of the calculation works. If given these three things: The amount of the loan in whole dollars The number of payments (e.g. 360 for 30-year) The interest rate per payment period in percent ( a positive floating-point number) The program should print out the correct value (in dollars and cents) of the per-period payment of principal...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT