Mock2 SBQ Java 21 Nov MUM With Answers
Mock2 SBQ Java 21 Nov MUM With Answers
Java 8 Java
1/3
Sample Input 1 - public
4
3111
bus
1000.0
4112
crane
1800.0
5114
Tractor
2400.0
6115
Scooter
2700.0
Scooter
Sample Output 1
number-3111
name-bus
price-1000.0
number-6115
name-Scooter
price-2700.0
Bash Medium
The input file with the data(testcase input / customized input) in the
format mentioned, automatically supplied as command line argument
when you run the script / command , you have written. Hence you don't
need to worry / work on, " How to bring the file to your script"?.
You just need to assume that a file is supplied to your script and read
the file, which is supplied as command line argument and process the
data in the file towards the given requirement.
You can use shell variables (e.g. $0,$1,$2) whichever is applicable for
your requirement to provide the command line argument.
Sample Testcase:
Input:
1|Latha|Third|Vikas|90|91
2|Neethu|Second|Meridian|92|94
3|Sethu|First|DAV|86|98
4|Theekshana|Second|DAV|97|86
5|Teju|First|Sangamithra|92|94
6|Theekshitha|Second|Sangamithra|99|100
Output:
5|Teju|First|Sangamithra|93
6|Theekshitha|Second|Sangamithra|99.5
3/3