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
ICE Princess25 [194]
3 years ago
14

Write a program that uses a custom function to return the cost of purchasing an item, possibly in multiple quantities. The item

might be subject to 7% sales tax. The main function should prompt the user to enter the quantity, unit price, and taxable data. The main function should call the custom function with these three inputs as arguments and print the cost of the purchase in currency format.
Computers and Technology
1 answer:
alexandr402 [8]3 years ago
3 0

Answer:

def cost(quantity, unit_price, taxable):

   if taxable == "Yes":

       total = (quantity * unit_price) + (quantity * unit_price * 0.07)

   elif taxable == "No":

       total = quantity * unit_price

   return total

q = int(input("Enter the quantity: "))

p = float(input("Enter the unit price: "))

t = input("Is %7 tax applicable? (Yes/No): ")

print(str("$" + str(cost(q, p, t))))

Explanation:

- Create a function called cost that takes three parameters, quantity, unit price, and taxable

- If the tax is applicable, calculate the total with tax. Otherwise, do not add the tax.

- Return the total

- Ask the user for the inputs

- Call the function with given inputs and print the result

You might be interested in
Smart art can be used to create that highlight relationships between two items
Allisa [31]

Answer:

The answer to this question is given below in this explanation section.

Explanation:

A smart Art graphic is a visual representation of your information and ideas.you create one by choosing a layout this fits your message.Some layouts specific kind of information,while other simply enhance the appearance of a bulleted list.

    You can create a smart graphic in excel power point,word,or in an email message in outlook.The smart button is one the insert tab and developing on your screen size,may look like.

Other office program do not allow for smart art art graphic creation,but you can copy and paste smart graphics as image into those programs.As part of this process,when you are prompted to choose a type such as process hierarchy,or relationship.A type is similar to a category of smart art graphic,and each type contains several different layouts.

Because you can quickly and easily switch layouts,try different layouts until you find the one that best illustrate your message.

7 0
3 years ago
5. ADD A STATEMENT OR STATEMENTS to the program on the following page (including constant and/or variable declarations if you wa
kvasek [131]

Answer:

C code is explained below

Explanation:

#include <stdio.h>

int main() { /* main */

/*

      **********************************************************

      * Declaration Section

      **********************************************************

      *

      * Named Constants

      */

  const int bits_per_byte = 8;

  const int attention_span_in_seconds = 3;

  /*

  * You can insert stuff after this comment.

*/

/*

* Local variables

*/

  int modem_send_speed_in_bits_per_second = 56000;

  int script_file_length_in_bytes = 28000;

  int seconds_to_send_script_file;

  /*

  * You can insert stuff after this comment.

*/

/*

      **********************************************************

      * Execution Section

      **********************************************************

      *

      * You can insert stuff after this comment.

*/

  seconds_to_send_script_file =

      (script_file_length_in_bytes * bits_per_byte) /

      modem_send_speed_in_bits_per_second;

  if (attention_span_in_seconds < seconds_to_send_script_file)

      printf("1\n");

  else printf("0\n");

} /* main */

4 0
3 years ago
Which software would you use to create a print design?
Contact [7]

Audacity and Reaper are audio software programs.

Dreamweaver is for websites.


Illustrator is used for printing brochures, cards etc.


The answer would be A. Illustrator.

7 0
3 years ago
Read 2 more answers
4 types of system software
Elina [12.6K]
Operating systems.
Device drivers.
Middleware.
Utility software.
8 0
3 years ago
Read 2 more answers
)Dynamically allocate an object of Banana, using the pointer variable daco.
zepelin [54]

Answer:

d) daco = new Banana;

Explanation:

Dynamically allocated variables have their memory allocated in the heap memory.We declare a dynamical variable like this:-

int *a=new int ;

It means a pointer a is created on the stack memory which hold the address of the block that hold the value of variable a in heap memory.

We already have the pointer daco. We just have to initialize with keyword new.

It will be like daco=new Banana; which matches the option d.

5 0
3 years ago
Other questions:
  • What is used in computers to communicate with wireless keyboards, mice, and printers?
    8·1 answer
  • PLEASE HELP!!!!! David has gone to the Niagara Falls with his camera. He wants to click photos of the people around him and also
    11·2 answers
  • Write a program that takes the radius of a sphere (a floating-point number) as input and then outputs the sphere’s: Diameter (2
    7·1 answer
  • Machine-to-machine (M2M) technology enables sensor-embedded products to share reliable real-time data ________.Select one:a. ove
    14·1 answer
  • A small company has hired you to take over its IT needs. The company currently has seven on-site employees and 12 remote employe
    12·1 answer
  • In vehicles equipped with ABS, the driver's foot must remain firmly on the _________ to activate the ABS.
    7·2 answers
  • WILL GIVE BRAINLIEST!!!!!!!
    14·1 answer
  • Search..
    14·1 answer
  • When browsing using certain browsers, if a page is known to be malicious or using phishing techniques in the past a browser may
    5·1 answer
  • A machine that converts energy to useful work.
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!