J
J
JohnnyKal1br2020-05-30 21:56:20
C++ / C#
JohnnyKal1br, 2020-05-30 21:56:20

Console list showing customers who have a birthday this week, purchases greater than x, and users over 60?

Create an array containing information about the company's customers. The class contains the following fields: last name, first name, patronymic, date of birth, number of purchases, amount spent. Write a program that, using methods, selects the necessary information and displays: - a list of clients who have a birthday this week; - a list of customers who have purchases for more than X; - the average purchase size for customers of retirement age (over 60).

The array is implemented, it is impossible to implement a list through list and display people who have a birthday this week, who have more than x purchases and the average purchase size for customers over 60, did not parse the lists, examples from the Internet are not very clear.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
bitddeveloper, 2020-05-31
@bitddeveloper

Hello, you need to dig in more detail towards LINQ
Wrote a small example, with a selection of all users who have a birthday today

List<Person> persons = new List<Person>();
            IEnumerable<Person> birthday = persons
                .Where(x => 
                    x.DateOfBirth.Day == DateTime.Now.Day && x.DateOfBirth.Month == DateTime.Now.Month);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question