Facebook
From Thundering Wolf, 3 Years ago, written in C++.
This paste is a reply to Podstawy_inf1 from Tomasz - go back
Embed
Viewing differences between Podstawy_inf1 and Re: Podstawy_inf1
#include
using namespace std;;

double weight(double t[], water_usage(double warm, double x, int n)
cold, double persons)
{
    double warm_cold_water_price 0;
    for (int i=0; i < n; i++)
    {
        if (t[i] >= x)
        {
            k++;
        }

    }
    
8.20;
double heat_up_water = 15.30;
double person_price = 5;
double cold_price = warm_cold_water_price*cold+(person_price*persons);
double warm_price = (warm_cold_water_price+heat_up_water)*warm+(person_price*persons);
double full_price = cold_price + warm_price;
return (k/n)*100;
full_price;
}

int main()
{
    int n = 5;
    double * t = new double[n];
    t[0] = 10;
    t[1] = 5;
    t[2] = 1;
    t[3] = 2;
    t[4] = 10;
    std::cout 
cout << weight(t, 5, n);
water_usage(10, 23, 2);
    return 0;
}