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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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