Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- class Film {
- private:
- string name;
- double rating;
- double revenue;
- public:
- Film() {
- name = "";
- rating = 0;
- revenue = 0;
- }
- Film(string Name, double Rating, double Revenue) {
- name = Name;
- rating = Rating;
- revenue = Revenue;
- }
- ~Film() {};
- void setName(string n) {
- name = n;
- }
- void setRating(double r) {
- rating = r;
- }
- void setRevenue(double r) {
- revenue = r;
- }
- string getName() { return name; }
- double getRating() { return rating; }
- double getRevenue() { return revenue; }
- void display() {
- cout << "Name of film: " << name << endl;
- cout << "Rating: " << rating << endl;
- cout << "Revenue: " << revenue << endl;
- }
- };
- void printMostPopularFilm(Film *films, int n) {
- int best = 0;
- for (int i = 0; i < n; i++) {
- if (films[i].getRevenue() > films[best].getRevenue()) {
- best = i;
- }
- }
- films[best].display();
- }
- int main() {
- // KE VI BIDE DADENA
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement