We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

Looking For Something at vustudents.ning.com? Click Here to Search

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

+ Link For Past Papers, Solved MCQs, Short Notes & More


Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

How to Add New Discussion in Study Group ? Step By Step Guide Click Here.

Please discuss about the assignment!

 

Problem Statement:     Location Calculation     

 

You are required to write a program for calculating location somewhere on the map. There are two parameters (coordinates) used in calculating a location. One is longitude and the other is latitude. You need to overload ++, --, new and delete operators for this.

 

Detailed Description:

 

  • You are required to create a class named Location.
  • It will have two private data member longitude and latitude.
  • These data members will be assigned values through constructor parameters. For example obj1(20,30).
  • Overloaded ++ operator will increase the both longitude and latitude values by one, overloaded -- will decrease both by one.
  • By overloading new operator, you will allocate the memory dynamically for the object of class Location.
  • The overloaded delete operator will free (de-allocate) the allocated memory.
  • You have to create two objects of class Location. One object will be created through overloaded new operator and other will be created without it.
  • A message “Overloaded new operator called”, embedded inside overloading function for new operator, should be displayed when the object is created through new operator.
  • Similarly, a message “Overload delete operator called” should be displayed upon calling overloaded function of delete operator.
  • Assign the values (10, 20) and (30, 40) for longitude and latitude for object 1 and 2 respectively.

+ How to Follow the New Added Discussions at Your Mail Address?

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?


See Your Saved Posts Timeline

Views: 5429

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)

Attachments:

Replies to This Discussion

Discuss the assignment!

plz edit compile the program to avoid the Similarity problem

 

 

include <iostream.h>
using namespace std;

class location
{
int longitude;
int latitude;
public:
location();
location(int j,int i);
void display();
void* operator new (size_t size);
location operator ++();
location operator --();

};
location::location()
{
longitude=0;
latitude=0; 
}
location::location(int j,int i)
{
longitude=j;
latitude=i;
}

void location::display()
{
cout" Longitude : " endl;
cout" Latitude : " endl;
}

void* location::operator new(size_t size)
{
cout" Overloaded New operator Called" endl; 
void *pointer=malloc(size);
return pointer;
}

location location::operator ++()
{
longitude+=1;
latitude+=1;
}

location location::operator --()
{
--longitude;
--latitude;
}



main()
{
location *loc,l2;
loc=new location(10,20);
loc[0].display();
cout" After calling Overloaded ++ operator on location 1" endl;
++loc;
loc[0].display();
cout"Coordinate for location 2 :"endl;
l2=location(30,40);
l2.display();
--l2;
cout" After calling Overloaded -- operator" endl;
l2.display();
system ("pause");
delete loc,l2;
}

Jazak ALLAH azawajal

Please Discuss here about this assignment.Thanks

You don’t need to go any other site for this assignment/GDB/Online Quiz solution, Because All discussed data of our members in this discussion are going from here to other sites. You can judge yourself. So don’t waste your precious time with different links.

 

hn! Exactly..

ye Tariq bhai we know best......this is the best site

Discuss the solution....

ok

Its preety easy. I have submit it

Just will give you idea:

class Location

{

int longitude;

int latitude;

public:

      void display();

      void* operator new (size_t size);

      void  delete();

     void Location operator ++();

     void Location operator --();

};

If you want additional let me know 

Yasir bhai plz complete sol send kar dan. Allah apko khush rakhay

Dear I have stated main members of class for your just expalin them. if you stuck then feel free to contact me

 

yasir bhai ap k qalam me sayahi khatam ho gai thi complete krty huy?

Yasir bhai Plz share the code of assignment.PLZZZZZZZZZZZZZzzz

RSS

Latest Activity

zuha shah joined + M.Tariq Malik's group
5 minutes ago
+ ! ❤️ ░S░I░N░G░E░R replied to + ! ! ! ! ! ! ! ! ! ! ! ! ! ! !'s discussion 100 Instructions from the Quran
8 minutes ago
+ ! ❤️ ░S░I░N░G░E░R liked + ! ! ! ! ! ! ! ! ! ! ! ! ! ! !'s discussion 100 Instructions from the Quran
8 minutes ago
+ ! ❤️ ░S░I░N░G░E░R liked + !! "AS" !!'s discussion Jis Tarah ..
8 minutes ago
+ ! ❤️ ░S░I░N░G░E░R liked + !! "AS" !!'s discussion Baat Karna ...
8 minutes ago
+ ! ❤️ ░S░I░N░G░E░R liked + !! "AS" !!'s discussion Yaha Har Cheez ..
9 minutes ago
+ ! ❤️ ░S░I░N░G░E░R liked + !! "AS" !!'s discussion Alfaaz Ki Nisbat..
9 minutes ago
+ ! ❤️ ░S░I░N░G░E░R liked ٥ دن's discussion Gunahon ki gehrai
9 minutes ago
+ ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! replied to + "αяsαℓ " Ќąƶµяɨ •"'s discussion Happy Marriage to "Zee" & " Nomi weds Noor"....!
18 minutes ago
Qaisar nadeem replied to + M.Tariq Malik's discussion ENG201 Business and Technical English Writing Assignment No 01 Fall 2019 Solution & Discussion in the group ENG201 Business and Technical English Writing
20 minutes ago
Profile IconQaisar nadeem and Isha Chuhdary joined + M.Tariq Malik's group
20 minutes ago
+ ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! posted a discussion
31 minutes ago
+ !! "AS" !! replied to + !! "AS" !!'s discussion Jis Tarah ..
46 minutes ago
+ !! "AS" !! replied to + !! "AS" !!'s discussion Baat Karna ...
47 minutes ago
+ !! "AS" !! replied to + !! "AS" !!'s discussion Ghalti...
47 minutes ago
+ !! "AS" !! replied to + !! "AS" !!'s discussion Yaha Har Cheez ..
48 minutes ago
+ !! "AS" !! replied to + !! "AS" !!'s discussion Alfaaz Ki Nisbat..
49 minutes ago
Profile IconSafdar Mehmood, Shayaan, Hafiz muhammad sufyan and 28 more joined Virtual University of Pakistan
50 minutes ago
+ ! ! ! ! ! ! ReBeL replied to ٥ دن's discussion Gunahon ki gehrai
1 hour ago
MUHAMMAD USMAN replied to MIT's discussion cs604 Quize#1 fall semester 2019 in the group CS604 Operating Systems
1 hour ago

© 2019   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service