Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c# (Querying an Array of Invoice Objects) Use the class Invoice provided in the ex09_03 folder with this chapters examples to create an array of

c# (Querying an Array of Invoice Objects) Use the class Invoice provided in the ex09_03 folder with this chapters examples to create an array of Invoice objects. Use the sample data shown in Fig. 9.8. Class Invoiceincludes four propertiesa PartNumber (type int), a PartDescription (type string), a Quantity of the item being purchased (type int) and a Price (type decimal). Perform the following queries on the array of Invoice objects and display the results:

Use LINQ to sort the Invoice objects by PartDescription.

Use LINQ to sort the Invoice objects by Price.

Use LINQ to select the PartDescription and Quantity and sort the results by Quantity.

Use LINQ to select from each Invoice the PartDescription and the value of the Invoice (i.e., Quantity * Price). Name the calculated column InvoiceTotal. Order the results by Invoice value. [Hint: Use let to store the result of Quantity * Price in a new range variable total.]

Using the results of the LINQ query in part (d), select the InvoiceTotals in the range $200 to $500.

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 Systems Design Implementation And Management

Authors: Peter Rob, Carlos Coronel

6th International Edition

061921323X, 978-0619213237

More Books

Students also viewed these Databases questions

Question

Understand how to design effective service guarantees.

Answered: 1 week ago

Question

Know when firms should not offer service guarantees.

Answered: 1 week ago