Write code in the main method of the program class

Assignment Help Computer Engineering
Reference no: EM133369001

Question 1. Create. a new .NET 7.0 Console App with C#

Question 2. Add an Order, OrderLine, and Product classes according to the structure in the following diagram:

Question 3. The constructor in the Order class should instantiate the OrderLines property to an empty list.

Question 4. The ProcessOrder method in the Order class should iterate through the contents of the list of OrderLine objects in the Order and perform the action specified by the first parameter (process) on each OrderLine, but only for OrderLine objects where the predicate of the OrderLine's Product object is true.

Question 5. Write code in the Main method of the Program class to demonstrate that the ProcessOrder method works. Specifically, do the following:

A. Create three Product instances as follows: two products should have prices less than $50, and one product should have a price greater than $50.

B. Create three OrderLine instances, assigning one of the Product instances to each OrderLine instance.

C. Create one Order instance, and add all three OrderLine instances to the Order instance you create.

D. Use the ProcessOrder method to increase the quantity on the OrderLine object (hint: this is the action) for all products with a price that is less than $50 (hint: this is the predicate). You may use either delegate or lambda expression syntax for this method.

E. Use a foreach loop to print the quantity of each OrderLine object to the console.

Reference no: EM133369001

Questions Cloud

What are some of the best ways to protect data : Pick one data situation and talk about the problems it poses for data security. What are some of the best ways to protect data in that specific circumstance
What total apparent gains can be achieved from the swap : Are there opportunities for a profitable plain vanilla interest rate swap between these two companies? What total apparent gains can be achieved from the swap
What is the main advantage of deep learning : What is the main advantage of deep learning over other ML techniques - Deep learning can process large amounts of data quickly, while other ML techniques
Identify and analyze the factors that can affect reliability : Identify and analyze the factors that can affect the reliability of a firm's beta. Do you think the recent global financial crisis has had an impact
Write code in the main method of the program class : Write code in the Main method of the Program class to demonstrate that the ProcessOrder method works. Specifically
What is the cutoff for the top 10% of baby weights : What is the cutoff for the top 10% of baby weights. What is the cutoff for the bottom 10% of baby weights.
What can be the issues with the earned income tax credit : Some people argue that the amount should be raised other have argue this huge federal spending program.should discontinued. In your opinion
What is a food web that includes decomposers : What is a food web that includes decomposers and detritivores called? What happens to the amount of energy as it moves between trophic levels?
What is their yield to call : Atlantis Fisheries issues zero coupon bonds on the market at a price of $445 per bond. If these bonds are callable in 6 years at a call price of $508

Reviews

Write a Review

Computer Engineering Questions & Answers

  Function in the latest version of android studio

In translating this chapter specifically for the responsive app Bikes and Barges I can not get the webview to work nor can I get the program to run

  What is the maximum time that could be taken to service

What is the maximum time that could be taken to service the device if the loss of data is to be avoided and the device generates 2 million requests per second?

  Why are computer simulations

Why are computer simulations playing an increasingly important role in science and engineering.

  What part of the contingency planning process came up short

Using a Web browser and a search engine, search the terms "BP deepwater disaster plan failure." You will find many results. Select one article.

  Consider the three normative theories of business ethics

Consider the three normative theories of business ethics. Briefly describe each - and given an example of an ethical decision in business either real

  Write selection statements in mips

Write selection statements in MIPS. The program should load from memory the contents of integer variable SCORE.

  How to implement a body mass index program

You are the nutritional coach for a local high school football team. You realize that some of the players are not up to par having returned from summer break.

  Develop a simplified P2P file sharing system

In this part, you are to develop a simplified P2P file sharing system. The assumptions on the system are specified as follows

  Make a basic web page using html tags

build a basic Web page using HTML tags. The page should present information about a company/organization or about a profession.Please include all Web site files.

  Question1 decrypt the following encrypted quotation by

question1. decrypt the following encrypted quotation by shakespeare.fqjcb rwjwj vnjax bnkhj whxcq nawjvnfxdu mbvnu

  Use the library and other quality resources for information

use the library and other quality resources for information about the role of computer forensics and security within

  Provide the requested after values

Suppose the before values when the given instructions is executed. Provide the requested after values:

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd