Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

(a) zoom- This function will take a piece of a given image, blow it up, and retu

ID: 3592083 • Letter: #

Question

(a) zoom- This function will take a piece of a given image, blow it up, and return it as a new image. It takes as parameters a FileImage object and five numbers: upperLeftx, upperLeftY, lowerRightx, lowerRightY, and scalingFactor. The first four numbers represent the coordinates of the upper-left and lower-right corner of the portion of the original image to be blown up. You should create a new image that contains the specified portion of the image, but resized according to scalingFactor. So if scalingFactor is 2, the dimensions of the new image should be twice the dimensions of the specified region. If the scalingFactor is 3, they should be triple, and so on.

Explanation / Answer

//Song Class

#ifndef SONG_CLASS

#define SONG_CLASS

using namespace std;

class Song

{

private:

        string title; //dynamic allocation

        string album;

        string genre;

        string artist;

        double durationn;

public:

        Song();

        void setTitle(string t);

        void setDuration(double d);

        void setAlbumName(string a);

        void setGenre(string g);

        void setArtist(string a);

        string getTitle();

        string getAlbum()const;

        string getGenre()const;

        string getArtist()const;

        double getDuration)(); //accessor

};

//constructor

Song::Song() //constructor

{

        title="";

        album="";

        genre="";

        artist="";

        duration=0;

}

//accessor for name

string Song::getTitle()

{

return title;

}

//mutator

void Song::setTitle(string t)

{

title=t;

}

//accessor for name

string Song::getAlbum()

{

return album;

}

//mutator

void Song::setAlbumName(string a)

{

album=a;

}

//accessor for name

string Song::getGenre()

{

return genre;

}

//mutator

void Song::setGenre(string g)

{

genre=g;

}

//accessor for name

string Song::getArtist()

{

return artist;

}

//mutator

void Song::setArtist(string s)

{

artist=s;

}

void Song::setDuration(double d)

{

duration=d;

}

double Song::getDuration()

{

return duration;

}

#endif   // SONG_CLASS

//FOR THE .CPP

I DO NOT KNOW HOW TO DISPLAY IT THERE.

CAN ANYONE HELP?

//file test.cpp

#include <iostream>

#include <fstream>

#include <string>

#include "song.h"

using namespace std;

int main()

{

        return 0;

}

Edit & Run

//Song Class

#ifndef SONG_CLASS

#define SONG_CLASS

using namespace std;

class Song

{

private:

        string title; //dynamic allocation

        string album;

        string genre;

        string artist;

        double durationn;

public:

        Song();

        void setTitle(string t);

        void setDuration(double d);

        void setAlbumName(string a);

        void setGenre(string g);

        void setArtist(string a);

        string getTitle();

        string getAlbum()const;

        string getGenre()const;

        string getArtist()const;

        double getDuration)(); //accessor

};

//constructor

Song::Song() //constructor

{

        title="";

        album="";

        genre="";

        artist="";

        duration=0;

}

//accessor for name

string Song::getTitle()

{

return title;

}

//mutator

void Song::setTitle(string t)

{

title=t;

}

//accessor for name

string Song::getAlbum()

{

return album;

}

//mutator

void Song::setAlbumName(string a)

{

album=a;

}

//accessor for name

string Song::getGenre()

{

return genre;

}

//mutator

void Song::setGenre(string g)

{

genre=g;

}

//accessor for name

string Song::getArtist()

{

return artist;

}

//mutator

void Song::setArtist(string s)

{

artist=s;

}

void Song::setDuration(double d)

{

duration=d;

}

double Song::getDuration()

{

return duration;

}

#endif   // SONG_CLASS

//FOR THE .CPP

I DO NOT KNOW HOW TO DISPLAY IT THERE.

CAN ANYONE HELP?

//file test.cpp

#include <iostream>

#include <fstream>

#include <string>

#include "song.h"

using namespace std;

int main()

{

        return 0;

}

Edit & Run