The article delves into the imperative need for automation in agricultural practices, with a specific focus on the automated calculation of the power required for an electric heater. This heater is designed to warm water in a barn during the automated group watering of cattle. The primary objective of this study is to develop a C++ program that can precisely determine the heating power essential for efficiently warming water in the given context. The article further expounds on the experimental methodology employed to ascertain the most effective heating power, taking into account various factors that influence the heating process. The goal of this research is to enhance labor productivity, elevate the quality of livestock care