From 1b1af2d49bda6137f567ade610f24bee449c4f14 Mon Sep 17 00:00:00 2001 From: albinsabu2023 Date: Fri, 11 Oct 2024 22:32:55 +0530 Subject: [PATCH] quest 6 --- README.md | 4 ++-- quest6/Main.java | 14 ++++++++++++++ quest6/question.md | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cd294a0..f558e4f 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ - [x] q2.Employee class for findingTransport & secondHighest rating - [x] q3.Hotel available with wifi & in given month - [x] q4.Car class with passed test enviornment -- [x] q5. SIM class to sort with balance and check circle -- [x] q6. Cricket Player class to find avg by matches played +- [x] q5. SIM class to sort with balance and check circle +- [x] q6. Cricket Player class to find avg by matches played diff --git a/quest6/Main.java b/quest6/Main.java index fc5d4d5..d55140d 100644 --- a/quest6/Main.java +++ b/quest6/Main.java @@ -65,6 +65,20 @@ public void setRuns(int runs) { public class Main { public static void main(String[] args) { + // manuallly you can read input using loop + /* + * List input=new ArrayList<>(); + * Scanner sc=new Scanner(System.in); + * for (int i=0;i<4;i++){ + * int a=sc.nextInt(); + * String b=sc.nextLine();sc.nextInt(); + * int c=sc.nextInt(); + * int d=sc.nextInt(); + * int e=sc.nextInt(); + * Cricket c=new Cricket(a,b,c,d,e); + * input.add(c); + * } + */ Cricket c1 = new Cricket(100, "Sachin", 5, 150, 13000); Cricket c2 = new Cricket(101, "Sewag", 4, 120, 10000); Cricket c3 = new Cricket(102, "Dhoni", 7, 110, 7000); diff --git a/quest6/question.md b/quest6/question.md index 8a2f8b2..6f61e09 100644 --- a/quest6/question.md +++ b/quest6/question.md @@ -31,11 +31,48 @@ Finally, print grade. ## Test cases + +ID Name Ranking MatchesPlayed Runs +100 Sachin 5 150 13000 +101 Sehwag 4 120 10000 +103 Dhoni 7 110 7000 +104 Kohli 15 57 4400 + + ### input ``` +100 +Sachin +5 +150 +13000 +101 +sehwag +4 +120 +10000 +103 +Dhoni +7 +110 +7000 +104 +kohli +15 +57 +4400 +100 +``` + +## output + +``` +grade A +grade A +grade B ```