Skip to content

Instantly share code, notes, and snippets.

@Krishna-Ravi
Created August 30, 2020 07:39
Show Gist options
  • Save Krishna-Ravi/52db05c083935b121f74cb2748351713 to your computer and use it in GitHub Desktop.
Save Krishna-Ravi/52db05c083935b121f74cb2748351713 to your computer and use it in GitHub Desktop.
This is a solidity file containing smart contract of Medical store data.
pragma solidity 0.4.18 <= 0.6.12;
contract MedicineData{
string customerName;
string medicineName;
string medicineCompany;
int medicineCost;
int quantity;
function MedicineData(string newcustomerName, string newmedicineName, string newmedicineCompany,
int newmedicinecost, int newquantity) public {
customerName = newcustomerName;
medicineName = newmedicineName;
medicineCompany = newmedicineCompany;
medicineCost = newmedicinecost;
quantity = newquantity;
}
function getMedicineData() public view returns(string,string,string,int,int) {
return(customerName, medicineName, medicineCompany, medicineCost, quantity);
}
function setMedicineData(string newmedicineName,string newmedicineCompany, int newmedicinecost, int newquantity) public{
medicineName = newmedicineName;
medicineCompany = newmedicineCompany;
medicineCost = newmedicinecost;
quantity = newquantity;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment