July 2016






#include <iostream>
#include <string>
using namespace std;

/* Assignment solution cs304 by Blu ( fb.com/92blu ) */

class Parcel{
                protected:  // changed from private to protected
                                int Id;
                                string senderName;
                                string senderAddress;
                                string receiverName;
                                string receiverAddress;
                                int weight;
                                int fee;
                public:
                                Parcel(){
                                                Id = 0;
                                                senderName = "";
                                                senderAddress = "";
                                                receiverName = "";
                                                receiverAddress = "";
                                                weight = 0;
                                                fee = 0;
                                }
                                void setId(int id){
                                                Id = id;
                                }
                                int getId(){
                                                return Id;
                                }
                               
                                void setSenderName(string sname){
                                                senderName = sname;
                                }
                                string getSenderName(){
                                                return senderName;
                                }
                               
                                void setSenderAddress(string saddress){
                                                senderAddress = saddress;
                                }
                                string getSenderAddress(){
                                                return senderAddress;
                                }
                               
                                void setReceiverName(string rname){
                                                receiverName = rname;
                                }
                                string getReceiverName(){
                                                return receiverName;
                                }
                               
                                void setReceiverAddress(string raddress){
                                                receiverAddress = raddress;
                                }
                                string getReceiverAddress(){
                                                return receiverAddress;
                                }
                               
                                void setWeight(int w){
                                                weight = w;
                                }
                                int getWeight(){
                                                return weight;
                                }
                               
                                void setFee(int f){
                                                fee = f;
                                }
                                int getFee(){
                                                return fee;
                                }
                               
};

class normalParcel: public Parcel{
                protected:
                                int chargesPerGram;
                                int basicCharges;
                                string shipmentType = "Normal";
                public:
                                void setChargePerGram(int charges){
                                                chargesPerGram = charges;
                                }
                                int getChargesPerGram(){
                                                return chargesPerGram;
                                }
                                void setBasicCharges(int charges){
                                                basicCharges = charges;
                                }
                                int getBasicCharges(){
                                                return basicCharges;
                                }
                                string getShipmentType(){
                                                return shipmentType;
                                }
};

class urgentParcel: public Parcel{
                protected:
                                int chargesPerGram;
                                int basicCharges;
                                string shipmentType = "Urgent";
                                int additionalFee;
                public:
                                void setChargePerGram(int charges){
                                                chargesPerGram = charges;
                                }
                                int getChargesPerGram(){
                                                return chargesPerGram;
                                }
                                void setBasicCharges(int charges){
                                                basicCharges = charges;
                                }
                                int getBasicCharges(){
                                                return basicCharges;
                                }
                                string getShipmentType(){
                                                return shipmentType;
                                }
                                void setAdditionalFee(int fee){
                                                additionalFee = fee;
                                }
                                int getAdditionalFee(){
                                                return additionalFee;
                                }
};
int main(int argc, char** argv) {
                cout<<"Assignment solution cs304 by Blu ( fb.com/92blu )"<<endl<<endl;
                int selection;
                while(1){
                                cout<<"Enter 1 for normal and 2 for urgent services.\n\nSelect type of service: ";
                                cin>>selection;
                                if(selection==1){
                                                int id, weight, charges, fee, overWeightCharges;
                                                string senderName, receiverName, senderAdd, receiverAdd, overWeight;
                                                cout<<"Normal service selected.\n";
                                                normalParcel p;
                                                cout<<"Enter receipt number: ";
                                                cin>>id;
                                                p.setId(id);
                                                cout<<"Enter sender name: ";
                                                cin>>senderName;
                                                p.setSenderName(senderName);
                                                cout<<"Enter sender Address: ";
                                                cin>>senderAdd;
                                                p.setSenderAddress(senderAdd);
                                                cout<<"Enter receiver name: ";
                                                cin>>receiverName;
                                                p.setReceiverName(receiverName);
                                                cout<<"Enter receiver address: ";
                                                cin>>receiverAdd;
                                                p.setReceiverAddress(receiverAdd);
                                                cout<<"Enter weight of parcel in grams: ";
                                                cin>>weight;
                                                p.setWeight(weight);
                                                cout<<"Enter basic charges for the parcel: ";
                                                cin>>charges;
                                                p.setBasicCharges(charges);
                                                cout<<"Enter fee per gram: ";
                                                cin>>fee;
                                                p.setFee(fee);
                                                cout<<"\n\n\nShipment Receipt\n-------------------\n";
                                                cout<<"Receipt No: "<<p.getId()<<endl;
                                                cout<<"Sender Name: "<<p.getSenderName()<<endl;
                                                cout<<"Sender Address: "<<p.getSenderAddress()<<endl;
                                                cout<<"Receiver Name: "<<p.getReceiverName()<<endl;
                                                cout<<"Receiver Address: "<<p.getReceiverAddress()<<endl;
                                                cout<<"Parcel Weight: "<<p.getWeight()<<endl;
                                                if(p.getWeight()>900){
                                                                overWeight = "Yes";
                                                } else {
                                                                overWeight = "No";
                                                }
                                                cout<<"Over Weight: "<<overWeight<<endl;
                                                cout<<"Basic Charges: "<<p.getBasicCharges()<<endl;
                                                if(overWeight=="Yes"){
                                                                overWeightCharges = (p.getWeight() - 900) * p.getFee();
                                                } else {
                                                                overWeightCharges = 0;
                                                }
                                                cout<<"Over Weight Charges: "<<overWeightCharges<<endl;
                                                cout<<"Shipment Total Charges: "<<p.getBasicCharges() + overWeightCharges<<endl;
                                                cout<<"Shipment type: "<<p.getShipmentType()<<endl;
                                                return 0;
                                } else if(selection==2){
                                                int id, weight, charges, fee, overWeightCharges, additionalfee;
                                                string senderName, receiverName, senderAdd, receiverAdd, overWeight;
                                                cout<<"Urgent service selected.\n";
                                                urgentParcel p;
                                                cout<<"Enter receipt number: ";
                                                cin>>id;
                                                p.setId(id);
                                                cout<<"Enter sender name: ";
                                                cin>>senderName;
                                                p.setSenderName(senderName);
                                                cout<<"Enter sender Address: ";
                                                cin>>senderAdd;
                                                p.setSenderAddress(senderAdd);
                                                cout<<"Enter receiver name: ";
                                                cin>>receiverName;
                                                p.setReceiverName(receiverName);
                                                cout<<"Enter receiver address: ";
                                                cin>>receiverAdd;
                                                p.setReceiverAddress(receiverAdd);
                                                cout<<"Enter weight of parcel in grams: ";
                                                cin>>weight;
                                                p.setWeight(weight);
                                                cout<<"Enter basic charges for the parcel: ";
                                                cin>>charges;
                                                p.setBasicCharges(charges);
                                                cout<<"Enter fee per gram: ";
                                                cin>>fee;
                                                p.setFee(fee);
                                                cout<<"Enter additional fee par gram: ";
                                                cin>>additionalfee;
                                                p.setAdditionalFee(additionalfee);
                                                cout<<"\n\n\nShipment Receipt\n-------------------\n";
                                                cout<<"Receipt No: "<<p.getId()<<endl;
                                                cout<<"Sender Name: "<<p.getSenderName()<<endl;
                                                cout<<"Sender Address: "<<p.getSenderAddress()<<endl;
                                                cout<<"Receiver Name: "<<p.getReceiverName()<<endl;
                                                cout<<"Receiver Address: "<<p.getReceiverAddress()<<endl;
                                                cout<<"Parcel Weight: "<<p.getWeight()<<endl;
                                                if(p.getWeight()>900){
                                                                overWeight = "Yes";
                                                } else {
                                                                overWeight = "No";
                                                }
                                                cout<<"Over Weight: "<<overWeight<<"g"<<endl;
                                                cout<<"Basic Charges: "<<p.getBasicCharges()+(p.getBasicCharges()/2)<<endl;
                                                if(overWeight=="Yes"){
                                                                overWeightCharges = (p.getWeight() - 900) * (p.getFee()+p.getAdditionalFee());
                                                } else {
                                                                overWeightCharges = 0;
                                                }
                                                cout<<"Over Weight Charges: "<<overWeightCharges<<endl;
                                                cout<<"Shipment Total Charges: "<<p.getBasicCharges() + (p.getBasicCharges()/2) + overWeightCharges<<endl;
                                                cout<<"Shipment type: "<<p.getShipmentType()<<endl;
                                                return 0;
                                } else {
                                                cout<<"Selected type of service is incorrect.\n\n";
                                }
                }
                return 0;

}




CODE:
<html>
<head><title>ADDITION CALCULATOR</title>
<script language"javascript">
var num1;
var num2;
var sum;
function processVal1(){
    num1 = document.calc.num.value;
    num1 = parseInt(num1);
    if(isNaN(num1)){
       document.getElementById("labl").innerHTML="Enter A correct number";
       document.calc.num.value = null;
    }
    else{
       document.getElementById("plus").disabled = true;
       document.getElementById("equ").disabled = false;
       document.getElementById("labl").innerHTML=""+num1+"+";
       document.calc.num.value = null;
       document.getElementById("num").focus();
    }
 }
function addVal(){
     num2 = document.calc.num.value;
     num2 = parseInt(num2);
     if(isNaN(num2)){
        alert("Enter A correct number");
     }
     else{
      sum = num1 + num2;
      document.calc.num.value = sum;
      document.getElementById("equ").disabled = true;
      document.getElementById("plus").disabled = false;
     }  
}
function clearVal(){
     document.getElementById("equ").disabled = false;
     document.getElementById("plus").disabled = false;
     document.getElementById("labl").innerHTML="&nbsp;";
     document.calc.num.value = null;
}

 </script>
</head>
<body>
<h2>ADDITION CALCULATOR</H2>
<form method="post" action="assignment.html" name="calc">
<table border="2" width="160px">
<tr>
<td><p id="labl">&nbsp;</p></td>
</tr>
<tr><td><input type="text" name="num" value="0" id="num"/></td>
</tr>
<tr>
<td>
<input type="button" name="add" value="+" onClick="processVal1();" id="plus" id="plus"/>
<input type="button" name="clr" value="C" onClick="clearVal();"/>
</td>
</tr>
<tr>
<td>
<input type="button" name="equ" value="=" onClick="addVal();" id="equ"/></td>
</tr>
</table>
</form>
</body>
</html>


[02] Which method of inventory valuation is NOT recommended by International Accounting Standards (IAS) for presenting the value of inventory in financial statements?

LIFO is not suggested by International Accounting standards (IAS) for presenting the value of inventory in financial statements.

[03] Give valid arguments in favor of method NOT recommended by IAS for presenting the value of inventory in balance sheet

1. The LIFO method treats the newest items of inventory as being sold first, and consequently the items remaining in inventory are recognized as if they were the oldest. This is generally not a reliable representation of actual inventory flows.

2. Because of inflation, where costs and expenses continue to rise, LIFO will have a lower profit margin than that of FIFO. This is because there is little to no inflation gap to allow LIFO businesses to capitalize on their inventory.

3. Because of LIFO’s generally lower reported profits, businesses utilizing this valuation of   inventory can have a harder time finding investors. Individuals and businesses looking to invest their money are usually looking for companies that show substantial profit growth over a period of time. With LIFO, profits will rise with inflation but they will not reflect the kind of healthy business investors are seeking.

4. Due to the complexities of LIFO , accountants can have a difficult time accurately recording costs and expenses. This is especially true of large businesses that have many operations that implement different inventory management techniques.

Q: 1

VALUATION OF STOCK BY  LIFO METHOD
Dated
Receipts
Issue
Value of Stock
Total amount
Remaining no. of units
Net Balance
Opening inventories
10units @ 100 per unit

10 x 100 = 1000
1000 /=

1000 /=
July 12 2016
5 units @ 120 per units

5 x 120 = 600
600 /=

1600 /=
July 15 2016

12 units @ 150 per unit
12 x 150 = 1800
1800 /=
3 units
300  /=


VALUATION OF STOCK BY  FIFO METHOD
Dated
Receipts
Issue
Value of   Stock
Total Amount
Remaining no. of units
Net  Balance
Opening inventories
10units @ 100 per unit

10 x 100 = 1000
1000 /=

1000 /=
July 12 2016
5 units @ 120 per units

5 x 120 = 600
600 /=

1600 /=
July 15 2016

12 units @ 150 per unit
12 x 150 = 1800
1800 /=
3 units
360 /=