This question purely based on object-oriented programming.
Let’s see the Question:
Create a class DairyProduct with below attributes:
dairyld -> Number
dairyBrand -> String
productType -> String
price -> Number
grade -> String
Sample Test Cases:
Input 1:
5
011
Ankit
Milk
25
grade3
131
Rahul
Curd
35
Grade1
021
Heritage
Milk
27
Gaade2
055
Kwality
lazzi
40
Grade1
060
Amul
Yogurt
35
Grade1
3
Grade1
10
Grade2
20
Grade3
5
Amul
Milk
Output 1:
No dairy product found
Input 2:
5
011
Aavin
Milk
25
grade3
131
Hatsun
Curd
35
Grade1
021
Heritage
Milk
27
Grade2
055
Kwality
lazzi
40
Grade1
060
Amul
Yogurt
35
Grade1
3
Grade1
25
Grade2
15
Grade3
5
Amul
Yogurt
Output 2:
Dairy Brand: Amul
Price: 43.75
Nilesh Raut Selected answer as best November 29, 2023