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
Nikolay [14]
2 years ago
13

company gives the following discount if you purchase a large amount of supply. Units Bought Discount 10 - 19 20% 20 - 49 30% 50

- 99 35% 100 40% If each item is $4.10. Create a program that asks the user how many items they want to buy, then calculates the pre-discount price, the amount of discount and the after discount price. So for example if order 101 items, I should see something similar to the following: With your order of 101 items, the total value will be $414.10 with a discount of $165.64 for a final price of $248.46. Your output should be very well organized, and use the correct formatting. (Including precision)
Computers and Technology
1 answer:
ratelena [41]2 years ago
3 0

Answer:

In Python:

order = int(input("Order: "))

discount = 0

if(order >= 10 and order <20):

    discount = 0.20

elif(order >= 20 and order <50):

    discount = 0.30

elif(order >= 50 and order <100):

    discount = 0.35

elif(order >= 100):

    discount = 0.40

price = order * 4.1

discount = discount * price

print("With your order of "+str(order)+" items, the total value will be $"+str(round(price,2))+" with a discount of $"+str(round(discount,2))+" for a final price of $"+str(round((price-discount),2)))

Explanation:

This prompts the user for number of orders

order = int(input("Order: "))

This initializes the discount to 0

discount = 0

For orders between 10 and 19 (inclusive)

if(order >= 10 and order <20):

-----------discount is 20%

    discount = 0.20

For orders between 20 and 49 (inclusive)

elif(order >= 20 and order <50):

-----------discount is 30%

    discount = 0.30

For orders between 50 and 99 (inclusive)

elif(order >= 50 and order <100):

-----------discount is 35%

    discount = 0.35

For orders greater than 99

elif(order >= 100):

-----------discount is 40%

    discount = 0.40

This calculates the total price

price = order * 4.1

This calculates the pre discount

discount = discount * price

This prints the report

print("With your order of "+str(order)+" items, the total value will be $"+str(round(price,2))+" with a discount of $"+str(round(discount,2))+" for a final price of $"+str(round((price-discount),2)))

You might be interested in
Write a C program that reads two hexadecimal values from the keyboard and then stores the two values into two variables of type
sattari [20]

Solution :

#include  $$

#include $$

#include $$

//Converts $\text{hex string}$ to binary string.

$\text{char}$ * hexadecimal$\text{To}$Binary(char* hexdec)

{

 

long $\text{int i}$ = 0;

char *string = $(\text{char}^ *) \ \text{malloc}$(sizeof(char) * 9);

while (hexdec[i]) {

//Simply assign binary string for each hex char.

switch (hexdec[i]) {

$\text{case '0'}:$

strcat(string, "0000");

break;

$\text{case '1'}:$

strcat(string, "0001");

break;

$\text{case '2'}:$

strcat(string, "0010");

break;

$\text{case '3'}:$

strcat(string, "0011");

break;

$\text{case '4'}:$

strcat(string, "0100");

break;

$\text{case '5'}:$

strcat(string, "0101");

break;

$\text{case '6'}:$

strcat(string, "0110");

break;

$\text{case '7'}:$

strcat(string, "0111");

break;

$\text{case '8'}:$

strcat(string, "1000");

break;

$\text{case '9'}:$

strcat(string, "1001");

break;

case 'A':

case 'a':

strcat(string, "1010");

break;

case 'B':

case 'b':

strcat(string, "1011");

break;

case 'C':

case 'c':

strcat(string, "1100");

break;

case 'D':

case 'd':

strcat(string, "1101");

break;

case 'E':

case 'e':

strcat(string, "1110");

break;

case 'F':

case 'f':

strcat(string, "1111");

break;

default:

printf("\nInvalid hexadecimal digit %c",

hexdec[i]);

string="-1" ;

}

i++;

}

return string;

}

 

int main()

{ //Take 2 strings

char *str1 =hexadecimalToBinary("FA") ;

char *str2 =hexadecimalToBinary("12") ;

//Input 2 numbers p and n.

int p,n;

scanf("%d",&p);

scanf("%d",&n);

//keep j as length of str2

int j=strlen(str2),i;

//Now replace n digits after p of str1

for(i=0;i<n;i++){

str1[p+i]=str2[j-1-i];

}

//Now, i have used c library strtol

long ans = strtol(str1, NULL, 2);

//print result.

printf("%lx",ans);

return 0;

}

4 0
2 years ago
En la historia del Computador porque se caracteriza la primera generación? *
Nadusha1986 [10]

D. Por el uso de tubos de vacio.

8 0
3 years ago
Word processing programs have different view options that you can use depending on the tasks your performing
inysia [295]

Answer:

Microsoft Word has five types of views for a document, and there are a different set of advantages with each of them. There is a full-screen reading option, print layout, web layout, Draft and the Outline, and you can find what purpose they server through their name. And you can change the views of a document in two ways. You can either hit the View tab or you can select a certain view from the View tab. Or you can make use of the view button which is next to the zoom slider, which you can see at the bottom right section of the work space. Let's have a look at each of them now.

Explanation:

Microsoft Word has five types of views for a document, and there are a different set of advantages with each of them. There is a full-screen reading option, print layout, web layout, Draft and the Outline, and you can find what purpose they server through their name. And you can change the views of a document in two ways. You can either hit the View tab or you can select a certain view from the View tab. Or you can make use of the view button which is next to the zoom slider, which you can see at the bottom right section of the work space. Let's have a look at each of them now.

Word Views

The Print Layout View

Its the default one, and you will find this one as you open the document. It's best when you are documenting with things such as images, footers, columns headers, etc. And each of the components is going to be visible. You will hence get a view of documents, and how it looks like as per the page breaks.

The full-screen reading view is for reading purposes. It also shows how a printed page will look like.

Web Layout View

This gives us a view of how the document will look like on the web page. And the text gets wrapped to fit into the view if required.

Outline View

This helps when you want to move the sections in your documents, or if you are creating an outline.

Draft View

This will help you to quickly edit the text with the document being opened as a draft, and the headers and footers cannot be viewed in this view.

5 0
3 years ago
Which internet technology allows businesses to make presentations and share visual aids such as charts and graphs ?
Akimi4 [234]

Web conferencing is an internet technology that allows people in remote locations collaborate in a virtual conference room by making presentations and sharing visual aids.

Let me know if you have any questions.

8 0
3 years ago
Read 2 more answers
Under the Home tab, where can a user find options to change the bullet style of an outline?
fomenos
Created a new multilevel list style to add to the gallery
5 0
3 years ago
Other questions:
  • 2) Search the Web for two or more sites that discuss the ongoing responsibilities of the security manager. What other components
    15·1 answer
  • Please help me
    10·1 answer
  • Click this link to view O NET'S Wages and Employment section for Film and Video Editors.
    11·2 answers
  • Write a program to display the roll number of students who have scored 100 in math. display appropriate message if none have sco
    5·1 answer
  • What feature allows you to access previous copies of a document on OneDrive?
    15·2 answers
  • Discuss briefly four types of websites and the criteria you will use to evaluate the content of a website
    8·1 answer
  • Complete the problem about Olivia, the social worker, in this problem set. Then determine the telecommunications tool that would
    11·1 answer
  • If the starting address location changes, in which of the following cases, the program has to be recompiled? Select one: a. Both
    12·1 answer
  • Where would you click to see the list of microsoft word styles?
    15·1 answer
  • A good algorithm should have which three components?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!