-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathline10.sol
More file actions
63 lines (48 loc) · 2.22 KB
/
line10.sol
File metadata and controls
63 lines (48 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// SPDX-License-Identifier: MIT
//SPDX-License-Idetifier: Unlicensed
// Solidity Struct
pragma solidity >=0.7.0;
contract structs {
struct Person {
uint id;
string name;
uint age;
uint height;
bool senior;
}
Person[] public people;
function addPerson(string memory _name, uint _age, uint _height) public {
people.push(Person(people.length, _name, _age, _height, _age>=65));
}
function getPerson(uint _id) public view returns(uint, string memory, uint, uint, bool){
return (people[_id].id, people[_id].name, people[_id].age, people[_id].height, people[_id].senior);
}
function getPerson2(uint _id) public view returns(uint, string memory, uint, uint, bool){
return (people[_id].id, people[_id].name, people[_id].age, people[_id].height, people[_id].senior);
}
function getPerson3(uint _id) public view returns(uint, string memory, uint, uint, bool){
return (people[_id].id, people[_id].name, people[_id].age, people[_id].height, people[_id].senior);
}
function getPerson4(uint _id) public view returns(uint, string memory, uint, uint, bool){
return (people[_id].id, people[_id].name, people[_id].age, people[_id].height, people[_id].senior);
}
function getPerson5(uint _id) public view returns(uint, string memory, uint, uint, bool){
return (people[_id].id, people[_id].name, people[_id].age, people[_id].height, people[_id].senior);
}
function getPerson6(uint _id) public view returns(uint, string memory, uint, uint, bool){
return (people[_id].id, people[_id].name, people[_id].age, people[_id].height, people[_id].senior);
}
function getPerson7(uint _id) public view returns(uint, string memory, uint, uint, bool){
return (people[_id].id, people[_id].name, people[_id].age, people[_id].height, people[_id].senior);
}
function getPerson8(uint _id) public {
Person memory newperson = student({
id: people[_id].id,
name: people[_id].name,
age: people[_id].age,
height: people[_id].height,
senior: people[_id].senior
});
people.push(newperson);
}
}