Skip to content

Instantly share code, notes, and snippets.

@Krishna-Ravi
Created September 10, 2020 13:16
Show Gist options
  • Save Krishna-Ravi/64ff2b3433343adf6c07e96d2c87ada5 to your computer and use it in GitHub Desktop.
Save Krishna-Ravi/64ff2b3433343adf6c07e96d2c87ada5 to your computer and use it in GitHub Desktop.
Solidity code containing CarInsurance smart contract for storing data of customer
pragma solidity 0.4.18 <= 0.6.12;
contract CarInsurance{
string city;
string rto;
string company;
string model;
string customerName;
int phone;
string type_of_insurance;
int amt;
function CarInsurance(string newcity, string newrto, string newcompany,
string newmodel,string newcustomerName, int newphone,string newtypeofins,int newamt) public {
city = newcity;
rto = newrto;
company = newcompany;
model = newmodel;
customerName =newcustomerName;
phone= newphone;
type_of_insurance = newtypeofins;
amt =newamt;
}
function getCarInsurance() public view returns(string,string,string,string,string,int,string,int) {
return(city, rto, company, model,customerName,phone,type_of_insurance,amt);
}
function setCarInsurance(string newcity, string newrto, string newcompany,string newmodel,int newamt) public{
city = newcity;
rto = newrto;
company = newcompany;
model = newmodel;
amt = newamt;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment