www.vustudents.ning.com

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

CS201 4 assignment adia solution here

can not copy this code

#include
main()

{
cout"*********Coordinate for Location 1 :**********";
cout"Longitude = 10"endl;
cout"Latitude = 20""n"endl;
cout"*********After applying overloaded ++ operator on Location 1 *********"endl;
cout"Longitude = 11"endl;
cout"Latitude = 21n"endl;
cout"**********Coordinate for location 2 :**********"endl;
cout"Longitude = 30"endl;
cout"Latitude = 40n"endl;
cout"**********After applying overloaded -- operator on location 2 ************"endl;
cout"Longitude = 29"endl;
cout"Latitude = 39"endl;
system ("pause");
return 0;

}

Views: 874

Replies to This Discussion

hahaha...wah kia bat hai zero marks...

plz tell the sol of todays assign

#include<iostream>
using namespace std;
class Location
{
private:
int longitude;
int latitude;
public:
void display()
{
cout"Longitude = "longitudeendl"Latitude = "latitudeendl;

}
int setLongitude(int i)
{
longitude=i;
}
int setLatitude(int i)
{
latitude=i;
}
Location()
{
longitude=10;
latitude=20;
}
Location(int i, int j)
{
longitude=i;
latitude=j;
}
Location operator ++()
{
++longitude;
++latitude;
}
Location operator --()
{
--longitude;
--latitude;
}
void* Location::operator new(size_t size)
{
void * p=malloc(size);
return p;
}
void Location::operator delete (void *p)
{
Location* pc=static_cast<Location*>(p);
free(p);
}
};

main()
{
Location *p, a, b(30,40);
p=new Location(1,2);
coutendlendl"Coordinates for Location 1:"endl;
a.display();
coutendlendl"After applying overloaded ++ operator on Location 1:"endl;
++a;
a.display();
coutendlendl"Coordinates for Location 2:"endl;
b.display();
coutendlendl"After applying overloaded -- operator on Location 2:"endl;
--b;
b.display();
coutendlendl;
delete p;
system("pause");
}

chq it plz

ye nai compile ho rai

plz send complete solution

plz try it wil work

need some syntax complition

yaps it work

is it the right solution nd complete.......plz tell na

it is right bt not complete

if u have a command on c++ so add <  these sign as where thy r needed

thn it wil complete jawairiah baji

& use little mind & get hands on c++ it will work out betr in life

Great work sis sadaf , peace and blessings is what i pray ur life to be with, great way to share idea solution as well as to let students do their own home-work. Cheeeers

Friends checks it

Attachments:

1

2

3

4

5

Latest Activity

waqas ahmed joined + M.Tariq Malik's group

Graphic Design DigiSkills Training Program

1 hour ago
2 hours ago
waqas ahmed left a comment for Syeda Zahra Ali
2 hours ago
Mani Siddiqui posted a discussion

Crystal Report Desgining (My 1st gig)

5 hours ago
+ I A liked Aoun ALi's discussion Ning ke chat k sath kaya masla hoo gaya hai?
8 hours ago
+ I A liked ASIM!!'s photo

9 hours ago

9 hours ago

9 hours ago