I just started learning programming using dart and JavaScript & I tried doing a simple task assigned for myself for neramclasses.com Best NATA coaching center in trichy
I am collecting the following Data from the user.
- 12th Mark obtained,
- Maximum Mark of the Exam
- NATA Exam attempt 1 Mark
- NATA Exam attempt 2 Mark
- NATA Exam attempt 3 Mark
Field 1 and 2 are must input fields. 3,4,5 either one of them should be field (All three cannot be left empty).
The task which am confused to perform is
- if the user gives only one input of 3,4,5 need to return the single value else
- if the user gives two input out of 3,4,5 need to average them and return the value,
- if the user gives all the tree values (two greater values) among 3,4,5 has to be taken and return the average of the the two value
kindly give me an idea to perform this using either JavaScript or Dart
Here is the code I tried
void main() {
int nata1 = 100;
int nata2 = 122;
int nata3 = 98;
List<int> nata = [nata1, nata2, nata3];
if (nata.length == 1) {
print('return one non null value');
} else if (nata.length == 2) {
print('return Average of Two');
} else if (nata.length == 3) {
print('return Average of greater two score');
}
}
In the above code how to perform the action instead of print