-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathday24.sol
45 lines (40 loc) · 835 Bytes
/
day24.sol
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
// SPDX-License-Identifier: MIT
pragma solidity >=0.5.0 <0.9.0;
contract Day24 {
struct Student {
string name;
uint256[3] marks;
}
Student student;
function set(
string memory _name,
uint256 mathsMark,
uint256 sciMark,
uint256 engMark
) public {
uint256 i = 0;
student.name = _name;
student.marks[i] = mathsMark;
i++;
student.marks[i] = sciMark;
i++;
student.marks[i] = engMark;
}
function get()
public
view
returns (
string memory,
uint256,
uint256,
uint256
)
{
return (
student.name,
student.marks[0],
student.marks[1],
student.marks[2]
);
}
}