Java Tutorial: Chapter 1- Practice Set | Java Practice Problems With Solution

///Java Tutorial: Chapter 1- Practice Set | Java Practice Problems With Solution

Java Tutorial: Chapter 1- Practice Set | Java Practice Problems With Solution

FavoriteLoadingAdd to favorites

Java Programming Tutorial: In this video, I have solved few question from the Chapter 1 Practice Set. This practice set will contain all the questions for practice from our chapter 1: Variables and data types
►This playlist is a part of my Complete Java Course playlist:
►Source Code + Notes –
►Ultimate Java CheatSheet:
►Checkout my English channel here:
►Click here to subscribe –

Java468x60

Best Hindi Videos For Learning Programming:
►Learn Python In One Video –

►Python Complete Course In Hindi –

►C Language Complete Course In Hindi –

►JavaScript Complete Course In Hindi –

►Learn JavaScript in One Video –

►Learn PHP In One Video –

►Django Complete Course In Hindi –

►Machine Learning Using Python –

►Creating & Hosting A Website (Tech Blog) Using Python –

►Advanced Python Tutorials –

►Object Oriented Programming In Python –

►Python Data Science and Big Data Tutorials –

Follow Me On Social Media
►Website (created using Flask) –
►Facebook –
►Instagram –
►Personal Facebook A/c –
Twitter –

source

By |2021-04-03T13:13:47+00:00April 3rd, 2021|Java Video Tutorials|21 Comments

