subject

Write a class called Product. The class should have fields called name, amount, and price, holding the product’s name, the number of items of that product in stock, and the regular price of the product. There should be a method get_price that receives the number of items to be bought and returns as the cost of buying that many items, where the regular price is charged for orders of less than 10 items, a 10% discount is applied for orders of between 10 and 99 items, and a 20% discount is applied for orders of 100 or more items. There should also be a method called make_purchase that receives the number of items to be bought and decreases amount by that much.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 09:30
Light travels at a speed of 186,000 miles a second. the distance light travels in a year is 5,865,690,000,000 miles/year 5,865,695,000,000 miles/year 58,656,950,000,000 miles/year 6,789,000,0000 miles/year
Answers: 1
question
Computers and Technology, 24.06.2019 03:30
Auniform resource locator (url) is a formatted string of text that web browsers, email applications, and other software programs use to identify a particular resource on the internet. true false
Answers: 2
question
Computers and Technology, 24.06.2019 14:00
Text or graphics that print at the bottom of every page are called footings footers headers headings
Answers: 1
question
Computers and Technology, 25.06.2019 10:50
Write a program to convert a person’s height in inches into centimetres and their weight in stones into kilograms. (1 inch = 2.54 cm and 1 stone = 6.364 kg) i need .
Answers: 1
You know the right answer?
Write a class called Product. The class should have fields called name, amount, and price, holding t...
Questions
question
Mathematics, 31.01.2020 03:49
question
Mathematics, 31.01.2020 03:49
question
Mathematics, 31.01.2020 03:49