SHARE
TWEET

Cprogramkarneval

a guest Jan 24th, 2020 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #pragma once
  2. #include <iostream>
  3. #include <cstring>
  4. using namespace std;
  5. class karneval {
  6. private:
  7.     char name_carneval[30];
  8.     int number_home_groups;
  9.     int number_foreign_groups;
  10.     int sum;
  11. public:
  12.     karneval() : number_home_groups(0),
  13.                  number_foreign_groups(0),
  14.                  sum(0)
  15.     {
  16.         strcpy(name_carneval, "");
  17.     }
  18.  
  19.     void input();
  20.     int number_of_groups();
  21. };
  22. void karneval :: input() {
  23.     cout << "Input number home groups" << endl;
  24.     cin >> number_home_groups;
  25.     cout << "input number_foreign_groups" << endl;
  26.     cin >> number_foreign_groups;
  27. }
  28. int karneval:: number_of_groups() {
  29.     sum = number_home_groupa + number_foreign_groups;
  30.     cout << "Suma je:" << sum << endl;
  31.     return sum;
  32. }
  33. class djecja_reduta:public karneval {
  34. private:
  35.     char event_place[30];
  36.     int date_of_event;
  37. public:
  38.     void  number_of_groups();
  39.     void output();
  40.     void input()
  41. };
  42. void djecja_reduta::input() {
  43.     cout << "Unesite mjesto odrzavanja" << endl;
  44.     cin.ignore();
  45.     cin.getline(event_place, 30);
  46.     cout << "Unesite datum odrzavanj" << endl;
  47.     cin >> date_of_event;
  48. }
  49. void djecja_reduta:: number_of_groups(){
  50.     karneval karneval;
  51.     karneval.number_of_groups();
  52. }
  53. void djecja_reduta::ispis() {
  54.     cout << "event place: " << event_place << endl;
  55.     cout << "date of event: " << date_of_event << endl;
  56. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top