Professional Documents
Culture Documents
Blockchain-3 102015037
Blockchain-3 102015037
Blockchain-3 102015037
Divyansh Kalia
102015037
3ENC-2
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0; contract
VotingSystem { struct Candidate {
uint id; string
name; uint age;
string sex; uint
income; uint
voteCount;
}
Candidate[] public candidates; constructor() {
// Add 3 to 4 candidates
candidates.push(Candidate(0, "Ridhi", 20, "Female", 50000, 1));
candidates.push(Candidate(1, "Akhil", 21, "Male", 75000, 1));
candidates.push(Candidate(2, "Rohit", 54, "Male", 35000, 0));
// You can add more candidates as needed
}