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 Assignment#04 Solution & Discussion Due Date:24-01-2011

Only CPP file will be accepted, file other than CPP will be awarded zero (0) marks.

Views: 564

Attachments:

### Replies to This Discussion

Yah loo bhaiyoo assignment No.4 ka solution
Attachments:
G
#include <iostream.h>
#include <conio.h>
// This is only for IDEA, not a complete solution.
class price
{
public:
int rupees, paisas;
price () {};
price (int,int);
price operator + (price);
};

price::price (int x1, int y1)
{
rupees = x1;
paisas = y1;
}

price price::operator+ (price money)
{
price convert;
convert.rupees = rupees + money.rupees;
convert.paisas = paisas + money.paisas;
return (convert);
}

int main ()
{
price x1 (10,60);
price y1 (13,2);
price z1;
z1 = x1 + y1;
cout "Price is "z1.rupees " rupees " "and "z1.paisas" paisas";
getch();
return 0;
}
i need cs201 correct solution
CS201 Assignment 4 solution fall 2010
Attachments:

Execution problem after compilation

this solution create execution problem after compilation.

plz solve this problem sir

correct solution!!!

`#include <iostream.h>#include <conio.h>class price{     //Declaring private data members    private:        int rupies;        int paisas;     //Declaring public functions    public:        price();          //Default constructor        price (int,int);  //Overloaded constructor        void Print();            //print function for displaying the array elements        price operator+(price); //Operator overloading function for operator +  };// Default constructorprice::price(){    rupies = 0;      paisas = 0;}// Overload constructorprice::price(int crupies, int cpaisas){    rupies = crupies;       paisas = cpaisas;}//Function to display the elements void price::Print()   {    cout"  Price is  "rupies"  Rupees and  "paisas"  Paisas  " endl; } // Function for + operator overloading price price::operator+(price d2)   {      int r = rupies + d2.rupies; //adding rupeies      int p = paisas + d2.paisas; //adding paisas    if (p>=100)                                  //If paisas exceeds from 100 then adding a         {          p-=100;                                                 // them into rupies                                                r++;       }      return price (r,p);        }  int main(){price result;price obj1(10, 60);price obj2 (12, 80);result = obj1+obj2;obj1.Print();cout"\n";obj2.Print();cout"\n";cout"After Addition\n\n";result.Print();getch();}`

this assignment is correct but according to asignmnt ruppes and paisas shud be publicaly declared

i did dat but nw i thnk cz of dis its dispalyn like this:

Price is 12 rupees and 80 paisas

Price is 12 rupees and 80 paisas

Price is 23 rupees and 40 paisas

mean same numbers

hw to correct dat?

PLZZZZZZZZZZZZZZ TELL ME

TARIQ BHAI GUIDE PLZ

see the attached file for another idea solution
Attachments:
None of these is working well.

sir wtz da rite solution?

1

2

3

4

5

## VIP Member Badge & Others

------------------------------------

## Latest Activity

1 hour ago
Muhammad Bilal replied to BBA(6th smes)'s discussion assignment 1 spring 2021 in the group MGT402 Cost & Management Accounting
1 hour ago
★---★ ⱮԱϚҠȺហ ȺచȺហ ★---★ updated their profile
2 hours ago
Mani Siddiqui posted a discussion

3 hours ago
4 hours ago
4 hours ago
5 hours ago
5 hours ago