21 Comments

  1. CodeWithHarry April 3, 2021 at 1:13 pm - Reply

    Ho sake to share kar dena Java Course Ki Playlist, Please!

  2. BE20CS092_SANSKAR SHARMA April 3, 2021 at 1:13 pm - Reply

    Maza aa rha hai aapse padhne me ….sending you lots of love

  3. Fahad Ali April 3, 2021 at 1:13 pm - Reply

    Harry bahi CGPA total 4 nii hota ?

  4. 005-cse-kashif khan April 3, 2021 at 1:13 pm - Reply

    // Question 2 but it takes values from the user

    Scanner sc = new Scanner(System.in);

    System.out.println("enter the number of first subject");

    float sub1 = sc.nextFloat();

    System.out.println("enter the number of second subject ");

    float sub2 = sc.nextFloat();

    System.out.println("subject3");

    float sub3 = sc.nextFloat();

    System.out.println("subject4");

    float sub4 = sc.nextFloat();

    System.out.println("subject5");

    float sub5 = sc.nextFloat();

    System.out.println("subject6");

    float sub6 = sc.nextFloat();

    float cgpa = (sub1 + sub2 + sub3 + sub4 + sub5 + sub6)/30;

    System.out.println("this is your cgpa");

    System.out.println(cgpa);

  5. GT-Game and Tech April 3, 2021 at 1:13 pm - Reply

    The answer of the 4th one is:
    public class Excersise {

    public static void main(String[]args){

    // convert kilometers into hours:

    double kilometers=100;

    double miles=kilometers/1.609;

    System.out.println(miles);

    }

    }

  6. kimabb April 3, 2021 at 1:13 pm - Reply

    5:39 mai aapne float number ke peche f nahi lagaya phir bhi kaise run hua

  7. Abhay Sagar April 3, 2021 at 1:13 pm - Reply

    package revision_mode;

    import java.util.Scanner;

    public class percent {

    public static void main(String[] args) {

    // TODO Auto-generated method stub

    Scanner S = new Scanner(System.in);

    System.out.println("enter subject1 number");

    int subject1 = S.nextInt();

    System.out.println("enter subject2 number");

    int subject2 = S.nextInt();

    System.out.println("enter subject3 number");

    int subject3 = S.nextInt();

    System.out.println("enter subject4 number");

    int subject4 = S.nextInt();

    System.out.println("enter subject5 number");

    int subject5 = S.nextInt();

    System.out.println("enter outoff");

    int outoff = S.nextInt();

    int total = subject1 + subject2+subject3+subject4+subject5;

    System.out.println("total number get" + total);

    int percentage = (total*100/outoff);

    System.out.println(" you get" + percentage);

    }

    }

  8. EISHA THAKUR April 3, 2021 at 1:13 pm - Reply

    import java.util.Scanner;

    public class kilometretomiles {

    public static void main(String[] args) {

    Scanner a = new Scanner(System.in);

    System.out.println("enter the value");

    float g = a.nextFloat();

    float t = g/1.609344f;

    System.out.println("we have converted km into miles "+t);

    }

    }

  9. VERSATILE GODSON April 3, 2021 at 1:13 pm - Reply

    import java.util.*;

    public class switchcase {

    public static void main(String[] args) {

    int day ;

    int a;

    int b;

    int c;

    int sum;

    int max;

    int a1;

    int a2;

    int a3;

    double summ;

    double per;

    int cgpa ;

    double aaa;

    double miles;

    String aa;

    //switch scanner

    Scanner s1 =new Scanner(System.in);

    System.out.println(" Choose the Question");

    day=s1.nextInt();

    switch (day) {

    case 1:{

    // add 3 number

    Scanner n1=new Scanner(System.in);

    System.out.println("Enter 3 digit number");

    a=n1.nextInt();

    b=n1.nextInt();

    c=n1.nextInt();

    sum=a+b+c;

    System.out.println("sum ="+sum);}

    break;

    case 2:{

    // cacl cgpa but= marks < 100

    Scanner s2=new Scanner(System.in);

    System.out.println("enter full marks ");

    max=s2.nextInt();

    System.out.println("enter marks of 1st subject");

    a1=s2.nextInt();

    System.out.println("enter marks of 2nd subject");

    a2=s2.nextInt();

    System.out.println("enter marks of 3rd subject");

    a3=s2.nextInt();

    summ= a1+a2+a3;

    System.out.println("Marks Obtained"+summ);

    per=summ/(3*max)*100;

    System.out.println("percentage="+per);

    cgpa= (int) (per/9.5);

    System.out.println("cgpa ="+cgpa);}

    break;

    case 3:

    //concat name with greetings

    { Scanner s3 =new Scanner(System.in);

    System.out.println("Enter your name");

    aa= s3.nextLine();

    System.out.println("Hello"+aa+ "have a good day");}

    break;

    case 4:

    //km to miles

    {Scanner s4=new Scanner(System.in);

    System.out.println("Enter kilometer ");

    aaa=s4.nextDouble();

    miles=aaa/1.609;

    System.out.println("miles="+miles);}

    break;

    case 5:

    //check whether int or not

    { System.out.println("enter ur number");

    Scanner s5 =new Scanner(System.in);

    System.out.println(s5.hasNextInt());}

    break;

    }

    }

    }

  10. vishesh sharma April 3, 2021 at 1:13 pm - Reply

    in question 5, if v enter 23.0 then it gave false, why? And for a large integer(123456789), it also gave false.

  11. Chirag Lal April 3, 2021 at 1:13 pm - Reply

    idk why but intellij idea lags in my laptop, my laptop configs: 1tb, 8gb, ryzen 5 3500u

  12. Gaurav Dubey April 3, 2021 at 1:13 pm - Reply

    maja agya bro sirf ek session attend kiya and i can solve all of these questions now…

  13. Rishabh singh April 3, 2021 at 1:13 pm - Reply

    Hi @codewithharry ,
    use of type casting is the best possible way and easy too.
    int a=45;

    int b= 95;

    int c = 48;

    float sum= (a+b+c)/30f;

    System.out.println(sum);

  14. Bhavishi bansal April 3, 2021 at 1:13 pm - Reply

    import java.util.Scanner;

    public class Begginer {

    public static void main(String[] args) {
    Scanner sc=new Scanner(System.in);

    System.out.println("Converting kilometer into miles ");

    System.out.println("Enter the number: ");

    float s=sc.nextInt();

    float mile=s*0.621371F;

    System.out.println(mile);

    }

    }

  15. Manish Verma April 3, 2021 at 1:13 pm - Reply

    sir you are geatest teacher thank you so much

  16. vaibhav pandey April 3, 2021 at 1:13 pm - Reply

    sir where is notes?

  17. Balwinder Kaur April 3, 2021 at 1:13 pm - Reply

    Hlo sir third question mai eh scanner sc kya hai mera error aa raha hai run ni hora program

  18. Deepak Singh April 3, 2021 at 1:13 pm - Reply

    Thnku so much sir

  19. FactzBuzz April 3, 2021 at 1:13 pm - Reply

    import java.util.Scanner;

    public class BoardPercentageCalculator {

    public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);

    System.out.println("CBSE Board Percantage Calculator");

    System.out.println("Enter your MATHS mark here : ");

    float m = sc.nextFloat();

    System.out.println("Enter your PHYSICS marks here : ");

    float p = sc.nextFloat();

    System.out.println("Enter your CHEMESTRY marks here : ");

    float c = sc.nextFloat();

    System.out.println("Enter your BIO marks here : ");

    float b = sc.nextFloat();

    System.out.print("Enter your ENGLISH marks here : ");

    float e = sc.nextFloat();

    float Total = m+p+c+b+e;

    System.out.println("Your total marks scored is = "+Total);

    float per = (Total/500)*100;

    System.out.print("You have scored "+per );

    System.out.println("%");

    System.out.println("THANKS FOR USING MY APP ");

    }

    }

  20. Rudra 7 April 3, 2021 at 1:13 pm - Reply

    whenever i run my program my IDE just crashes . any solution for this

  21. Rohan Beast April 3, 2021 at 1:13 pm - Reply

    because the cgpa is a floating or a double number.

Leave A Comment

*