Java Programming Exercise 1: CBSE Board Percentage Calculator

  Рет қаралды 1,189,355

CodeWithHarry

CodeWithHarry

Күн бұрын

Пікірлер: 6 900
@CodeWithHarry
@CodeWithHarry 4 жыл бұрын
Waise JEE main ka exam kis kis ne diya is baar? Will you solve this question?
@architjain3586
@architjain3586 4 жыл бұрын
Please reply sir
@greythirdeye1714
@greythirdeye1714 4 жыл бұрын
Yes I will
@sking7689
@sking7689 4 жыл бұрын
Sir why you Stopped DSA series plz continue it and tq for your hard work
@zafarkhann
@zafarkhann 4 жыл бұрын
done....where to submit??
@architjain3586
@architjain3586 4 жыл бұрын
public class main_class { public static void main(String[] args){ int total, score; float percentage; Scanner inputNumScanner = new Scanner(System.in); System.out.println("Enter the total, or max, score: "); total = inputNumScanner.nextInt(); System.out.println("Enter the score obtained: "); score = inputNumScanner.nextInt(); percentage = (score * 100/ total); System.out.println("The percentage is = " + percentage + " %"); } }
@nikstatus0735
@nikstatus0735 3 жыл бұрын
this question was really nice :) this is my approach to the problem: public static void main(String[] args) { Scanner sc = new Scanner(System.in); float total =500; System.out.println("Enter marks for 5 subjects: "); System.out.println("English: "); float a = sc.nextFloat(); System.out.println("Mathematics: "); float b = sc.nextFloat(); System.out.println("Physics: "); float c = sc.nextFloat(); System.out.println("Chemistry: "); float d = sc.nextFloat(); System.out.println("C++: "); float e = sc.nextFloat(); float sum = a+b+c+d+e; System.out.println("your total marks is: "); System.out.println(sum); float percentage = (sum/total)*100; System.out.println("Marks Percentage is: "); System.out.print(percentage); }
@vibhavnimkar9256
@vibhavnimkar9256 2 жыл бұрын
I used int but float is a better approach 👍👍
@Zeel_2003
@Zeel_2003 2 жыл бұрын
Sum is not initialized
@Ajeet_Kumar__
@Ajeet_Kumar__ 2 жыл бұрын
@@Zeel_2003 it's already initialized. float sum
@Zeel_2003
@Zeel_2003 2 жыл бұрын
@@Ajeet_Kumar__ yes sorry I noticed after commenting 😅
@gourabroy5447
@gourabroy5447 2 жыл бұрын
yes, because in float or double you can have floating-point values.
@AkshayPatil-wx6kz
@AkshayPatil-wx6kz 3 жыл бұрын
Harry Bhai ye meri life ka first program hai. I'm a Automobile Engineer. Thanks you so much Bhai etni achi playlist banane ke liye
@sabitakhadka8577
@sabitakhadka8577 Жыл бұрын
import java.util.Scanner; public class Marks { public static void main(String [] args) { Scanner sc = new Scanner(System.in); System.out.println("total marks of the subjects"); Float sub1 = sc.nextFloat(); System.out.println("economics"); Float sub2 = sc.nextFloat(); System.out.println("social"); Float sub3 = sc.nextFloat(); System.out.println("accounting"); Float sub4 = sc.nextFloat(); System.out.println("computer science"); Float sub5 = sc.nextFloat(); System.out.println("english"); Float sub6 = sc.nextFloat(); System.out.println("nepali"); Float sum = sub1+sub2+sub3+sub4+sub5+sub6; System.out.println(sum); float average = sum*100/600; System.out.println("total percentage is:" + average); } }
@Shauryaaaaaaaa
@Shauryaaaaaaaa 4 жыл бұрын
System.out.println("Harry is brilliant");
@sanmeet6975
@sanmeet6975 2 жыл бұрын
Error
@realheckertrustmebro
@realheckertrustmebro 2 жыл бұрын
@@sanmeet6975 why?
@sanmeet6975
@sanmeet6975 2 жыл бұрын
@@realheckertrustmebro Becuz it's not written in a programme it's written in a yt comment
@realheckertrustmebro
@realheckertrustmebro 2 жыл бұрын
@@sanmeet6975 😂 ohk
@abhishekdangale1560
@abhishekdangale1560 2 жыл бұрын
Not semicolon needed 😁👍
@omnikam3045
@omnikam3045 4 жыл бұрын
Dear Harry bhaiya, I am student. Due to lockdown ,online lecture started but I couldn't understand these coding concepts. Firstly i am very stressful about it but ur teaching clears all my doubts. Thanks a lot and keep making these lectures😊😊😊😊
@AltafKhan-re7tg
@AltafKhan-re7tg 2 жыл бұрын
right bruh
@bhargavbharadwaz1562
@bhargavbharadwaz1562 Жыл бұрын
Hello Harry bhiya, It's really an amazing course, I'm learning java as a Kickstart. here is the solution of the exercise import java.util.Scanner; public class CWH_exercise_01 { public static void main(String[] args) { System.out.println("To calculate the percentage of a student out of 100"); Scanner sc = new Scanner(System.in); int s1,s2,s3,s4,s5; double percentage; String name; System.out.println("Enter name of the student - "); name=sc.nextLine(); System.out.println("Enter marks of subject 1: "); s1=sc.nextInt(); System.out.println("Enter marks of subject 2: "); s2=sc.nextInt(); System.out.println("Enter marks of subject 3: "); s3=sc.nextInt(); System.out.println("Enter marks of subject 4: "); s4=sc.nextInt(); System.out.println("Enter marks of subject 5: "); s5=sc.nextInt(); percentage=((s1+s2+s3+s4+s5)/500.0)*100; System.out.print("Percentage obtained by "); System.out.print(name); System.out.print(" is "); System.out.println(percentage); } }
@vishalsrivastva540
@vishalsrivastva540 Жыл бұрын
have u executed this ?
@vishalsrivastva540
@vishalsrivastva540 Жыл бұрын
1st u cant print name variable without declaring it , 2nd it doesn't print value in decimals like if i take 3 subject and total mark is 140 out of 300 it shows 46% , 3rd idk why if i am dividing total marks by 500 and then multiplying with 100 it shows 0% but if first multiply like total marks*100 then dividing by 500 it shows correctly
@-lyxics
@-lyxics Жыл бұрын
@@vishalsrivastva540 it doesn't give zero for 3rd problem you mentioned for me. it works fine here is my code. //Write a programme to find out the percentage obtained by a student in 5 subjects. //Take marks from user. import java.util.Scanner; public class Exercise_1 { public static void main(String[] args) { Scanner scan= new Scanner(System.in); System.out.println("Enter the marks of 5 subjects (Max Marks per subject =100)"); float marks1= scan.nextFloat(); float marks2= scan.nextFloat(); float marks3= scan.nextFloat(); float marks4= scan.nextFloat(); float marks5= scan.nextFloat(); scan.nextLine(); System.out.println("Enter Student Name:"); String name= scan.nextLine(); float TotalMarksObtained= marks1+marks2+marks3+marks4+marks5; float MaxMarks=500; float percent= (TotalMarksObtained/MaxMarks) *100; System.out.println("Percentage Obtained by" + name + " is:"+ percent); System.out.println("Thank You!"); } }
@frienkun6739
@frienkun6739 11 ай бұрын
nice @@-lyxics
@Syed_Miraz_Ali
@Syed_Miraz_Ali 7 ай бұрын
//write a program that calculates the percentage of a student's marks // in 5 subjects import java.util.Scanner; public class Cbse { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int math,phy,chem,bio,eng; System.out.println("Enter math marks"); math = sc.nextInt(); System.out.println("Enter physics marks"); phy = sc.nextInt(); System.out.println("Enter chemistry marks"); chem = sc.nextInt(); System.out.println("Enter biology marks"); bio = sc.nextInt(); System.out.println("Enter english marks"); eng = sc.nextInt(); double total = math+phy+chem+bio+eng; double p = total/500; double percentage = p*100; System.out.println("Marks in math = "+math); System.out.println("Marks in physics = "+phy); System.out.println("Marks in chemistry = "+chem); System.out.println("Marks in biology = "+bio); System.out.println("Marks in english = "+eng); System.out.println("Your percentage is "+percentage+"%"); } }
@tikunlegend3985
@tikunlegend3985 2 жыл бұрын
Thanks for the lectures bhaiya and this is my code : import java.util.Scanner; public class Exercise1 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("marks obtained in maths"); float maths = sc.nextFloat(); System.out.println("marks obtained in science"); float science = sc.nextFloat(); System.out.println("marks obtained in sst"); float sst = sc.nextFloat(); System.out.println("marks obtained in english"); float english = sc.nextFloat(); System.out.println("marks obtained in odia"); float odia = sc.nextFloat(); System.out.println("percentage of marks obtained in class 10 cbse exam"); float percentage = (maths + science + sst + english + odia)/500 * 100; System.out.print(percentage); System.out.println(" %"); } }
@Crazy00962
@Crazy00962 2 жыл бұрын
Mst
@shaikhanis148
@shaikhanis148 2 жыл бұрын
I pick up int then I understand there should br float
@JayPrakash-mj4ik
@JayPrakash-mj4ik 2 жыл бұрын
not working, please debug
@amolmagic1008
@amolmagic1008 Жыл бұрын
great last line should be System.out.print(" %");
@mattMurdock009
@mattMurdock009 2 жыл бұрын
This is the simplest approach i have 😅 import java.util.Scanner; public class CWH_Percentage { public static void main(String[] args){ System.out.println("Enter your marks of 5 subjects"); Scanner sc = new Scanner(System.in); System.out.println("Enter subject one marks"); float a = sc.nextFloat(); System.out.println("Enter subject two marks"); float b = sc.nextFloat(); System.out.println("Enter subject third marks"); float c = sc.nextFloat(); System.out.println("Enter subject fourth marks"); float d = sc.nextFloat(); System.out.println("Enter fifth subject marks"); float e = sc.nextFloat(); System.out.println("Your percentage is "); float ttl = (a+b+c+d+e); float per = (ttl/500)*100; System.out.println(per); } }
@afsarahmed3580
@afsarahmed3580 Жыл бұрын
Bro i did the same 😃
@maqadasjavaid2054
@maqadasjavaid2054 Жыл бұрын
@@afsarahmed3580 i also
@kuldeep7587
@kuldeep7587 Жыл бұрын
i did this import java.util.Scanner; public class java_input { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("marks in mathematics out of 100 is"); double a = sc.nextDouble(); System.out.println("marks in physics out of 100 is"); double b = sc.nextDouble(); System.out.println("marks in chemistry out of 80 is"); double c = sc.nextDouble(); System.out.println("your percentage is "); double percentage = (a + b + c)/280 * 100; System.out.println(percentage); } }
@JaiKumar-ul6qx
@JaiKumar-ul6qx Жыл бұрын
But bro isme ek problem hai sir ne bola hai maximum Marks jaruri hai ki 100 ho to program is hisaab se banana but tumhare program me Max. Fix hai 100 agar max. Marks change Kiya to tumhara answer galat aaega.
@Explore-2.4
@Explore-2.4 Жыл бұрын
@@afsarahmed3580 Hi. Bro
@shrikant_18
@shrikant_18 9 ай бұрын
Thanks harry bhai best teacher cleared all concepts till now looking easy just because of you thanku sir again 🙏 Import Java.util.Scanner; Public class Exercise{ Public static void main(string[ ] args){ Scanner sc = new Scanner(system.in); System.out.println("enter marks of sub 1"); Float a = sc.nextFloat(); System.out.println("enter marks of sub 2"); Float b = sc.nextFloat(); System.out.println("enter marks of sub 3"); Float c = sc.nextFloat(); System.out.println("enter marks of sub 4"); Float d = sc.nextFloat(); System.out.println("enter marks of sub 5"); Float e = sc.nextFloat(); Float total =a+b+c+d+e; system.out.println("total marls obtained are "); System.out.println(total); System.out.println("enter maximum marks of all subjects"); Long Max=sc.nextLong(); System.out.println("percentage"); Int percentage=total*100/Max; System.out.println("percentages = "); System.out.println(percentage); } }
@MK90911
@MK90911 5 ай бұрын
bohat sari mistakes show kr raha ha
@souravkumar7283
@souravkumar7283 4 жыл бұрын
I'm learning "C" Programming language from your playlist and believe me it's incredibly amazing and super easy. I think it's because of your teaching skills. Harry sir amazing work. Harry = Hard working boy
@bsprogrammer7632
@bsprogrammer7632 4 жыл бұрын
@@ng_allrounder you are doing hard work that's good
@souravkumar7283
@souravkumar7283 4 жыл бұрын
@@ng_allrounder what is the name of your channel sir??
@kirtansoni3163
@kirtansoni3163 4 жыл бұрын
you are a seller not a teacher please don`t lie harry bhai is se nikalo yahaa se NG Allrounder ko...please
@kirtansoni3163
@kirtansoni3163 4 жыл бұрын
NG Allrounder don`t lie
@gamerhere6394
@gamerhere6394 3 жыл бұрын
Error Harry is not defined;
@papai_kumar
@papai_kumar 2 жыл бұрын
Hello Dada Very Very Thankyou, Love from Kolkata ❤️ Import Java.until.Scanner; Public Class Exercise_1 { Public Static Void Main (Strings [ ]args){ System.out.println("Higher secondary Marks"); Scanner Sc = new Scanner (System.in); System .out .println("Bangla"); Float a= sc.nextfloat ( ); System.out.println(English); Float b= sc.nextfloat (); System.out.println( Mathematics); Float c= sc. nextFloat (); System.out.println (Physics); Float d= sc.nextFloat (); System.out.println( "Biology"); Float e = sc.nextFloat(); Float Sum = a+b+c+d+e ; Sout(Sum); Float Total= 100*5; Sout(Total); Float Percentage=((Sum/Total)*100); Sout (Percentage); } }
@karanbhola3958
@karanbhola3958 5 ай бұрын
Hnji trader saab
@devjoychakraborty888
@devjoychakraborty888 Жыл бұрын
3:05 import java.util.Scanner; public class Exercise_1 { public static void main(String[] args) { try (Scanner sc = new Scanner (System.in)) { System.out.print("Enter your name: "); String name = sc.nextLine(); System.out.print("Enter the total marks of this exam: "); int total_marks = sc.nextInt(); System.out.print("Enter the marks in English: "); int a = sc.nextInt(); System.out.print("Enter the marks in Physics: "); int b = sc.nextInt(); System.out.print("Enter the marks in Chemistry: "); int c = sc.nextInt(); System.out.print("Enter the marks in Biology: "); int d = sc.nextInt(); System.out.print("Enter the marks in Mathematics: "); int e = sc.nextInt(); float sum = (a+b+c+d+e); float per = (sum/total_marks)*100; System.out.println(name+" got "+per+" % in AISSCE."); } } }
@mathsbuzzz
@mathsbuzzz Жыл бұрын
Good job bro 🎉
@careertrickstipswithme6678
@careertrickstipswithme6678 8 ай бұрын
@varadpensalwar
@varadpensalwar 6 ай бұрын
Wrong answer because if we take any subject marks greater than 100 then it will give more than 100 percentage
@shahupatil8991
@shahupatil8991 6 ай бұрын
@@varadpensalwar bhai abhi toh basic chalu hai itna bhi bohot hai
@bebaak_rai
@bebaak_rai 6 ай бұрын
sum*100/total_marks
@Aryas-h9u
@Aryas-h9u 6 ай бұрын
its been 3 years im starting it now. YO got it without a single error.
@iconismfx340
@iconismfx340 2 жыл бұрын
Hello big Bro thank you for this Course . Program: import java.util.Scanner; public class Exercise_01 { public static void main(String[] args) { Scanner sc=new Scanner(System.in); float total=500; System.out.println("Enter Marks Obtain In Five Subject:"); System.out.println("Marathi:"); Float a = sc.nextFloat(); System.out.println("English:"); Float b = sc.nextFloat(); System.out.println("Hindi:"); Float c = sc.nextFloat(); System.out.println("Histroy:"); Float d = sc.nextFloat(); System.out.println("Mathematics:"); Float e = sc.nextFloat(); Float sum = a + b + c + d + e; System.out.println("Your Total Marks Obtain is:"); System.out.println(sum); Float percentage = (sum / total) * 100; System.out.println("Final Marks Percentage is:"); System.out.println(percentage); } }
@shryanshrai2818
@shryanshrai2818 3 ай бұрын
Thank bro
@shinejaiswal4002
@shinejaiswal4002 3 жыл бұрын
🙏Thanks to Code with Harry 🥰 I've rented a laptop 💻 🙃 to learn programming for 6 days because I cannot afford it to buy and i wrote my first successful code.Although screen is cracked but whatever I'm being learnt through this channel is very valuable.
@thejfcad9020
@thejfcad9020 2 жыл бұрын
bhai mobile pe hi karleta compile programs lmao browser pe free compilers hote hai
@Raj_9507_
@Raj_9507_ 2 жыл бұрын
@@thejfcad9020 XD
@_its._gaurav._
@_its._gaurav._ 10 ай бұрын
This is my second time learning java i learnt java when i was in 8th,9th &10th and later cuz of jee i stopped learning java so harry's the best teacher on net If u learn java offline its the best way to learn Here;s my assignment import java.util.Scanner; public class CWH_Assignemnt { public static void main(String[] args) { Scanner ob= new Scanner(System.in); System.out.println("Enter the marks for the 5 subjects"); int m1=ob.nextInt(); int m2=ob.nextInt(); int m3=ob.nextInt(); int m4=ob.nextInt(); int m5=ob.nextInt(); double sum=m1+m2+m3+m4+m5; double avg=(sum/500)*100; //double percentage=avg*100; System.out.print("The percentage scored is: "+ avg); //System.out.println(); } }
@Today_Today_
@Today_Today_ Жыл бұрын
Thank you so much sir for making this playlist. YOU ARE VERY HARD WORKING FOR US.❤❤ Sir this code I make in JVDROID mobile app. import java.util.Scanner; public class Main { public static void main(String[] args) { System.out.println("ENTER YOUR MARKS OUT OF 100"); Scanner scan = new Scanner(System.in); System.out.println("Enter marks of subject ENGLISH"); int eng = scan.nextInt(); System.out.println("Enter marks of subject MATHEMATICS"); int math = scan.nextInt(); System.out.println("Enter marks of subject SCIENCE"); int sc = scan.nextInt(); System.out.println("Enter marks of subject ENVIRONMENT STUDIES"); int es = scan.nextInt(); System.out.println("Enter marks of subject HISTORY "); int his = scan.nextInt(); int sum = eng + math + sc + es + his; float per = (sum * 100) / 500f; System.out.println("YOUR PERCENTAGE IS : " + per); } } 👆👆👆
@bucks4631
@bucks4631 Жыл бұрын
the best code
@ravanparmar9999
@ravanparmar9999 11 ай бұрын
I think it's divided by 5 not by 500
@disha12268
@disha12268 2 жыл бұрын
Brother the course is amazing! Thanks a lot for the course. You are putting a lot of efforts in this Java course , I am Thankful to you for all your efforts. You are the best teacher ever. I can't express that how much thankful I am . My answer for the problem is: public static void main(String[] args) { // TODO Auto-generated method stub Scanner aj = new Scanner(System.in); float total = 500; System.out.println("Enter English Marks"); float sub1 = aj.nextFloat(); System.out.println("Enter SocialScience Marks"); float sub2 = aj.nextFloat(); System.out.println("Enter Computer Marks"); float sub3 = aj.nextFloat(); System.out.println("Enter Science Marks"); float sub4 = aj.nextFloat(); System.out.println("Enter Hindi Marks"); float sub5 = aj.nextFloat(); float sum = sub1+sub2+sub3+sub4+sub5; System.out.print("The total marks are: "); System.out.println(sum); float Percentage = (sum/total)*100; System.out.print("The percentage is: "); System.out.print(Percentage); } } *Thanks a lot*
@amolmagic1008
@amolmagic1008 Жыл бұрын
i am new to coding why there is not this line 👇 import java.util.Scanner;
@manishmaheshwari4497
@manishmaheshwari4497 2 жыл бұрын
Respect Sir, Your presentation is mind blowing hats off to your style 👌👏 below is the code import java.util.Scanner; public static void main(String [] args) { Scanner sc = new Scanner(System.in); System.out.println("Enter Marks :1"); float marksf = sc.nextFloat(); System.out.println("Enter Marks :2"); float marks1f = sc.nextFloat(); System.out.println("Enter Marks :3"); float marks2f = sc.nextFloat(); System.out.println("Enter Marks :4"); float marks3f = sc.nextFloat(); System.out.printf("Enter Marks :5"); float marks4f = sc.nextFloat(); float sumf = (marksf + marks1f + marks2f + marks3f + marks4f) / 5; System.out.println("Total Percent : "+sumf +"%"); }
@Luffy-ml5lt
@Luffy-ml5lt 2 жыл бұрын
why cant i use int instead of float while taking marks as input
@arushi1705
@arushi1705 2 жыл бұрын
@@Luffy-ml5lt you can use int but if someone got a decimal value like 76.5 in english then you won't be able to calculate it because it's not an integer...so to avoid that we use float as it accepts both integers and decimal numbers.
@2826rai
@2826rai Жыл бұрын
@@arushi1705 CBSE never gives marks in decimal :) your percentage can be in decimal but your marks would never be decimal :)
@anchitkaushal.7009
@anchitkaushal.7009 3 ай бұрын
thanks harry bhai for teaching java🤝... import java.util.Scanner; public class Exercise1 { public static void main(String[] args) { System.out.println("Percentage of student"); Scanner S = new Scanner(System.in); System.out.println("Enter the number of first subject"); float MA = S.nextFloat(); System.out.println("Enter the number of second subject"); float PHY = S.nextFloat(); System.out.println("Enter the number of third subject"); float CH= S.nextFloat(); System.out.println("Enter the number of fourth subject"); float ENG = S.nextFloat(); System.out.println("Enter the number of fifth subject"); float COM = S.nextFloat(); float totalpercentage = MA/5+PHY/5+CH/5+ENG/5+COM/5; System.out.println("Total precentage is: "); System.out.println(totalpercentage); } }
@crazysprouts2
@crazysprouts2 Ай бұрын
But this program only work when marks are out of 100. I have made this one check it out -> package JavaQuestions; import java.util.*; public class Ques1 { public static void main(String[] args) { // program to Calculate percentage of a given student in cbse board exam. // HIs MArks from 5 subs must be taken as input from the kyeboard // Float Physics, Chemistry, Biology, Computer, English; Scanner markScanner = new Scanner(System.in); // physics System.out.println("Enter the marks of Physics"); Float Physics = markScanner.nextFloat(); System.out.print("total marks of physics -> "); int outOfP = markScanner.nextInt(); // Chemistry System.out.println("Enter the marks of Chemistry"); Float Chemistry = markScanner.nextFloat(); System.out.print("total marks of Chemistry -> "); int outOfC = markScanner.nextInt(); // biology System.out.println("Enter the marks of Biology"); Float Biology = markScanner.nextFloat(); System.out.print("total marks of Biology -> "); int outOfB = markScanner.nextInt(); // Computer System.out.println("Enter the marks of Computer"); Float Computer = markScanner.nextFloat(); System.out.print("total marks of Computer -> "); int outOfCo = markScanner.nextInt(); // english System.out.println("Enter the marks of English"); Float English = markScanner.nextFloat(); System.out.print("total marks of English -> "); int outOfE = markScanner.nextInt(); // Printing int totalMarksOfSubject = outOfB + outOfC + outOfCo + outOfE + outOfP; Float Total = Physics + Chemistry + Biology + Computer + English; Float totalPercentage = (Total / totalMarksOfSubject) * 100; System.out.println("The percentage is : " + totalPercentage + "%"); } }
@piyushchaturvedi8993
@piyushchaturvedi8993 4 жыл бұрын
Thanks sir for videos 😇 //Java program to find percentage of Five Subjects :- import java.util.Scanner; public class Cbse { public static void main(String[] args) { Scanner sc = newScanner(System.in); System.out.print(" Enter the max marks of each Subjects :- "); int max= sc.nextInt(); max= max*5 ; System.out.print("Enter marks for subject 1:- ") ; int s1= sc.nextInt(); System.out.print("Enter marks for subject 2:- ") ; int s2= sc.nextInt(); System.out.print("Enter marks for subject 3:- ") ; int s3= sc.nextInt(); System.out.print("Enter marks for subject 4:- ") ; int s4= sc.nextInt(); System.out.print("Enter marks for subject 5:- ") ; int s5= sc.nextInt(); float total = s1+s2+s3+s4+s5; System.out.print("total marks id:- " + total) ; System.out.print("calculating percentage for 5 subject :- ") ; float percentage = (total / max) * 100; System.out.println(" Marks Percentage = " + Percentage); } }
@achaldehankar9494
@achaldehankar9494 3 жыл бұрын
Thanks 😊
@sanjaykumarthakur2479
@sanjaykumarthakur2479 3 жыл бұрын
Thanks
@sanjaykumarthakur2479
@sanjaykumarthakur2479 3 жыл бұрын
@@achaldehankar9494 tum turnt strt kia ho kya.... Code with Harry
@sanjaykumarthakur2479
@sanjaykumarthakur2479 3 жыл бұрын
@@achaldehankar9494 yes tmhra run ho gya program tum apna insta id ya telegram id bta skte ho kuch error aa rha h
@piyushchaturvedi8993
@piyushchaturvedi8993 3 жыл бұрын
Welcome guys 🤗
@nehacasharmak
@nehacasharmak 2 жыл бұрын
Hi Harry, I am very thankful to you. I am a B.com students and looking forward to thoroughly learning Java by end of the course as I want to make a career in IT. import java.util.Scanner; public class Marksheet { public static void main(String [] args) { System.out.println("Marksheet"); System.out.println("Total number of subject Marks"); Scanner sc = new Scanner(System.in); System.out.println("Kannada="); int a = sc.nextInt(); System.out.println("English="); int b = sc.nextInt(); System.out.println("Hindi="); int c = sc.nextInt(); System.out.println("Social Studies="); int d = sc.nextInt(); System.out.println("Science="); int e = sc.nextInt(); System.out.println("Maths="); int f = sc.nextInt(); int Sum = a+b+c+d+e+f; System.out.println(Sum); int Average = Sum*100/625; System.out.println("Total %"); System.out.println(Average); }
@Adityasharma04
@Adityasharma04 2 жыл бұрын
Bro..but your Average may be decimal value then how can you use" int "for that?
@SatyaPrakash-cw3vl
@SatyaPrakash-cw3vl 2 жыл бұрын
@@Adityasharma04 although I used float for it !
@Adityasharma04
@Adityasharma04 2 жыл бұрын
@@SatyaPrakash-cw3vl yaa.. that's right 👍
@sadashish2002
@sadashish2002 6 ай бұрын
Thank you harry bhaiya .. Aap such m bahut great ho jo ki india k worst area se aane waale student ko v coding sikha rahe ho ...wo v sara chij bilkul free.. Ram ji 🚩 aapko sukhi healthy humesha rakhe 🙏
@mohitpatil4099
@mohitpatil4099 2 жыл бұрын
// Total marks of each subject is 20 import java.util.Scanner; public class MyClass { public static void main(String args[]) { Scanner sr = new Scanner(System.in); System.out.println("Enter the marks 1 "); int a = sr.nextInt(); System.out.println("Enter the marks 2 "); int b = sr.nextInt(); System.out.println("Enter the marks 3 "); int c = sr.nextInt(); double d = (a+b+c)*100/60; System.out.println("Percantage of the student is = "+ d); } }
@ajaypatidar8227
@ajaypatidar8227 Жыл бұрын
Last row me +d kyu likha he only d se ni execute hota kya
@spandan_swain
@spandan_swain Жыл бұрын
@@ajaypatidar8227 append kiya ans ko...string ki tarah...
@nitingahlawat5857
@nitingahlawat5857 Жыл бұрын
percentage points m kyu nahi aati
@lizabhadana1350
@lizabhadana1350 11 ай бұрын
Dear harry bhai I am a student.Your coding cocepts clear my all doubts.I have done the exersise.Please check and reply to me. I made this of 400 marks. import java.util.Scanner; public class Main { public static void main(String[] args) { System.out.println("Taking out percentage"); Scanner sc = new Scanner(System.in); System.out.println("Enter first subject marks"); int marks = sc.nextInt(); float pct = marks*100/400; System.out.println(pct); Thank you for the very good course to help us learn java.
@ishan.doescare
@ishan.doescare 2 жыл бұрын
Sir, this is my code and I have made this only in termux in Android... I am really happy as well as surprised as I never thought I could write a single line in a code... And now because of you, I am able to write this only in termux(as my laptop is broken😭) import java.util.Scanner; class Percentage { public static void main(String[] args) { System.out.println("Put Your Marks for 5 Subject"); Scanner sc = new Scanner(System.in); System.out.println("Subject 1"); float a = sc.nextFloat(); System.out.println("Subject 2"); float b = sc.nextFloat(); System.out.println("Subject 3"); float c = sc.nextFloat(); System.out.println("Subject 4"); float d = sc.nextFloat(); System.out.println("Subject 5"); float e = sc.nextFloat(); System.out.println("Total Number"); float ttl = sc.nextFloat(); float per = ( a + b + c + d + e)*100/ttl; System.out.println("Your Percentage Is"); System.out.println(per); } } I again worked on this and changed it a little, here is the the new one✌️ import java.util.Scanner; class Percentage2 { public static void main(String[] args) { System.out.println("Put Your Marks For 5 Subjects"); Scanner sc = new Scanner(System.in); System.out.println("Subject 1"); float a = sc.nextFloat(); System.out.println("Out of"); float max = sc.nextFloat(); System.out.println("Subject 2"); float b = sc.nextFloat(); System.out.println("Subject 3"); float c = sc.nextFloat(); System.out.println("Subject 4"); float d = sc.nextFloat(); System.out.println("Subject 5"); float e = sc.nextFloat(); System.out.println("Total Number"); float ttl = max*5; float per = ( a + b + c + d + e)*100/ttl; System.out.println("Your Percentage Is"); System.out.println(per); } }
@risingbulls01
@risingbulls01 2 жыл бұрын
import java.util.Scanner; public class percentagecalc { public static void main(String[] args) { double total, average, percentage; Scanner bb = new Scanner(System.in); System.out.println("enter physics marks : "); int a = bb.nextInt(); System.out.println("enter chemistry marks :"); int b = bb.nextInt(); System.out.println("enter math marks :"); int c = bb.nextInt(); System.out.println("enter sanskrit marks :"); int d = bb.nextInt(); System.out.println("enter englist marks :"); int e = bb.nextInt(); //calculate total average and percentage total = a+b+c+d+e; average =(total/5.00); percentage =(total/500.00)*100; /* Print all results */ System.out.println("Total marks ="+total); System.out.println("Average marks = "+average); System.out.println("Percentage = "+percentage); } }
@FactxNews615
@FactxNews615 2 жыл бұрын
what we do if i have 6 subjects🙄
@risingbulls01
@risingbulls01 2 жыл бұрын
@@FactxNews615 simple just modify it
@TechnicalAdarshji123
@TechnicalAdarshji123 8 ай бұрын
Today i start a Java Course. its course is a very intresting.❤❤❤❤❤❤❤❤
@sonup73
@sonup73 8 ай бұрын
i am also start this course
@m.nisar_ali
@m.nisar_ali 2 жыл бұрын
Thanks, Harry Sir, Today I solved my First Java Exercise; at the start, I was confused but after solving the exercise I found that it was quite easy and it rose my confidence to learn to program. import java.util.Scanner; public class Proj_05_Java { public static void main(String[] args) { System.out.println("Exercise 1"); System.out.println("Calculating Percentage of Total Marks"); Scanner sc = new Scanner(System.in); System.out.println("Total Marks"); float TotalMarks = sc.nextInt(); System.out.println("Enter Marks Obtained in subject 1"); float a = sc.nextInt(); System.out.println("Enter Marks Obtained in subject 2"); float b = sc.nextInt(); System.out.println("Enter Marks Obtained in subject 3"); float c = sc.nextInt(); System.out.println("Enter Marks Obtained in subject 4"); float d = sc.nextInt(); System.out.println("Enter Marks Obtained in subject 5"); float = sc.nextInt(); System.out.print("Marks Obtained in all Subjects = "); float sum = a + b + c + d + e; System.out.println(sum); System.out.print("Out of = "); System.out.println(TotalMarks); System.out.print("Percentage = "); float percentage = sum * 100 / TotalMarks; System.out.println(percentage); } }
@abhirawat9288
@abhirawat9288 2 жыл бұрын
Bro variable tmne float Lia hai aur nextInt likh rhe hom
@m.nisar_ali
@m.nisar_ali 2 жыл бұрын
@@abhirawat9288 thanks, bro now I have changed it to float
@abhirawat9288
@abhirawat9288 2 жыл бұрын
😌Thanks bro.
@ritikjha14
@ritikjha14 9 ай бұрын
Next Int ki jagah float hoga
@arsalanali3574
@arsalanali3574 9 ай бұрын
variable nhi data type unho ne float lya ha like float ,int ,short they all are data types@@abhirawat9288
@kumarrohan6148
@kumarrohan6148 3 жыл бұрын
Really Very Enjoying the Course brother ❤✌✌ Answer to the Exercise: import java.util.Scanner; class exercise_01 { public static void main(String[] args) { float m1, m2, m3, m4, m5, total_marks; float percentage; Scanner sc = new Scanner(System.in); System.out.print("Enter the marks in subject 1: "); m1 = sc.nextInt(); System.out.print("Enter the marks in subject 2: "); m2 = sc.nextInt(); System.out.print("Enter the marks in subject 3: "); m3 = sc.nextInt(); System.out.print("Enter the marks in subject 4: "); m4 = sc.nextInt(); System.out.print("Enter the marks in subject 5: "); m5 = sc.nextInt(); total_marks = (m1+m2+m3+m4+m5); percentage = (total_marks/500)*100; System.out.println("The percentage obtained by the student is: "+percentage); } }
@mania20
@mania20 3 жыл бұрын
result 0 dikha rha
@believeongod97
@believeongod97 3 жыл бұрын
package demo; import java.util.Scanner; public class muju { public static void main(String[] args) { Scanner s=new Scanner(System.in); int m1; int m2; int m3; int m4; int m5; int m6; double p; m1=s.nextInt(); m2=s.nextInt(); m3=s.nextInt(); m4=s.nextInt(); m5=s.nextInt(); m6=s.nextInt(); int t=m1+m2+m3+m4+m5+m6; p =(t/600.0)*100; System.out.println("the total mark is "+ t); System.out.println("the percentage is" + p); System.out.println("congrats bro pass hogay "); } }
@believeongod97
@believeongod97 3 жыл бұрын
😂🤣😂🤣😂🤣
@kumarrohan6148
@kumarrohan6148 3 жыл бұрын
@@believeongod97 😂😂
@hardikpanchal3839
@hardikpanchal3839 2 жыл бұрын
The program which I have developed for the above problem statement is : import java.util.Scanner; public class calc_percentage { public static void main(String[] args){ Scanner sc = new Scanner(System.in); System.out.println("Calculating the Marks of the Students based on their CBSE Subjects"); System.out.println("Enter the marks for each subject within 100"); System.out.print("Enter the Marks for Physics: "); float sub1 = sc.nextFloat(); System.out.println(); System.out.print("Enter the Marks for Chemistry: "); float sub2 = sc.nextFloat(); System.out.println(); System.out.print("Enter the Marks for Biology: "); float sub3 = sc.nextFloat(); System.out.println(); System.out.print("Enter the Marks for Mathematics: "); float sub4 = sc.nextFloat(); System.out.println(); System.out.print("Enter the Marks for English (1st Language): "); float sub5 = sc.nextFloat(); System.out.println(); float sub_total = sub1 + sub2 + sub3 + sub4 + sub5; System.out.println("The total for all subjects is " + sub_total); float percentage = (sub_total/500)*100; System.out.println("The Final CBSE Percentage of the student is " + percentage); } }
@abhifox4431
@abhifox4431 2 жыл бұрын
Bro the code is not so big actually, you are just elaborating it too much think about it I just wrote it in just 11 lines
@charankarnati2794
@charankarnati2794 2 жыл бұрын
@@abhifox4431 how? by using switch???
@nidhisatyapriya7084
@nidhisatyapriya7084 2 жыл бұрын
@@charankarnati2794 switch will be of no use here..he would've reduced the code length simply by skipping those println lines/ instructions..
@Asphalt9.8
@Asphalt9.8 Жыл бұрын
import java.util.Scanner; public class Main { public static void main(String[] args) { System.out.println("Enter the Marks of Subjects"); Scanner sc = new Scanner(System.in); float Total Marks = 500f; float Outof_Marks = 100f; System.out.print("Enter The Marks of English: "); float a = sc.nextFloat(); System.out.print("Enter The Marks of Maths: "); float b = sc.nextInt(); System.out.print("Enter the Marks of Science: "); float c = sc.nextFloat(); System.out.print("enter the marks of Hindi: "); float d sc.nextFloat(); System.out.print("Enter the Marks of Maratht: "); float e = sc.nextFloat(); float per = (a+b+c+d+e)/Total_Marks Outof_Marks; System.out.print("The Total Percentage is: "); System.out.print(per); } }
@deepblogs01
@deepblogs01 Жыл бұрын
Hello Sir, Sir i have done this and your video always very knowledgeable for me. import java.util.Scanner; public class Deep { public static void main(String[] args) { System.out.println("Taking input from the user"); Scanner sc= new Scanner(System.in); System.out.println("Enter 1st Subject Number"); int s1 =sc.nextInt(); System.out.println("Enter 2nd Subject Number"); int s2 =sc.nextInt(); System.out.println("Enter 3rd Subject Number"); int s3 =sc.nextInt(); System.out.println("Enter 4rth Subject Number"); int s4 =sc.nextInt(); System.out.println("Enter 5th Subject Number"); int s5 =sc.nextInt(); int sum = s1+s2+s3+s4+s5; float percentage=sum*100/500; System.out.println(sum); System.out.println("Your percentage is = "+percentage); } }
@avirajora2404
@avirajora2404 Жыл бұрын
you are using int and float both simultaneously
@anshvermaAK47
@anshvermaAK47 Жыл бұрын
@@avirajora2404 so what's wrong in it??
@arijitmohapatra8737
@arijitmohapatra8737 4 жыл бұрын
Happy teacher's day Harry sir😍🥰
@Neetu-it9zc
@Neetu-it9zc Жыл бұрын
O my God... I am watching this video on teacher's day 2023😊
@mentality.emperors
@mentality.emperors Жыл бұрын
​@@Neetu-it9zcsame😂 happy teacher's day harry sir
@gamingwitharman3857
@gamingwitharman3857 4 жыл бұрын
This exercise was very fun || please make more exercises like this || (It actually forces you to recall and learn the java deeply)
@abhisheksuman2959
@abhisheksuman2959 3 жыл бұрын
Thankyou Bhaiya for this great course and your effort. I learnt everything till this 4th video and here is the solution of the question. I added something more in this, please have a look. Scanner sc = new Scanner(System.in); System.out.println("Enter your Name"); String Name = sc.nextLine(); System.out.println("Enter Your Marks in each Subject"); System.out.println("Marks Obtained in Physics"); int P = sc.nextInt(); System.out.println("Total marks in Physics"); int t1 = sc.nextInt(); System.out.println("Marks obtained in Chemistry"); int C = sc.nextInt(); System.out.println("Total marks in Chemistry"); int t2 = sc.nextInt(); System.out.println("Marks obtained in Mathematics"); int M = sc.nextInt(); System.out.println("Total marks in Mathematics"); int t3 = sc.nextInt(); System.out.println("Marks obtained in English"); int E = sc.nextInt(); System.out.println("Total marks in English"); int t4 = sc.nextInt(); System.out.println("Marks obtained in Hindi"); int H = sc.nextInt(); System.out.println("Total marks in Hindi"); int t5 = sc.nextInt(); System.out.println("Marks obtained in Biology"); int B = sc.nextInt(); System.out.println("Total marks in Biology"); int t6 = sc.nextInt(); double percent = (P + C + M + E + H + B) / (double)(t1 + t2 + t3 + t4 + t5 + t6) * 100; System.out.print("Hey "); System.out.print(Name); System.out.print(" Your total percentage is : "); System.out.println(percent);
@unknownpsycho5264
@unknownpsycho5264 2 жыл бұрын
Bro all of this is good but it will not work for decimals and will crash so I recommend you to use float instead of the int, this will make your code flexible and you will be able to find percentage in both decimals and a natural number
@abhisheksuman2959
@abhisheksuman2959 2 жыл бұрын
@@unknownpsycho5264 okay bruh. Thankyou ❤️
@bikramxjeetxsingh
@bikramxjeetxsingh 3 ай бұрын
Thanks, Harry. I just solved this exercise using a double variable and manual user inputs for individual marks. I got the percentage. It's not polished like professional work, but it's a start.
@dhananjayrai8450
@dhananjayrai8450 4 жыл бұрын
1.1k views in 14 minutes means people supports you and you gives us best content... Hat's off Harry Bhai... Keep Making Video's... 🙏🙏🙏👍👍👍🔥🔥🔥
@kirtansoni3163
@kirtansoni3163 4 жыл бұрын
@@ng_allrounder you are not teacher you are project seller like zerox shops don't do this please
@aviralsrivastava-kx7nd
@aviralsrivastava-kx7nd 3 ай бұрын
I tried doing the challenge, with the knowledge I gained so far from you, in this playlist. I have not seen the video completely but here's what I did: import java.sql.SQLOutput; import java.util.Scanner; public class Percentage_calculator { public static void main(String[] args) { Scanner A= new Scanner(System.in); System.out.println("--->Please note that Maximum marks for each subject is 100."); System.out.println("Enter marks scored in English."); int E= A.nextInt(); System.out.println("Enter marks scored in Hindi."); int H= A.nextInt(); System.out.println("Enter marks scored in Maths."); int M= A.nextInt(); System.out.println("Enter marks scored in Science."); int S= A.nextInt(); System.out.println("Enter marks scored in Political Science."); int P= A.nextInt(); // calculation of total marks: int T= E+H+M+S+P; System.out.println("Total marks scored by you is: "+ T); // calculating the percentage: double U = T/500D; System.out.println("divisio answer: " + U); double V= U*100; System.out.println("Total percentage scored by you is: " + V); } }
@KoushikDas2005
@KoushikDas2005 Жыл бұрын
Thanks a lot for the first five lectures of this free Java course.❤
@ArsalanKhattak-s9d
@ArsalanKhattak-s9d 2 ай бұрын
Wow Sir This Was Very Easy Question....I am From Paksitan....And Am A Studenet of Computer Science
@ayushsawadh4840
@ayushsawadh4840 3 жыл бұрын
System.out.println("Enter English marks"); int english = sc.nextInt(); System.out.println("Enter Maths marks"); int maths = sc.nextInt(); System.out.println("Enter Science marks"); int science = sc.nextInt(); System.out.println("Total marks are"); int Total = english + maths + science; System.out.println(Total); System.out.println("Total percentage is"); float percentage = Total * 0.4f; System.out.println(percentage);
@mdmatiurrahman7373
@mdmatiurrahman7373 4 жыл бұрын
Someone....plz..Give a Noble Prize to Harry sir....Watching your C tutorial... And I am now at 9:40:06 ....Understood everything clearly...And love from Bangladesh...
@rahulmohuture
@rahulmohuture 3 жыл бұрын
Tum Bangladeshi logo ko Hindi samjh mai ati hai?
@mdmatiurrahman7373
@mdmatiurrahman7373 3 жыл бұрын
@@rahulmohuture Hindi is the second language of Bangladesh... not English... I can talk in Hindi and understand Hindi when I was 4/5, now I am 16 . Iha par sab hindi samajhtahe...
@rahulmohuture
@rahulmohuture 3 жыл бұрын
@@mdmatiurrahman7373 badhiya 👍
@eodum13
@eodum13 3 жыл бұрын
@@mdmatiurrahman7373 take care of hindu's there
@krrishedits4466
@krrishedits4466 Жыл бұрын
My approach is: import java.util.Scanner; public class percentage_calculator { public static void main(String[] args) { System.out.println("PERCENTAGE CALCULATOR"); Scanner s = new Scanner(System.in); System.out.println("enter marks of English"); float eng = s.nextFloat(); System.out.println("enter marks of Maths"); float math = s.nextFloat(); System.out.println("enter marks of Science"); float sci = s.nextFloat(); System.out.println("enter marks of SST"); float sst = s.nextFloat(); System.out.println("enter marks of Hindi"); float hin = s.nextFloat(); int total = 500; System.out.println("total percentage:"); float marks = (eng+math+sci+sst+hin); System.out.println(marks/total*100); } }
@shreya63338
@shreya63338 Жыл бұрын
Thank you.. i had a doubt in this
@krrishedits4466
@krrishedits4466 Жыл бұрын
😊
@FaizKhan-mp6jj
@FaizKhan-mp6jj Жыл бұрын
What if i enter 120 as my English marks ??
@Dexter_06
@Dexter_06 2 ай бұрын
public static void main(String[] args) { int a = 316; int b = 500; int c = 100; int d = a * c / b; System.out.println(d);
@aaassociates815
@aaassociates815 2 жыл бұрын
sir here is my solution of the exercise 1. Time done at 0:39 import java.util.Scanner; public class exercise1 { public static void main(String[] args) { System.out.println("Take inputs of marks of every children out of 100"); Scanner sc = new Scanner(System.in); System.out.print("Enter the marks of English: "); float a = sc.nextFloat(); System.out.print("Enter the marks of Maths: "); float b = sc.nextFloat(); System.out.print("Enter the marks of Science: "); float c = sc.nextFloat(); System.out.print("Enter the marks of Social Studies: "); float d = sc.nextFloat(); System.out.print("Enter the marks of Computer: "); float e = sc.nextFloat(); float percentage = (a+b+c+d+e)*100/500; System.out.print("The percentage of the child is "); System.out.print(percentage); } }
@stormybeast1203
@stormybeast1203 2 жыл бұрын
U can use double data type
@aaassociates815
@aaassociates815 2 жыл бұрын
@@stormybeast1203 yes but for betterment like if someone gave .25 as input then it will throw error that's why i used float
@RYTPol_
@RYTPol_ 2 жыл бұрын
but what if any subject mark is out of other than 100
@saranshverma03
@saranshverma03 2 жыл бұрын
@@RYTPol_ ya
@studyport4698
@studyport4698 2 жыл бұрын
@@RYTPol_ take total also from the user.।। Same like others subject marks obtaining
@missyanshu
@missyanshu 4 жыл бұрын
Best channel to learn programming from the very beginning... Interesting program
@slienthero9646
@slienthero9646 3 жыл бұрын
did you complete java course : )
@believeongod97
@believeongod97 3 жыл бұрын
Hello 😂😂😂
@digrajtiwari4180
@digrajtiwari4180 Жыл бұрын
Day 2 of this great course 😊
@princejaniya8368
@princejaniya8368 10 ай бұрын
nice exercise here's my answer : import java.util.Scanner; public class Reportcard { public static void main(String[] args) { System.out.println("Report card of the student"); Scanner sc = new Scanner(System.in); System.out.println("Enter subject 1 marks:"); double s1 = sc.nextDouble(); System.out.println("Enter subject 2 marks:"); double s2 = sc.nextDouble(); System.out.println("Enter subject 3 marks:"); double s3 = sc.nextDouble(); System.out.println("Enter subject 4 marks:"); double s4 = sc.nextDouble(); System.out.println("Enter subject 5 marks:"); double s5 = sc.nextDouble(); double Total = s1+s2+s3+s4+s5; System.out.println("Total marks of student is: "+ Total); double Percentage = (Total/500)*100; System.out.println("Total Percentage is : "+ Percentage); sc.close(); } }
@MohdSuhailMSP1
@MohdSuhailMSP1 3 жыл бұрын
1:51 Exercise 1.1 import java.util.Scanner; public class Percentage_Calculate { public static void main (String []args){ Scanner M = new Scanner(System.in); System.out.println("\t:::Enter Your Marks in Exam::: "); System.out.println("Enter Your Marks in hindi"); float A = M.nextFloat(); System.out.println("Enter Your Marks in English"); float B = M.nextFloat(); System.out.println("Enter Your Marks in Maths"); float C = M.nextFloat(); System.out.println("Enter Your Marks in Physics"); float D = M.nextFloat(); System.out.println("Enter Your Marks in Chemistry"); float E = M.nextFloat(); System.out.println(" "); System.out.println("\t\t\t::: Your Result ::: "); System.out.println("Your Marks in Hindi " + A); System.out.println("Your Marks in English " + B); System.out.println("Your Marks in Maths " + C); System.out.println("Your Marks in Physics " + D); System.out.println("Your Marks in Chemistry " + E); System.out.println(" "); float Sum = A+B+C+D+E; System.out.println("\t\t\tYour Total Marks "+ Sum); float Percentage = (A+B+C+D+E)/5; System.out.println(" "); System.out.println("\t\t\tYour Percentage "+ Percentage); if(Percentage >=90){ System.out.println("Grade is A++"); System.out.println("Division = Ist"); } else if(Percentage >=80){ System.out.println("Grade is A"); System.out.println("Division = Ist"); } else if (Percentage >=60){ System.out.println("Grade is B"); System.out.println("Division = Ist"); } else if(Percentage >=50){ System.out.println("Grade is C"); System.out.println("Division = IInd"); } else if (Percentage >=33){ System.out.println("Grade is D"); System.out.println("Division = IIIrd"); } else{ System.out.println("Failed"); } } }
@anugupta6834
@anugupta6834 2 жыл бұрын
bhai program kemaa chod de tune bawasir bna deya
@MohdSuhailMSP1
@MohdSuhailMSP1 2 жыл бұрын
Kya galat hai isme
@MohdSuhailMSP1
@MohdSuhailMSP1 2 жыл бұрын
Wo to Apni pasand hai na Bas Code Galat nahi Hona chahiye
@anugupta6834
@anugupta6834 2 жыл бұрын
@@MohdSuhailMSP1 bhai tujse nhi ho peyega ..
@abhaagrawal4685
@abhaagrawal4685 Жыл бұрын
Thank you so much for this course sir.I started learning java just few days ago with your videos. here is my code import java.util.Scanner; public class CWH_06_studentmark { public static void main(String[] args) { System.out.println("Enter the total number"); Scanner sc= new Scanner(System.in); int total= sc.nextInt(); System.out.println("Enter the number of sub1"); float s1= sc.nextFloat(); System.out.println("Enter the number of sub2"); float s2= sc.nextFloat(); System.out.println("Enter the number of sub3"); float s3= sc.nextFloat(); System.out.println("Enter the number of sub4"); float s4= sc.nextFloat(); System.out.println("Enter the number of sub5"); float s5= sc.nextFloat(); float b= s1+s2+s3+s4+s5; float per= b*100/total; System.out.println("The percentage is:"); System.out.println(per); } }
@kartikhereboii
@kartikhereboii Жыл бұрын
Great learning experience as always sir ! Here's the code : import java.util.Scanner; public class Exercise1 { public static void main(String[] args) { double total_marks, percentage; Scanner sr=new Scanner(System.in); System.out.println("Enter your marks in Mathematics : "); int marks1=sr.nextInt(); System.out.println("Enter your marks in English : "); int marks2=sr.nextInt(); System.out.println("Enter your marks in History : "); int marks3=sr.nextInt(); System.out.println("Enter your marks in Physics : "); int marks4=sr.nextInt(); System.out.println("Enter your marks in Science : "); int marks5=sr.nextInt(); total_marks=marks1+marks2+marks3+marks4+marks5; System.out.println("Total Marks : "+total_marks); percentage=total_marks*100/500; System.out.println("Your Percentage Score is : "+percentage+" %"); } }
@ranaumar-n8m
@ranaumar-n8m Жыл бұрын
bro you apply the average formula
@kartikhereboii
@kartikhereboii Жыл бұрын
@@ranaumar-n8m yeah, I realised that lol. Thanks Now, it's corrected.
@devilrohan8462
@devilrohan8462 Жыл бұрын
@kartiksengar9032 thanks bro i'm completly new at learning java so i didn't knew that you can also print like this like using the result in the middle but thanks to you now i know. System.out.println("Your Percentage Score is : "+percentage+" %");
@kartikhereboii
@kartikhereboii Жыл бұрын
@@devilrohan8462 You learn new something, everyday cause everyday is a new beginning : )
@anantchandak9574
@anantchandak9574 3 жыл бұрын
Sout(Taking the marks); Scanner sc = new; Scanner(System.in); Int a = sc.nextInt(); Int b = sc.nextInt(); Int c = sc.nextInt(); Int d = sc.nextInt(); Sout(enter mark 1); Sout(enter mark 2); Sout(enter mark 3); Sout(enter mark 4); Int persentage = (a + b + c + d) × 100 / 400; Sout("The persentage is); Sout(persentage); Is it correct
@aesthetic_vibes_404
@aesthetic_vibes_404 2 жыл бұрын
No
@anantchandak9574
@anantchandak9574 2 жыл бұрын
@Sameer singh yeah
@avinash9628
@avinash9628 26 күн бұрын
my approach i took a hint too btw here is it: import java.util.Scanner; public class exercise1 { public static void main (String[] args) { Scanner sc = new Scanner(System.in); System.out.println("enter marks of subject 1"); float f1 = sc.nextFloat(); System.out.println("enter marks of subject 2"); float f2 = sc.nextFloat(); System.out.println("enter marks of subject 3"); float f3 = sc.nextFloat(); System.out.println("enter marks of subject 4"); float f4 = sc.nextFloat(); System.out.println("enter marks of subject 5"); float f5 = sc.nextFloat(); float sum = f1+f2+f3+f4+f5; float percentage = sum/500*100; System.out.println("percentage will be: "); System.out.println(percentage); } }
@aneeshkumar6116
@aneeshkumar6116 3 жыл бұрын
Please make DSA using JAVA MUCH needed.{Your doing a great job sir,you are a person with high morals. Education should never be sold ,only distributed}🙏🙏🙏
@shakir2083
@shakir2083 Жыл бұрын
Watching in dec 2022 Still can't get better course than this Thanku Harry Sir You are Brilliant Love you harry bhai ❤️❤️
@ziggyjaz5854
@ziggyjaz5854 Жыл бұрын
But you still searched for next one.
@KoushikDas2005
@KoushikDas2005 Жыл бұрын
There are some subjects where full marks is different from other major subjects. So, better to have full marks as input from user in each subject and then use it as the total marks. It's much easier to think like this when you understand the practical situation of calculating the % of marks in schools and all .
@KaushikDubey-19
@KaushikDubey-19 Ай бұрын
done sir jo basics h jese println me koi bhi symbols add kese krna h ("codewithharry"+"thank u"+"100%")
@manojkumarverma7931
@manojkumarverma7931 3 жыл бұрын
Hello Harry Sir... First of all Thank You so much for making these lessons available for us. I am learning Java through your videos. I am learning for development purpose not for any exam... I tried the exercise, plz check the code. I wrote this code for calculating percentage out of 500 marks. Plz check... import java.util.Scanner; public class NewClass { public static void main (String [] args){ System.out.println ("Taking Input From the User"); Scanner sc = new Scanner(System.in); System.out.print("Enter Marks: "); int mrk = sc.nextInt(); float pct = mrk*100/500F; System.out.println("Your Achieved Percentages are:" + pct + "%"); } }
@badboy-jt2gd
@badboy-jt2gd 2 жыл бұрын
Bhi ye end par Kya Kya ha 🤔
@ayushtripathi2605
@ayushtripathi2605 4 жыл бұрын
Happy Teacher's Day In Advance Sir By The way 5 september is my birthday also sir and my aim is to become coder. Nice Combination Thank you sir
@TheTop-tx9js
@TheTop-tx9js 3 жыл бұрын
System. out. print ("Thanks sir for your java playlist you are awesome"); respect++;
@gametimewitharyan6665
@gametimewitharyan6665 3 жыл бұрын
You Wrote this comment in mobile
@Shubham.8527
@Shubham.8527 3 жыл бұрын
@@gametimewitharyan6665 maybe
@TheCrazyRitik
@TheCrazyRitik 3 жыл бұрын
@@gametimewitharyan6665 yes because of spaces after "."
@gametimewitharyan6665
@gametimewitharyan6665 3 жыл бұрын
@@TheCrazyRitik Yes LOL
@TheCrazyRitik
@TheCrazyRitik 3 жыл бұрын
@@gametimewitharyan6665 still active after 5 months lol op
@royalflames6533
@royalflames6533 Ай бұрын
System.out.println("Harry bhaiiii ek number !!!");
@mojizabbas9477
@mojizabbas9477 2 жыл бұрын
Hi bro the code is -: package input_12; import input_12.input; import java.util.Scanner; public class input { public static void main( String []args) { System.out.println("taking input from user"); Scanner sc = new Scanner(System.in); System.out.println("Marks in subject 1 -:"); long a = sc.nextInt(); System.out.println("Marks in subject 2-:"); long b = sc.nextInt(); System.out.println("Marks in subject 3 -:"); long c = sc.nextInt(); System.out.println("Marks in subject 4 -:"); long d = sc.nextInt(); System.out.println("Marks in subject 5 -:"); long e = sc.nextInt(); System.out.println("Maximum Marks in each subject"); long j = sc.nextInt(); long y = j*5; float t = a+b+c+d+e; float f = t*100; float x = f/y; System.out.print("Percentage of your marks is "); System.out.println(x); } }
@samikhyapaikray8916
@samikhyapaikray8916 2 жыл бұрын
Sm
@Zeel_2003
@Zeel_2003 2 жыл бұрын
Thank you so much Harry bhai!! I spent 8 days in total from writing program and then solving errors but now end of the day I learned a lot from you and that errors. Thank you so much🙏❤
@LEGENDKINETIC
@LEGENDKINETIC 6 ай бұрын
great, btw whats your suggestion for a newbie like me who's starting now? after you have done for more than 2 years....
@Zeel_2003
@Zeel_2003 6 ай бұрын
@LEGENDKINETIC if you are college, I can bet that your prof try making easy topic complicated. I recommend you learn from Harry's video and code along on side. I am currently in US by the time I posted that comment I was learning Intro to prog using Java in college but was totally lost in class and can't understand anything
@LEGENDKINETIC
@LEGENDKINETIC 6 ай бұрын
@@Zeel_2003 Oh great, thanks for advice.. I did already learnt python from Harry sir 😁and now I am learning java from him and its really amazing.. Also, dude whats your working role and company etc. if you can share.. I'm interested in knowing more about you and what all things you did..
@monikavarshney5029
@monikavarshney5029 4 жыл бұрын
Happy Teachers day Harry bhai You are the only teacher who is teaching programming in hindi And it is my pleasure to take you as my teacher
@tejasborate1393
@tejasborate1393 2 жыл бұрын
2 yr pahle aaj ke din hi aapne comment kiya tha na 😅
@Pratham-ee5qz
@Pratham-ee5qz 5 ай бұрын
Sir I started learning today and I find this series absolutely helpful and awesome, Here's my code: import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner sc= new Scanner(System.in); System.out.print("Enter total marks : "); float z= sc.nextFloat(); System.out.println("Enter your marks out of 100"); System.out.print("English: "); float a= sc.nextFloat(); System.out.print("Mathematics: "); float b= sc.nextFloat(); System.out.print("Social Studies: "); float c= sc.nextFloat(); System.out.print("Science: "); float d= sc.nextFloat(); System.out.print("Hindi: "); float e= sc.nextFloat(); float sum = a+b+c+d+e; System.out.print("Your total marks: "); System.out.println(sum); float percentage= (sum/z)*100; System.out.print("Your total percentage:"); System.out.println(percentage);
@not-in-sync4119
@not-in-sync4119 2 жыл бұрын
This is my approach :) import java.util.Scanner; public class Main{ public static void main(String[] args){ System.out.println("Take Input from the user "); Scanner sc = new Scanner(System.in); System.out.println("Enter Marks of 5 Subjects "); System.out.println("Enter Marks in Mathematics "); float a = sc.nextFloat(); System.out.println("Enter Marks in Physics "); float b = sc.nextFloat(); System.out.println("Enter Marks in Chemistry "); float c = sc.nextFloat(); System.out.println("Enter Marks in English "); float d = sc.nextFloat(); System.out.println("Enter Marks in Sanskrit "); float e = sc.nextFloat(); float total = a + b + c + d + e; float average = (total / 5); float percentage = (total / 500) * 100; System.out.println("The total of All Subjects is: "); System.out.println(total); System.out.println("The Average of All Subjects is: "); System.out.println(average); System.out.println("The Percentage of All Subjects is: "); System.out.println(percentage); } }
@chinmay79
@chinmay79 2 жыл бұрын
The code for the exercise is given below. I must admit that I used int variable but couldn't derive the percentage as the data type change when deriving percentage errored. So I changed it to float and it worked. Although I believe Total and sum print could be avoided. I will give it a try again. Source Code: import java.util.Scanner; public class CWH_06_Excercise1 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.print("Enter Sub 1 :"); float sub1 = sc.nextFloat(); System.out.print("Enter Sub 2 :"); float sub2 = sc.nextFloat(); System.out.print("Enter Sub 3 :"); float sub3 = sc.nextFloat(); System.out.print("Enter sub 4 :"); float sub4 = sc.nextFloat(); System.out.print("Enter sub 5 :"); float sub5 = sc.nextFloat(); float sum = sub1+sub2+sub3+sub4+sub5; System.out.println(sum); float Total = 100*5; System.out.println(Total); float Percent = ((sum/Total)*100); System.out.println(Percent); Output: Enter Sub 1 :76 Enter Sub 2 :67 Enter Sub 3 :89 Enter sub 4 :98 Enter sub 5 :56 386.0 500.0 77.200005
@vinitvaidya4322
@vinitvaidya4322 2 жыл бұрын
thanku bruh
@yusrax3
@yusrax3 Жыл бұрын
maybe u could do type casting (double) when storing in percentage variable n then it may work even w int datatype
@prateeksaxena9735
@prateeksaxena9735 2 жыл бұрын
thanks sir to motivate i have made it from myself and if u think it is correct then please let me know in reply-----Tanishq Saxena ------ Scanner s = new Scanner(System.in); System.out.print("enter the marks in Maths: "); float a= s.nextFloat(); System.out.print("enter the marks in physics: "); float b= s.nextFloat(); System.out.print("enter the marks in chemistry: "); float c= s.nextFloat(); System.out.print("enter the marks in english: "); float d= s.nextFloat(); System.out.print("enter the marks in CS: "); float e= s.nextFloat(); float sum= a+b+c+d+e; float percentage= sum/5; System.out.print("the total percentage: "); System.out.print(percentage); System.out.println("%");
@crus4d3r.
@crus4d3r. 6 ай бұрын
I am pretty late for the quiz but here is what I did.. BTW THNX FOR THESE AWESOME LECTURES!!!! import java.util.Scanner; public class CWH_FirstExercise { public static void main(String[] args) { Scanner kami = new Scanner(System.in); System.out.println("name of the person?"); String name = kami.nextLine(); System.out.println("Total marks of the following exam?"); int total_marks = kami.nextInt(); System.out.println("This is a calculator of percentage of net marks obtained in 5 subjects"); // 1st sub System.out.println("Name of your 1st subject?"); String first_subject = kami.next(); System.out.print("Marks in "); System.out.println(first_subject ); int m1 = kami.nextInt(); // 2nd subject System.out.println("Name of your 2nd subject?"); String second_subject = kami.next(); System.out.print("Marks in "); System.out.println(second_subject ); int m2 = kami.nextInt(); // 3rd subject System.out.println("Name of your 3rd subject?"); String third_subject = kami.next(); System.out.print("Marks in "); System.out.println(third_subject ); int m3 = kami.nextInt(); //4th subject System.out.println("Name of your 4th subject?"); String fourth_subject = kami.next(); System.out.print("Marks in "); System.out.println(fourth_subject ); int m4 = kami.nextInt(); //5th subject System.out.println("Name of your 5th subject?"); String fifth_subject = kami.next(); System.out.print("Marks in "); System.out.println(fifth_subject ); int m5 = kami.nextInt(); float sum = m1 + m2 + m3 + m4 + m5; float res = (sum/total_marks)*100; System.out.print(name ); System.out.println("has got "); System.out.print(res + " percentage in this examination"); } } AGAIN... THNX FOR THESE AWESOME LECTURES!!
@liliies081
@liliies081 3 ай бұрын
I am 3 years late but here's my program. Hope u give me some advice on making it more better: import java.util.Scanner; public class CWH_CBSEMarks { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("Enter marks of five subjects: "); int m1 = sc.nextInt(); int m2 = sc.nextInt(); int m3 = sc.nextInt(); int m4 = sc.nextInt(); int m5 = sc.nextInt(); int sum = m1 + m2 + m3 + m4 + m5; float percentage = sum/500.00f *100; System.out.println("The total percentage you got for CBSE is "+percentage); } }
@duniyajyebhadmenk2538
@duniyajyebhadmenk2538 3 жыл бұрын
int Avg =(E+H+M+P+C) *100/500; S.O.P (Avg); Logic to yahi hoga sir.
@DevTravels-jy8rj
@DevTravels-jy8rj Жыл бұрын
//Code to calculate total percentage in exams import java.util.Scanner; public class Main { public static void main(String[] args) { float numberOfSubjects=5; Scanner sc=new Scanner(System.in); System.out.print("Enter Full Marks: "); float fm=sc.nextFloat(); System.out.print("Enter 2nd language: "); String secondLanguage=sc.next(); System.out.print("Enter English Marks: "); float engMarks=sc.nextFloat(); System.out.print("Enter "+secondLanguage+" Marks: "); float secondLanguageMarks=sc.nextFloat(); System.out.print("Enter Maths Marks: "); float mathsMarks=sc.nextFloat(); System.out.print("Enter Science Marks: "); float scienceMarks=sc.nextFloat(); System.out.print("Enter SSt Marks: "); float sstMarks=sc.nextFloat(); float totalMarksPercentage=((engMarks+secondLanguageMarks+mathsMarks+scienceMarks+sstMarks)/(fm*numberOfSubjects))*100; System.out.println("You scored "+totalMarksPercentage+"% in total"); } }
@gunjanmahara9239
@gunjanmahara9239 10 ай бұрын
In totalmarkspercentage variable there is no need to include( fm*number of students ) it will not give correct ans instead just write (fm))*100;
@divyeshsoni9846
@divyeshsoni9846 2 жыл бұрын
Scanner ab = new Scanner(System.in); System.out.println("enter your total marks"); int a = ab.nextInt(); double marks = a/500*100; System.out.println("your percentage is =" +marks);
@HogganGaming
@HogganGaming 2 жыл бұрын
Why u used ab.Nextint?
@filmyduniya3692
@filmyduniya3692 Жыл бұрын
double marks = a/500.0f×100 aise hota h bro aapne float (f) nhi lagaya h
@hritikgulia.
@hritikgulia. Жыл бұрын
bhai usse percentage hi lele na vo hi print kr dio
@CRYIZER_REAL
@CRYIZER_REAL 3 ай бұрын
Brother basic se Java sikhna hai Or jaldi bhi sikhna hai Basic complete hona chahiye bs Mera Aapka konsa course sahi rahega Please. Reply.......... 🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏
@youtubetest5574
@youtubetest5574 4 жыл бұрын
Very amazing video👍 When I got notification, I shared with my friends instantly.
@avinashdharme2234
@avinashdharme2234 3 жыл бұрын
Keep uploading such video's, these are helping a lot❤️
@samirmishra9946
@samirmishra9946 4 жыл бұрын
Yeh comment toh pakka comments section mein kho jayega. nevertheless lots of love harry bhai. ek dill he dedo:P..!! //EXERCISE 1 by harry. import java.util.Scanner; public class Exercise1 { public static void main(String[]args){ Scanner sc = new Scanner(System.in); System.out.println(" -- CBSE Board Percentage Calculator. --"); System.out.println("Enter your per subject's maximum marks. :"); short max = sc.nextShort(); System.out.println("Enter your five subjects marks and find the percentage :)"); System.out.println("Enter Subject 1's Marks. :"); byte sub1 = sc.nextByte(); System.out.println("Enter subject 2's Marks. :"); byte sub2 = sc.nextByte(); System.out.println("Enter subject 3's Marks. :"); byte sub3 = sc.nextByte(); System.out.println("Enter subject 4's Marks. :"); byte sub4 = sc.nextByte(); System.out.println("Enter subject 5's Marks. : "); byte sub5 = sc.nextByte(); float total = sub1 + sub2 + sub3 + sub4 + sub5; float avg = total/(max*5)*max; float percent = total/(max * 5)*100;//total / 5; System.out.println("Your average marks of all subjects is " + avg + " out of " + max); System.out.println("Your total marks percentage in the board exam is " + percent + "% out of"); System.out.println("thanks for using this program."); } }
@oo7posam581
@oo7posam581 3 жыл бұрын
Hey bro i didn't understood the short max concept why have you taken that value.. Help me out there pls
@gametimewitharyan6665
@gametimewitharyan6665 3 жыл бұрын
@@oo7posam581 its the total marks for the papers, it is used in the formula for percentage calculations
@gametimewitharyan6665
@gametimewitharyan6665 3 жыл бұрын
Thanks Sir, It Helped A Lot, I Was Unable To Get My Percentage Calculation Formula Right, But Now Understood It :)
@oo7posam581
@oo7posam581 3 жыл бұрын
@@gametimewitharyan6665 ok got it... Thanks
@gametimewitharyan6665
@gametimewitharyan6665 3 жыл бұрын
@@oo7posam581 Your Welcome Bro :)
@DevangChitte
@DevangChitte 5 ай бұрын
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("enter First subject "); float a = sc.nextInt(); System.out.println("enter second subject"); float b = sc.nextInt(); System.out.println("enter third subject"); float c = sc.nextInt(); float sum = a+b+c; float divide = sum/6; System.out.println("your result is:"+ divide); } } Challenge completed 👍🏻
@ishikaraghuwanshi3878
@ishikaraghuwanshi3878 3 жыл бұрын
I have completed first exercise and i m really luving this course and excited to learn more about java
@ishikaraghuwanshi3878
@ishikaraghuwanshi3878 3 жыл бұрын
@Aizaz Ahmad gud
@believeongod97
@believeongod97 3 жыл бұрын
Really 😂😂😂🤣🤣
@believeongod97
@believeongod97 3 жыл бұрын
Then why you not show us 😂😂😂 your excersize 😂😂
@SaurabhSanuSharma
@SaurabhSanuSharma Жыл бұрын
Hello Harry, Cos I'm watching this video today (13-11-2022) . So, The solution from my side is: import java.util.Scanner; public class Exercise_1 { public static void main(String[] args) { System.out.println("Marks of a Student in board exam"); Scanner sc = new Scanner(System.in); System.out.println("Marks in Sub1: "); int a = sc.nextInt(); System.out.println("Marks in Sub2: "); int b = sc.nextInt(); System.out.println("Marks in Sub3: "); int c = sc.nextInt(); System.out.println("Marks in Sub4: "); int d = sc.nextInt(); System.out.println("Marks in Sub5: "); int e = sc.nextInt(); float Final_Percentage = ((a+b+c+d+e)/500.0f)*100; System.out.println("Total % is: "); System.out.println(Final_Percentage); } } If you find this please like. BTW Thank You so much for your teaching❤
@DK-js8cz
@DK-js8cz Жыл бұрын
Good one bro, I liked the way you had used float division here instead of taking all float inputs.
@dashanrajnikanth
@dashanrajnikanth Жыл бұрын
Love your videos! import java.util.Scanner; public class CBSE_Exam { public static void main(String[] args) { float totalMarks= 500.00f; Scanner sc= new Scanner(System.in); System.out.println("Please enter marks of your Subject1"); float sub1 = sc.nextFloat(); System.out.println("Please enter marks of your Subject2"); float sub2 = sc.nextFloat(); System.out.println("Please enter marks of your Subject3"); float sub3 = sc.nextFloat(); System.out.println("Please enter marks of your Subject4"); float sub4 = sc.nextFloat(); System.out.println("Please enter marks of your Subject5"); float sub5 = sc.nextFloat(); float sum = sub1+sub2+sub3+sub4+sub5; float percentageMarks = sum*100/totalMarks; System.out.println("Your Total Marks in percentage is "+percentageMarks+"%"); } }
@hritiksharma9748
@hritiksharma9748 Жыл бұрын
Successfully ho gya bro tera program
@priyanshisharma9840
@priyanshisharma9840 Жыл бұрын
Isme last mai +percentage marks+ kyu kiya ??
@avaneesh_yadav
@avaneesh_yadav 11 ай бұрын
Aapako maximum mark bhi user se lena hai taki maximum mark chahe jitana ho fir bhi hamara code run sahi tarike se kare package codeharry; import java.util.Scanner; public class Cwh1 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("How many subject"); int sub = sc.nextInt(); System.out.println("What is your Maxmium mark ?"); int mark = sc.nextInt()*sub; System.out.println("Total maximum Mark ====> "+ mark); System.out.println("Enter your mark of Hindi"); int Hindi = sc.nextInt(); System.out.println("Enter your mark of English"); int English= sc.nextInt(); System.out.println("Enter your mark of Physics"); int Physics = sc.nextInt(); System.out.println("Enter your mark of Chemistry"); int Chemistry = sc.nextInt(); System.out.println("Enter your mark of Biology"); int Biology = sc.nextInt(); double tot= Hindi+English+Chemistry+Physics+Biology; double per = tot*100/mark; System.out.println("Percentage : "+per+" %"); } }
@namanchaturvedi6713
@namanchaturvedi6713 Жыл бұрын
[This is what I could do so far. Its hardly two days I have been learning Java through your lectures. Thank you so much for the support. ] import java.util.Scanner; public class Main { public static void main(String[] args) { System.out.println("To Calculate the Percentage of marks Scored "); Scanner takeip= new Scanner(System.in); System.out.println("Enter the number of Subjects: (Hint! 5 Subjects)"); int i = takeip.nextInt(); if ( i==5 ){ System.out.println("Enter the marks for 1st Subject: "); float s1= takeip.nextInt(); System.out.println("Enter the marks for 2nd Subject: "); float s2= takeip.nextInt(); System.out.println("Enter the marks for 3rd Subject: "); float s3= takeip.nextInt(); System.out.println("Enter the marks for 4th Subject: "); float s4= takeip.nextInt(); System.out.println("Enter the marks for 5th Subject: "); float s5= takeip.nextInt(); float Total=s1+s2+s3+s4+s5; System.out.println("The Total marks obtained out of 500 are : "+Total); float percent=Total/5; System.out.println("The Percentage of marks Obtained is : " +percent+"%"); } else { System.out.println("Enter marks for 5 subjects"); return ; } } }
@rakeshroshan7142
@rakeshroshan7142 Жыл бұрын
This is the best I could write : [note]:- this is my 1st day as a java leraner. import java.util.Scanner; public class PercentageCalculator { public static void main(String[] args) { System.out.println("This is a percentage calculator! "); Scanner sc= new Scanner(System.in); System.out.println("Enter your name : "); String str= sc.nextLine(); System.out.println("enter max marks of any subject :"); int MaxMrk= sc.nextInt(); System.out.println("enter number of subjects :"); int subNo= sc.nextInt(); //reads string int TolMrk = MaxMrk*subNo; //System.out.println(TolMrk); int [] marks= new int[subNo+1]; for(int i=1; i
@warriorvedangop
@warriorvedangop Жыл бұрын
@@rakeshroshan7142 Which language u learnt before java ?
@SarimAli-e5s
@SarimAli-e5s 10 ай бұрын
Hi Harry Bhai, import java.util.Scanner; public class CBSE_calculator { public static void main(String[] args) { System.out.println("CBSE BOARD % CALCULATOR"); Scanner calc = new Scanner(System.in); System.out.println("Maximum Marks:"); int max = calc.nextInt(); System.out.println("Enter your marks in Mathematics: "); int s1 = calc.nextInt(); System.out.println("Enter your marks in Physics:"); int s2 = calc.nextInt(); System.out.println("Enter your marks in Chemistry:"); int s3 = calc.nextInt(); System.out.println("Enter your marks in IP:"); int s4 = calc.nextInt(); System.out.println("Enter your marks in English:"); int s5 = calc.nextInt(); System.out.print("Your Total marks = "); int sum = s1 + s2 + s3 + s4 + s5 ; System.out.println(sum); System.out.println("Your Percentage is "); float percent = sum * 100 / max; System.out.println(percent); } }
@MK-lu4pe
@MK-lu4pe 3 жыл бұрын
Sorry Harry sir. me bahut late hun is course ko join karne mein. // Exercise 1:- Date: 14 December 2020[Monday] /* Question:- Write a program to calculate percentage of a given subjects in CBSE board exam. His marks from 5 subjects must be taken as input from the keyword (Marks out of 100). */ package MK; import java.util.Scanner; public class Exercise_1 { public static void main(String[] args) { Scanner UserInput = new Scanner(System.in); System.out.println("Enter your Marks:-"); // Subject 1 System.out.print("Subject 1: "); int Subject1 = UserInput.nextInt(); // Subject 2 System.out.print("Subject 2: "); int Subject2 = UserInput.nextInt(); // Subject 3 System.out.print("Subject 3: "); int Subject3 = UserInput.nextInt(); // Subject 4 System.out.print("Subject 4: "); int Subject4 = UserInput.nextInt(); // Subject 5 System.out.print("Subject 5: "); int Subject5 = UserInput.nextInt(); int TotalMarks = Subject1 + Subject2 + Subject3 + Subject4 + Subject5; float Percentage = (TotalMarks/500F) * 100; System.out.println(" Total Marks: " + TotalMarks); System.out.println("Percentage: " + Percentage + '%'); } }
@03_abhishekchoubey42
@03_abhishekchoubey42 3 жыл бұрын
Bro what we will do wen user enter marks more than 100 Than how we will resolve this problem
@nitinmishra3982
@nitinmishra3982 3 жыл бұрын
@@03_abhishekchoubey42 abhishek brother u can use if , else condition for this problem.. If(marks>=100) { // here u can take each inputs from user and calculate percentage.. } else { System. out.println("You can only enter marks less than or equalsto 100"); }
@nitinmishra3982
@nitinmishra3982 3 жыл бұрын
@@03_abhishekchoubey42 Give me your feedback plz😎 I m waiting for it..
@rishurajsharma3130
@rishurajsharma3130 4 жыл бұрын
Even if I am not doing Java now as I am a beginner Then also I like each video of Harry Bhai
@parthgupta4850
@parthgupta4850 4 жыл бұрын
I think this is the only video on KZbin which got 0 unlikes out of 1K views (till now). Congrats!!!!!!!
@adityaparashar9606
@adityaparashar9606 2 жыл бұрын
Thank you so much Harry bhai. love you yaar, tumne sach me bhot achi presentation di h. me last 8-10years se coding learn krne ki koshish kr rha tha but your course is the first ever where I am able to reach this far without quitting which makes me kinda proud and feeling lucky that I found your course here. I know I am too late for you to even notice this comment. anyways, the following is my code: import java.util.Scanner; public class Student_Marks_Percentage { public static void main(String[] args) { System.out.println("Marks obtained in Social: "); Scanner sc = new Scanner(System.in); float Hindi = sc.nextFloat(); System.out.println("Marks obtained in Hindi: "); float English = sc.nextFloat(); System.out.println("Marks obtained in English: "); float Maths = sc.nextFloat(); System.out.println("Marks obtained in Maths: "); float Science = sc.nextFloat(); System.out.println("Marks obtained in Science: "); float Social = sc.nextFloat(); float Total = Hindi + English + Maths + Science + Social; System.out.println("Total Marks obtained: "+Total); float Percentage = (Total*100)/500; System.out.println("Total percentage of the Student is: "+Percentage); Thanks Again, Aditya
@vedantbaghel5537
@vedantbaghel5537 9 ай бұрын
my simplest approach and i tried my best - import java.util.Scanner; public class Exercise1PercentageCalculator{ public static void main(String[] args){ Scanner sub = new Scanner(System.in); System.out.println("Marks of sub1"); double sub1 = sub.nextInt(); System.out.println("Marks of sub2"); double sub2 = sub.nextInt(); System.out.println("Marks of sub3"); double sub3 = sub.nextInt(); System.out.println("Marks of sub4"); double sub4 = sub.nextInt(); System.out.println("Marks of sub5"); double sub5 = sub.nextInt(); double totalMarksObtained = sub1 + sub2 + sub3 + sub4 + sub5; System.out.println("Total marks obtained by student : " + totalMarksObtained); double outOffMarks = 500; System.out.println("Out off marks : " + outOffMarks); double percentage = (totalMarksObtained * 100) / outOffMarks; System.out.println("Percentage of your Exams : " + percentage); } }
@timepassid8073
@timepassid8073 4 жыл бұрын
Sir it was a nice video thank you sir for making this channel!! This channel helped me and 500k people alot thank you sir
@timepassid8073
@timepassid8073 4 жыл бұрын
@@ng_allrounder Of course bro
@dhairyamehta8642
@dhairyamehta8642 4 жыл бұрын
Challenge accepted, you are the best teacher ever meet . thank you so much harry sir
@arshadshaikh2000
@arshadshaikh2000 3 жыл бұрын
Hello Sir I'm beginner pro in Java But I tried this this is my Java program for percent calculation. Int totalmarks = 650; Int Sub1 = 46; Int Sub2 = 72; Int Sub3 = 48; Int Sub4 = 61; Int Sub5 = 73; Int sub6 = 82; Float ObtainMarks = (Sub1+Sub2+Sub3+Sub4+Sub5+Sub6) ; Float percentage = (ObtainMarks*100/650); System.out.println(percentage); I run this program and got my percentage correctly... Is it correct way to solve??
@sanoberanjum7228
@sanoberanjum7228 3 жыл бұрын
int and float should be treated as case sensitive keywords. As a beginner you are doing great 👍 My code 👇 (user input method) import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("Input sub1 marks "); float a1 = sc.nextFloat(); System.out.println("Input sub2 marks "); float a2 = sc.nextFloat(); System.out.println("Input sub3 marks "); float a3 = sc.nextFloat(); System.out.println("Input sub4 marks "); float a4 = sc.nextFloat(); System.out.println("Input sub5 marks "); float a5 = sc.nextFloat(); System.out.println("Input sub6 marks "); float a6 = sc.nextFloat(); System.out.println("Input total marks "); float total = sc.nextFloat(); float percentage = (a1 + a2 + a3 + a4 + a5 + a6) * 100 / total; System.out.println("Percentage = " + percentage); } }
@arijitkoley4036
@arijitkoley4036 3 жыл бұрын
@@sanoberanjum7228 bhai mai left click karle run nahi kar pa raha hun kaise kare?
@deekshagupta3786
@deekshagupta3786 3 жыл бұрын
@@sanoberanjum7228 bhai ye code chl ni rha mere m error aara ki "exception in main java.util.nosuch elementexception " can u resolve this error
@sanoberanjum7228
@sanoberanjum7228 3 жыл бұрын
@@deekshagupta3786 Just copy - paste above code.
@harshitalal3527
@harshitalal3527 2 жыл бұрын
Hi
@akashchaudharyima
@akashchaudharyima Жыл бұрын
Loving this series❤ import java.util.Scanner; public class percentage { public static void main(String[] args) { System.out.println("Calculate your 5 Subject Percentage"); Scanner sc = new Scanner(System.in); System.out.println("Enter Your English Subject Marks"); int a = sc.nextInt(); System.out.println("Enter Your Maths Subject Marks"); int b = sc.nextInt(); System.out.println("Enter Your Physics Subject Marks"); int c = sc.nextInt(); System.out.println("Enter Your Chemistry Subject Marks"); int d = sc.nextInt(); System.out.println("Enter Your CS Subject Marks"); int e = sc.nextInt(); double sum = a+b+c+d+e; double percentage = sum*100/500; System.out.println(sum); System.out.println("Your Overall Percentage is = "+percentage); } }
@NeOn_2702
@NeOn_2702 Жыл бұрын
you can also do sum/5 ...... Thank You
@hemantsharma-xf3ub
@hemantsharma-xf3ub Жыл бұрын
@@NeOn_2702 bhai yrr tere ko pehli baar m smjh aa gya tha kaese krna h ye itti jldi to pta ni lga kaese krna kaha se sekha h aapne mere ko bahut problem aa rshi yrr seekhne m hlp
@NeOn_2702
@NeOn_2702 Жыл бұрын
@@hemantsharma-xf3ub bhai bas consistently sikho aa jayega... Mai bhi beginner hu bhai
@NeOn_2702
@NeOn_2702 Жыл бұрын
@@hemantsharma-xf3ub harry sir se hi sikh rha hu
@hemantsharma-xf3ub
@hemantsharma-xf3ub Жыл бұрын
@@NeOn_2702 sir ne to itna kraya hi nhi tha ki ye exercise ka saara ho jae
@samarthbehl4190
@samarthbehl4190 4 жыл бұрын
Although I am very late but here you go!: import java.util.Scanner; public class MAin { public static void main(String[]args) { Scanner sam = new Scanner(System.in); System.out.println("Enter the marks of the first subject."); double a = sam.nextDouble(); System.out.println("Enter the marks of the second subject."); double b = sam.nextDouble(); System.out.println("Enter the marks of the third subject."); double c = sam.nextDouble(); System.out.println("Enter the marks of the fourth subject."); double d = sam.nextDouble(); System.out.println("Enter the marks of the fifth subject."); double e = sam.nextDouble(); double f = ((a+b+c+d+e)/500)*100; System.out.print("Your CBSE board percentage is: "); System.out.print(f ); System.out.println("%"); System.out.println("Thanks and congrats!"); } }
@craftingkids5149
@craftingkids5149 3 жыл бұрын
Lorem190000
@adarshshukla2792
@adarshshukla2792 4 жыл бұрын
Happy teacher's day in advance sir you are the best programing teacher❤️❤️
@Lila12386
@Lila12386 4 жыл бұрын
Hey, My name is also Adarsh
@adarshshukla2792
@adarshshukla2792 4 жыл бұрын
@@Lila12386 🤝🤝
@Waseemkhan26-07
@Waseemkhan26-07 Жыл бұрын
//Java program to find percentage of CBSE (5 subjects) by taking input from user import java.util.Scanner; public class Main { public static void main(String[] args) { System.out.println("Enter the marks of 5 subjects(each subject is of 100 marks): "); Scanner bol = new Scanner(System.in); float m1 = bol.nextFloat(); float m2 = bol.nextFloat(); float m3 = bol.nextFloat(); float m4 = bol.nextFloat(); float m5 = bol.nextFloat(); float sum = m1+m2+m3+m4+m5; System.out.print("Total marks out of 500 are "); System.out.println(sum); float percent = (sum/500)*100; System.out.print("The total percentage of all marks is "); System.out.print(percent); System.out.println("%"); } Kya harry bhai tum bhi.... dil doonga.. yeh doonga wo doonga reply karunga bolte ho..... kuch karte to ho nahi.. kai sare cmnts aise hi paaliye tumne... 🤨
@MBNB-x9x
@MBNB-x9x Жыл бұрын
import java.util.Scanner; public class Exercise_1 { public static void main(String[] args) { Scanner inp = new Scanner(System.in); // Here We Should Use % Subjects // Must Enter Marks into The 100 Don't (100
@FaizKhan-mp6jj
@FaizKhan-mp6jj Жыл бұрын
Bro you need to apply logic where if we enter marks more than 100 then the program shouldn't accept the value or should caution the programmer
@MBNB-x9x
@MBNB-x9x Жыл бұрын
@@FaizKhan-mp6jj you can Go through with if - else statement.. as per video playlist this makes. 🙂
@FaizKhan-mp6jj
@FaizKhan-mp6jj Жыл бұрын
@@MBNB-x9x agreed 👍. But since the question had mentioned less than 100 so i said it
@vedicviewers5263
@vedicviewers5263 Жыл бұрын
what if user have 6 subject
@FaizKhan-mp6jj
@FaizKhan-mp6jj Жыл бұрын
@@vedicviewers5263 you can use a conditional statements or any looping statements but that would be too much for someone who's just a beginner
@RatnabalaNadar-o9o
@RatnabalaNadar-o9o 8 ай бұрын
Harry Bhai apne hi bhola tha ki aap un sab longo ko heart dhoge jho ye problem solve karega, mene ye bana diya. Mene apke 100 days wala python ka playlist bhi dekha,html, css, javascript, C# and now java
@AyushKumar-ro6fy
@AyushKumar-ro6fy 5 ай бұрын
Bhai aapka insta kya h
@asadqureshi1763
@asadqureshi1763 2 жыл бұрын
Exercise 1: System.out.println("Enter First Subject Number"); int one = sc.nextInt(); System.out.println("Enter Second Subject Number"); int two = sc.nextInt(); System.out.println("Enter Third Subject Number"); int three = sc.nextInt(); System.out.println("Enter Fourth Subject Number"); int four = sc.nextInt(); System.out.println("Enter Fifth Subject Number"); int five = sc.nextInt(); int total = one+two+three+four+five; int perc= total * 100 / 500; System.out.println(perc);
@adityarawat11
@adityarawat11 2 жыл бұрын
this approach is precise
@aditikeshri5598
@aditikeshri5598 3 жыл бұрын
sir ur teaching skills helps us alot thank you sir
Java Tutorial: Getting User Input in Java
15:38
CodeWithHarry
Рет қаралды 2 МЛН
Ozoda - Lada ( Official Music Video 2024 )
06:07
Ozoda
Рет қаралды 29 МЛН
Watermelon magic box! #shorts by Leisi Crazy
00:20
Leisi Crazy
Рет қаралды 114 МЛН
Хасанның өзі эфирге шықты! “Қылмыстық топқа қатысым жоқ” дейді. Талғарда не болды? Халық сене ме?
09:25
Демократиялы Қазақстан / Демократический Казахстан
Рет қаралды 289 М.
Бенчик, пора купаться! 🛁 #бенчик #арти #симбочка
00:34
Симбочка Пимпочка
Рет қаралды 3 МЛН
Java Tutorial: Operators, Types of Operators & Expressions in Java
15:59
CodeWithHarry
Рет қаралды 1,2 МЛН
Java Tutorial: Associativity of Operators in Java
17:53
CodeWithHarry
Рет қаралды 961 М.
Java Tutorial: String Methods in Java
39:02
CodeWithHarry
Рет қаралды 1,2 МЛН
Learn Java in 14 Minutes (seriously)
14:00
Alex Lee
Рет қаралды 4,8 МЛН
Java Tutorial: Variables and Data Types in Java Programming
24:48
CodeWithHarry
Рет қаралды 2,8 МЛН
Java Full Course 2024 for Beginners | Complete Java Tutorial in Kannada | MicroDegree
6:04:56
Ozoda - Lada ( Official Music Video 2024 )
06:07
Ozoda
Рет қаралды 29 МЛН