Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Debugsevenzas x Companion DebugSeven 3 . c 5 / / Program gets a quantity ordered from user I / then determines price and discount based

Debugsevenzas x
Companion
DebugSeven3.c5
// Program gets a quantity ordered from user
I/ then determines price and discount based on quantity
I/ price per item before discounts is $6.00
// order 15 or more, get a 20% discount
// order 10 to 14- get a 14% discount
// order 5 to 9, get a 10% discount
using Systems
using static System.Console;
using System.Globalization;
class DebugSeven3
{
static void Main()
{
int quantitys
double price;
quantity = GetQuantity () s
price = calculateprice]3 ing quantityle
Writeline("Final price for {0} items is {1}.
}
quantity, price.ToString("c'', cultureinfo.GetcultureInfo("en-us")));
private static Geteuantity()
i.
quan
Write ("Enter number of items ") s
quantity = Convert.ToInt32(ReadLine()):B
}
private calculateprice (moit quantityordered)
{
double PRICE_PER_ITEM =6.003
double price =08
double discount =f
int [] quantimits
doubile[]11mits
for (inf x=11mits. Length -1;x>08-x)
if (quantityordered 14mits[x])
discount =11mits[x];
x=08
price - quantttyondered * PRICE_PERITENA
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

More Books

Students also viewed these Databases questions

Question

5.2 Summarize the environment of recruitment.

Answered: 1 week ago