fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. //dekraruję funkcję
  6. double unit_net_cost_of_the_product(int raw_material_cost, int number_of_hours, double hourly_rate, int batch_cost, int batch_size );
  7.  
  8. int main()
  9. {
  10.  
  11. int batch_cost, batch_size;
  12. int raw_material_cost;
  13. int number_of_hours;
  14. double hourly_rate; //
  15. double target_profit;
  16.  
  17. //Tutaj mam nadzieję wszystko jasne. Zadeklarowałem
  18. //zmienne i przypisałem im wartości za pomocą cin
  19. cin >> batch_cost >> batch_size
  20. >> raw_material_cost >>number_of_hours
  21. >> hourly_rate >> target_profit;
  22.  
  23. //wywołuję funkcję unit_net_cost_of_the_product.
  24. double net_cost_product = unit_net_cost_of_the_product(raw_material_cost, number_of_hours, hourly_rate, batch_cost, batch_size );
  25.  
  26. //Wypisuję wynik tej funkcji
  27. cout << net_cost_product << endl;
  28.  
  29.  
  30.  
  31. }
  32.  
  33. double unit_net_cost_of_the_product(int raw_material_cost, int number_of_hours, double hourly_rate, int batch_cost, int batch_size ){
  34.  
  35. return raw_material_cost+(number_of_hours*hourly_rate)+batch_cost/batch_size;
  36.  
  37. }
  38.  
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
-nan