Във форума е въведено ограничение, което позволява на потребителите единствено да разглеждат публикуваните въпроси.

PhoenixMaster123 avatar PhoenixMaster123 2 Точки

01. Meal Plan- C# Advanced Retake Exam - 13 April 2022

Дава ми 55/100

Задача:                                                              Моерешение:  https://pastebin.com/cxzq7SXg

Meal Plan

The summer is around the corner and John wants to lose some weight. To do that he should lower his calories intake, by keeping a count of the total amount of calories intake for a day.

Create a program that helps John to calculate his calories intake, by predefined meals.

You will be given two lines of input. The first line will be an array of strings, separated by a single space, representing meals that John can eat. The second line will be an array of integers, separated by a single space, representing the maximum calories intake per day.

Here is a table with the exact meals and their calories:











Start calculating calories as follows: take the first meal’s calories and the last element in the sequence of calorie intake for a day. Each time John eats a meal, the calories intake for the current day should be decreased by the calories of the given meal, and the current meal should be removed from the collection. When the calories intake for the given day goes to zero, remove them from the collection, and continue to the next day. If the calories for the given day go below zero, take as many calories as possible from the meal, so the current daily calories intake reaches zero. The rest of the meal’s calories should be subtracted from the next day in the calorie intake sequence.

For more clarification, check the provided examples.

The program stops when there are no more meals to be eaten, or there are no more daily calories to be calculated.


  • On the first line, a sequence of strings will be given representing meals, separated by a single space (" ").
  • On the second line, a sequence of integers will be given, representing the daily calories intake, separated by a single space (" ").


  • As a result, you should print two lines for output:
    • If John menage to eat all the given meals print:

"John had {number of meals} meals."

"For the next few days, he can eat {dailyCalories1, dailyCalories2, etc.} calories."

Separate the daily calories intake by comma and space (", ").

  • If John could not eat every meal:

"John ate enough, he had {number of meals} meals."

"Meals left: {meal1, meal2, etc.}."

Separate the meals by comma and space (", ").


  • The daily calories will be in the range [1200…4000].
  • No recursion is needed for solving this problem.
  • The input will be always valid.
  • There will be no case where daily calories and meals go to zero simultaneously.




salad soup salad steak

2500 1800 1500

John had 4 meals.

For the next few days, he can eat 1320, 2500 calories.


We start by taking a salad (350 cal.) and a day with 1500 cal. We subtract the daily calories intake by the salad's calories:

1500 - 350 = 1150 cal.

The salad is removed from the sequence, and John can consume 1150 cal. more for the current day.

Next, we have soup (490 cal.), we subtract the daily calories intake by the soup's calories:

1150 - 490 = 660 cal.

The soup is removed from the sequence, and John can consume 660 cal. more for the current day.

Next, we have a salad (350 cal.), the same operation is performed:

660 - 350 = 310 cal.

The salad is removed from the sequence, and John can consume 310 cal. more for the current day.

Next, we have steak (790 cal.), and 310 cal. that can be consumed for the current day:

310 - 790 = -480 cal.

We take 310 cal. form the steak's total of 790 cal. and remove the current daily calory intake. Next, we check do we have another day in the collection, in this case, we do, which is 1800 cal.:

1800 - 480 = 1320 cal.

The steak is removed from the sequence, and John can consume 1320 cal. more for the current day.

There are no more meals in the collection, so we stop the program and print the corresponding messages.




pasta soup salad steak pasta steak pasta

1800 1500

John ate enough, he had 6 meals.

Meals left: pasta.


Module: C# Advanced
bgdimgeo avatar bgdimgeo 4 Точки


Моето решение, малко е хамалско мисля но дава 100/100. 




D.Malamov avatar D.Malamov 3 Точки

Ето и едно малко по-различно решение, което също дава 100/100.



15/02/2023 12:59:44
thomasfrank avatar thomasfrank 3 Точки

Creating a program that generates a meal plan can be a complex task, requiring a solid understanding of data io games structures, algorithms, and user interface design but you have done it. It shows that you have put in a lot of effort and hard work to create a useful and functional program.

MacGrey avatar MacGrey -2 Точки

Outsourcing data annotation for ML model validation is a smart way to streamline the process of data labeling and enhance the accuracy of your machine learning algorithms. Mobilunity BPO offers high-quality data annotation services to help businesses train their models with the right data and achieve better results. Our team of experts uses the latest annotation tools and techniques to ensure that every dataset is accurately labeled and annotated according to your specific needs. By outsourcing data annotation, you can save time, reduce costs, and improve the overall efficiency of your machine learning projects. Contact Mobilunity BPO today to learn more about our data annotation services and how we can help your business succeed. 

brianwilsonrt avatar brianwilsonrt 6 Точки

Calories found in food and drink give you energy to do every day things. Find out why they are important and get tips for being aware of Taylor Swift 2048 calories.

sarausa avatar sarausa 4 Точки

Instead of eating 3 large meals, divide it into 5-6 small meals throughout the day. This helps control feelings of fullness and reduces the risk of overeating. mapquest directions

Coacasedits avatar Coacasedits 1 Точки

During that time, I was not aware of its standard operating snow rider 3d procedure; yet, it seems that my intuition was correct. This specific quotation is very humorous:

Можем ли да използваме бисквитки?
Ние използваме бисквитки и подобни технологии, за да предоставим нашите услуги. Можете да се съгласите с всички или част от тях.
Използваме бисквитки и подобни технологии, за да предоставим нашите услуги. Използваме „сесийни“ бисквитки, за да Ви идентифицираме временно. Те се пазят само по време на активната употреба на услугите ни. След излизане от приложението, затваряне на браузъра или мобилното устройство, данните се трият. Използваме бисквитки, за да предоставим опцията „Запомни Ме“, която Ви позволява да използвате нашите услуги без да предоставяте потребителско име и парола. Допълнително е възможно да използваме бисквитки за да съхраняваме различни малки настройки, като избор на езика, позиции на менюта и персонализирано съдържание. Използваме бисквитки и за измерване на маркетинговите ни усилия.
Използваме бисквитки, за да измерваме маркетинг ефективността ни, броене на посещения, както и за проследяването дали дадено електронно писмо е било отворено.