No video

Java Programming Exercise 1: CBSE Board Percentage Calculator

  Рет қаралды 1,153,609

CodeWithHarry

CodeWithHarry

Күн бұрын

Complete Java Course Exercise 1: Percentage calculator in Java
This java tutorial in hindi will teach you how to calculate percentage in java programming. This video will be the first exercise of our java tutorial in Hindi series. Make sure to solve it and post the solutions in the comments!
►This playlist is a part of my Complete Java Course playlist: • Java Tutorials For Beg...
►Source Code + Notes - codewithharry....
►Ultimate Java CheatSheet: codewithharry....
►Checkout my English channel here: / programmingwithharry
►Click here to subscribe - / @codewithharry
Best Hindi Videos For Learning Programming:
►Learn Python In One Video - • Python Tutorial In Hin...
►Python Complete Course In Hindi - • Python Tutorials For A...
►C Language Complete Course In Hindi -
• C Language Tutorials I...
►JavaScript Complete Course In Hindi -
• JavaScript Tutorials I...
►Learn JavaScript in One Video - • JavaScript Tutorial
►Learn PHP In One Video - • Learn Php In One Video...
►Django Complete Course In Hindi -
• Python Django Tutorial...
►Machine Learning Using Python - • Machine Learning Tutor...
►Creating & Hosting A Website (Tech Blog) Using Python - • [Hindi] Web Developmen...
►Advanced Python Tutorials - • Intermediate/Advanced ...
►Object Oriented Programming In Python - • Object Oriented Progra...
►Python Data Science and Big Data Tutorials - • Python Data Science an...
Follow Me On Social Media
►Website (created using Flask) - www.codewithhar...
►Facebook - / codewithharry
►Instagram - / codewithharry
►Personal Facebook A/c - / geekyharis
Twitter - / haris_is_here

Пікірлер: 6 800
@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 2 жыл бұрын
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 2 жыл бұрын
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
@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 Жыл бұрын
right bruh
@sadashish2002
@sadashish2002 4 ай бұрын
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 🙏
@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 😁👍
@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 10 ай бұрын
nice @@-lyxics
@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); } }
@shrikant_18
@shrikant_18 8 ай бұрын
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 4 ай бұрын
bohat sari mistakes show kr raha ha
@papai_kumar
@papai_kumar Жыл бұрын
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 4 ай бұрын
Hnji trader saab
@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 Жыл бұрын
Mst
@shaikhanis148
@shaikhanis148 Жыл бұрын
I pick up int then I understand there should br float
@JayPrakash-mj4ik
@JayPrakash-mj4ik Жыл бұрын
not working, please debug
@amolmagic1008
@amolmagic1008 Жыл бұрын
great last line should be System.out.print(" %");
@_its._gaurav._
@_its._gaurav._ 8 ай бұрын
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(); } }
@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;
@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;
@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 Ай бұрын
Thank bro
@shinejaiswal4002
@shinejaiswal4002 2 жыл бұрын
🙏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
@anchitkaushal.7009
@anchitkaushal.7009 Ай бұрын
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); } }
@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
@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 11 ай бұрын
the best code
@ravanparmar9999
@ravanparmar9999 9 ай бұрын
I think it's divided by 5 not by 500
@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
@bikramxjeetxsingh
@bikramxjeetxsingh Ай бұрын
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.
@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
@kumarrohan6148
@kumarrohan6148 2 жыл бұрын
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 2 жыл бұрын
result 0 dikha rha
@believeongod97
@believeongod97 2 жыл бұрын
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 2 жыл бұрын
😂🤣😂🤣😂🤣
@kumarrohan6148
@kumarrohan6148 2 жыл бұрын
@@believeongod97 😂😂
@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 Жыл бұрын
why cant i use int instead of float while taking marks as input
@arushi1705
@arushi1705 Жыл бұрын
@@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 :)
@lizabhadana1350
@lizabhadana1350 9 ай бұрын
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.
@primeperson1953
@primeperson1953 10 ай бұрын
Thank you Harry bhai yeh hai mera code : import java.util.*; public class marks { public static void main(String[]args){ Scanner sc = new Scanner(System.in); System.out.print("Enter the number of subs : "); int noofsubs = sc.nextInt(); System.out.print("Enter the marks of one subject : "); int marks = sc.nextInt(); int totalmarks = noofsubs*marks; int i= 0; int calcmarks = 0; for(i=0;i
@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 8 ай бұрын
Next Int ki jagah float hoga
@arsalanali3574
@arsalanali3574 8 ай бұрын
variable nhi data type unho ne float lya ha like float ,int ,short they all are data types@@abhirawat9288
@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)
@KoushikDas2005
@KoushikDas2005 Жыл бұрын
Thanks a lot for the first five lectures of this free Java course.❤
@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); } }
@user-dp4td5xy5u
@user-dp4td5xy5u 4 ай бұрын
its been 3 years im starting it now. YO got it without a single error.
@arijitmohapatra8737
@arijitmohapatra8737 4 жыл бұрын
Happy teacher's day Harry sir😍🥰
@Neetu-it9zc
@Neetu-it9zc 11 ай бұрын
O my God... I am watching this video on teacher's day 2023😊
@mentality.emperors
@mentality.emperors 11 ай бұрын
​@@Neetu-it9zcsame😂 happy teacher's day harry sir
@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 👍
@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
@user-vj9bh8ls7w
@user-vj9bh8ls7w 6 ай бұрын
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 3 ай бұрын
Bhai aapka insta kya h
@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??
@missyanshu
@missyanshu 4 жыл бұрын
Best channel to learn programming from the very beginning... Interesting program
@slienthero9646
@slienthero9646 3 жыл бұрын
did you complete java course : )
@believeongod97
@believeongod97 2 жыл бұрын
Hello 😂😂😂
@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 Жыл бұрын
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 Жыл бұрын
@@abhifox4431 how? by using switch???
@nidhisatyapriya7084
@nidhisatyapriya7084 Жыл бұрын
@@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); } }
@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 🤗
@TechnicalAdarshji123
@TechnicalAdarshji123 7 ай бұрын
Today i start a Java Course. its course is a very intresting.❤❤❤❤❤❤❤❤
@sonup73
@sonup73 7 ай бұрын
i am also start this course
@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 .
@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
@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
@ArsalanKhattak-s9d
@ArsalanKhattak-s9d 28 күн бұрын
Wow Sir This Was Very Easy Question....I am From Paksitan....And Am A Studenet of Computer Science
@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}🙏🙏🙏
@kirannadar0909
@kirannadar0909 11 ай бұрын
Sir, Litrally saying, I am an Mechanic and have 0 knowledge about IT programs and JAVA... but THANKS TO U!!!! Lately but surely i am having fun Learning JAVA with the help of your guidance. ❤🎉🎉 THANK U SOOO MUCH SIR for this amazing course!!!!
@modassirmd8796
@modassirmd8796 8 ай бұрын
I also started before 2 days
@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 ❤️
@manojkumarverma7931
@manojkumarverma7931 2 жыл бұрын
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 🤔
@Syed_Miraz_Ali
@Syed_Miraz_Ali 6 ай бұрын
//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+"%"); } }
@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
@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 😅
@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 5 ай бұрын
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 5 ай бұрын
@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 5 ай бұрын
@@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..
@aviralsrivastava-kx7nd
@aviralsrivastava-kx7nd Ай бұрын
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); } }
@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);
@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 6 ай бұрын
@varadpensalwar
@varadpensalwar 5 ай бұрын
Wrong answer because if we take any subject marks greater than 100 then it will give more than 100 percentage
@shahupatil8991
@shahupatil8991 4 ай бұрын
@@varadpensalwar bhai abhi toh basic chalu hai itna bhi bohot hai
@bebaak_rai
@bebaak_rai 4 ай бұрын
sum*100/total_marks
@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.
@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 ??
@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+" %"); } }
@user-vx7ie7zq9p
@user-vx7ie7zq9p Жыл бұрын
bro you apply the average formula
@kartikhereboii
@kartikhereboii Жыл бұрын
@@user-vx7ie7zq9p yeah, I realised that lol. Thanks Now, it's corrected.
@devilrohan8462
@devilrohan8462 11 ай бұрын
@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 11 ай бұрын
@@devilrohan8462 You learn new something, everyday cause everyday is a new beginning : )
@BrainBooster_89
@BrainBooster_89 9 ай бұрын
I Tried my First task thank you sir,for your Teaching... import java.util.Scanner; public class Test { public static void main(String[] args) { System.out.println("Data of Students Marks:"); Scanner sc=new Scanner(System.in); System.out.println("Enter English marks:"); int a=sc.nextInt(); System.out.println("Enter Kannada marks:"); int b=sc.nextInt(); System.out.println("Enter Mathematics marks:"); int c=sc.nextInt(); System.out.println("Enter Science marks"); int d=sc.nextInt(); System.out.println("Enter Computer Science marks"); int e=sc.nextInt(); int sum=a+b+c+d+e; System.out.println("Total percentage is: " +sum/5); } }
@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 ..
@youtubetest5574
@youtubetest5574 4 жыл бұрын
Very amazing video👍 When I got notification, I shared with my friends instantly.
@Pratham-ee5qz
@Pratham-ee5qz 3 ай бұрын
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);
@avinashdharme2234
@avinashdharme2234 3 жыл бұрын
Keep uploading such video's, these are helping a lot❤️
@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
@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
@AnkitKumar-ib6dw
@AnkitKumar-ib6dw Ай бұрын
package bang; public class Percentage { public static void main(String[] args) { int no [] = {96,85,45,88,99}; double sum = 0; for (int num : no) { sum += num; } System.out.println(sum/5); } }
@sumitroy4992
@sumitroy4992 2 жыл бұрын
Hello sir, Your way of teaching is really impeccable. Thank you for providing such wonderful content. Here is answer for the exercise import java.util.Scanner; public class prac { public static void main(String[] args) { System.out.println("Taking input form the user"); Scanner st = new Scanner(System.in); System.out.println("Enter Sub_1 marks"); float sub_1 = st.nextFloat(); System.out.println("Enter Sub_2 marks"); float sub_2 = st.nextFloat(); System.out.println("Enter Sub_3 marks"); float sub_3 = st.nextFloat(); System.out.println("Enter Sub_4 marks"); float sub_4 = st.nextFloat(); System.out.println("Enter Sub_5 marks"); float sub_5 = st.nextFloat(); float sum = sub_1 + sub_2 + sub_3 + sub_4 + sub_5; System.out.println("The sum of marks obtained in 5 subject is "); System.out.println(sum); // System.out.println("Sum of maximum marks which can be obtained in each subject"); // int T = float Percentage; Percentage = ( sum* 100)/500; System.out.println("Percentage of given student in CBSE board exam is"); System.out.println(Percentage); } }
@AltafKhan-re7tg
@AltafKhan-re7tg Жыл бұрын
nice code bruh...
@AltafKhan-re7tg
@AltafKhan-re7tg Жыл бұрын
but st.nextfloat(); yaha pe { sc.nextFloat(); } aisa hoga
@sumitroy4992
@sumitroy4992 Жыл бұрын
@@AltafKhan-re7tg maine object st ke naam se banaya hai isliye st aya wanha par
@AltafKhan-re7tg
@AltafKhan-re7tg Жыл бұрын
@@sumitroy4992 ok
@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
@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
@princejaniya8368
@princejaniya8368 8 ай бұрын
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(); } }
@duniyajyebhadmenk2538
@duniyajyebhadmenk2538 2 жыл бұрын
int Avg =(E+H+M+P+C) *100/500; S.O.P (Avg); Logic to yahi hoga sir.
@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 Жыл бұрын
Sm
@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); } }
@talha.m24
@talha.m24 7 ай бұрын
i solved the problem after pausing this video
@digrajtiwari4180
@digrajtiwari4180 Жыл бұрын
Day 2 of this great course 😊
@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 🤝🤝
@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 2 жыл бұрын
Really 😂😂😂🤣🤣
@believeongod97
@believeongod97 2 жыл бұрын
Then why you not show us 😂😂😂 your excersize 😂😂
@jyoti.insight
@jyoti.insight 2 ай бұрын
I'm watching your all playlist in 2024 June.. 🥰🥰🥰thankuuuu Harry sir for this ... ❤❤
@parthgupta4850
@parthgupta4850 4 жыл бұрын
I think this is the only video on KZfaq which got 0 unlikes out of 1K views (till now). Congrats!!!!!!!
@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 8 ай бұрын
In totalmarkspercentage variable there is no need to include( fm*number of students ) it will not give correct ans instead just write (fm))*100;
@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 :)
@equation0356
@equation0356 5 ай бұрын
Bhaiyaa meine puraa solve kr diyaa 🥳
@dhairyamehta8642
@dhairyamehta8642 4 жыл бұрын
Challenge accepted, you are the best teacher ever meet . thank you so much harry sir
@aditikeshri5598
@aditikeshri5598 3 жыл бұрын
sir ur teaching skills helps us alot thank you sir
@user-vf6de4ky4n
@user-vf6de4ky4n Жыл бұрын
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 11 ай бұрын
Isme last mai +percentage marks+ kyu kiya ??
@avaneesh_yadav
@avaneesh_yadav 9 ай бұрын
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+" %"); } }
@shivanshurawat2309
@shivanshurawat2309 5 ай бұрын
@CodeWithHarry sir plz check import java.util.Scanner; class Percentage{ public static void calculateMarks() { System.out.println("enter the marks of the subjects out of 100:"); Scanner sc = new Scanner(System.in); float maths = sc.nextFloat(); float science = sc.nextFloat(); float chemistry = sc.nextFloat(); float Physics = sc.nextFloat(); float english = sc.nextFloat(); float perc = ((maths+science+chemistry+Physics+english)/500*100); System.out.println("the percentage obtained by the student is:"); System.out.println(perc); } } public class Main { public static void main(String[] args) { System.out.println("Welcome to the board percentage calculator:"); Percentage p = new Percentage(); p.calculateMarks(); } }
@naeemabbassahar865
@naeemabbassahar865 3 жыл бұрын
Your teaching method is amazing, keep up.
@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
@parthgupta4850
@parthgupta4850 4 жыл бұрын
HAPPY TEACHER'S DAY HARRY SIR (in Advance)
@fastcar544
@fastcar544 4 жыл бұрын
@@ng_allrounder chup chu
@kalpanayadav4760
@kalpanayadav4760 4 жыл бұрын
Happy teacher day(in advance)sir
@parthgupta4850
@parthgupta4850 4 жыл бұрын
@@ng_allrounder sure
@kirtansoni3163
@kirtansoni3163 4 жыл бұрын
@@ng_allrounder ​ you are not teacher you are project seller like zerox shops don't do this please
@DevangChitte
@DevangChitte 4 ай бұрын
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 👍🏻
@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 Жыл бұрын
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("%");
@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
@namorudra2562
@namorudra2562 4 жыл бұрын
Hi sir, I'm started today learning Ur Java course.. thank u so much..sir
@vivektiwari553
@vivektiwari553 7 ай бұрын
Made this program in half hour❤😍
@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..
@user-iu2tv9fh6m
@user-iu2tv9fh6m Жыл бұрын
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
@user-iu2tv9fh6m
@user-iu2tv9fh6m Жыл бұрын
@@FaizKhan-mp6jj you can Go through with if - else statement.. as per video playlist this makes. 🙂
@FaizKhan-mp6jj
@FaizKhan-mp6jj Жыл бұрын
@@user-iu2tv9fh6m 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
@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.
@mrkajit9211
@mrkajit9211 4 жыл бұрын
This tutorial is very helpful ❤️
@arsadmansuri-bs5zo
@arsadmansuri-bs5zo Ай бұрын
Love u harry bhai ❤❤❤❤❤❤❤❤
Java Tutorial: Getting User Input in Java
15:38
CodeWithHarry
Рет қаралды 2 МЛН
Parenting hacks and gadgets against mosquitoes 🦟👶
00:21
Let's GLOW!
Рет қаралды 13 МЛН
❌Разве такое возможно? #story
01:00
Кэри Найс
Рет қаралды 3,9 МЛН
Blue Food VS Red Food Emoji Mukbang
00:33
MOOMOO STUDIO [무무 스튜디오]
Рет қаралды 21 МЛН
Can This Bubble Save My Life? 😱
00:55
Topper Guild
Рет қаралды 87 МЛН
5 Hacks to Increase Your Height 🤯| How to Grow Tall Naturally | Prashant Kirad
10:59
Which Operating System I use and Why 💻
14:57
CodeWithHarry
Рет қаралды 117 М.
1 Crore Salary != Good Software Engineer
0:58
take U forward
Рет қаралды 279 М.
Java Tutorial: Operators, Types of Operators & Expressions in Java
15:59
CodeWithHarry
Рет қаралды 1,2 МЛН
Java Tutorial: Literals in Java
16:34
CodeWithHarry
Рет қаралды 1,8 МЛН
DSA in JavaScript.#javascript #coding #programming #dsa
0:43
ezsNippet
Рет қаралды 145 М.
Parenting hacks and gadgets against mosquitoes 🦟👶
00:21
Let's GLOW!
Рет қаралды 13 МЛН