1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
anzhelika [568]
3 years ago
12

Suppose you are purchasing something online on the Internet. At the website, you get a 10% discount if you are a member. Additio

nally, you are also getting a discount of 5% on the item because its Father's Day. Write a function that takes as input the cost of the item that you are purchasing and a Boolean variable indicating whether you are a member (or not), applies the discounts appropriately, and returns the final discounted value of the item. Note: The cost of the item need not be an integer
Computers and Technology
1 answer:
patriot [66]3 years ago
6 0

Answer:

<em>The function is written in C++</em>

void calc_discount(double amount,bool member)

{

 double discount;

 if(member)

 {

  discount = amount - 0.10 * amount - 0.05 * amount;

 }

 else

 {

  discount = amount - 0.05 * amount;

 }

 cout<<"Discount = "<<discount;

}

Explanation:

<em>I've included the full source code (including the main method) as an attachment where I use comments as explanations</em>

Download cpp
You might be interested in
What else needs to be done when creating a site?
SSSSS [86.1K]
When you are creating a website, you will usually need to add details to the website. If you're coding a website as HTML, you always have to make sure your code is correct. If one thing is a mess up, you have to start the whole thing all over again. 
5 0
3 years ago
Which setting indents all but the first line of a paragraph by the selected length?
Phoenix [80]

Answer:

Hanging

Explanation:

5 0
3 years ago
This is me lol jjaaaabbooo
ElenaW [278]

i like your glasses uwu

6 0
3 years ago
Nina aspires to be a digital media specialist. What should Nana be familiar with in order to pursue this career?
brilliants [131]

computer science? maybe im not sure?

4 0
3 years ago
Read 2 more answers
Ryan has made a presentation of ten slides, which he wants to display in sequence after a specific time interval. Which element
Sonja [21]
It's called transition or effects lol
7 0
3 years ago
Read 2 more answers
Other questions:
  • A software program that enables users to find and display information stored as html pages on the internet is a(n) ____.
    5·1 answer
  • What instruments are used the measure voltage, current, and resistance
    7·1 answer
  • Identify four basic data manipulations performed on a relational database using sql
    7·1 answer
  • Read the paragraph.
    12·2 answers
  • when happens when the quantity of a good supplied at a given price is greater than the quantity demanded
    12·2 answers
  • Write a function called "power" that takes in integers b&gt;0 and e≥0 and recursively computes b^3 and returns the result.
    5·2 answers
  • You can use colors, patterns, and borders to enhance the overall appearance of a worksheet and to make it easier to read. One of
    11·1 answer
  • When a binary tree is full to its next to last level and its leaves on the last level are filled from left to right the tree is
    14·1 answer
  • How to turn off microsoft teams message notifications
    13·1 answer
  • Ohh I'm so cool It a doge clicker!! What is a doge?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!