java

Write a program to find out wether a student is pass or fail, if it requires total of 40% marks to pass and at least 33% in each subject to pass. Assume three subject as an input from user. ( Second logic )

Write a program to find out wether a student is pass or fail, if it requires total of 40% marks to pass and at least 33% in each subject to pass. Assume three subject as an input from user. ( Second logic ) ( #JAVA )

java

/*

Write a program to find out wether a student is pass or fail, if it requires total of 40% marks to pass and at least 33% in each subject to pass. Assume three subject as an input from user. ( Second logic ) ( #JAVA )

*/


package com.company;

import java.util.Scanner;
public class PassingResult
{
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
System.out.println(“Input marks of Subject 1 :”);
float s1 = sc.nextFloat();
System.out.println(“Input marks of Subject 2 :”);
float s2 = sc.nextFloat();
System.out.println(“Input marks of Subject 3 :”);
float s3 = sc.nextFloat();

float sum = s1 + s2 + s3;
float percentage = (sum/300)*100;
System.out.println(“Total marks obtained : ” + sum);
System.out.println(“Percentage ” + percentage);

// Logic of code

if ( percentage >= 40 && s1 >= 33 && s2 >= 33 && s3 >= 33 )
System.out.println(“You are PASS”);
else
System.out.println(“You are FAIL”);

} // end of mains
} // end of class


Thanks Dosto for Reading this blog.

I think you all are definitely thinking of being connected with me.

Are you??
Yaa I know no-one is here but then also I provide my all social media links of my Digital Creation Tech DCode and my personal handles.
πŸ§‘β€πŸ’»πŸ§‘β€πŸ’» Social Media Links of Tech DCode :
πŸ‘‰πŸ» Instagram : https://www.instagram.com/thetechdcode/
πŸ‘‰πŸ» Facebook Page : https://www.facebook.com/thetechdcode
πŸ‘‰πŸ» Twitter : https://twitter.com/thetechdcode
πŸ‘‰πŸ» Telegram Channel : https://t.me/thetechdcode
πŸ‘‰πŸ» YouTube : https://www.youtube.com/channel/UCjJnEdeugftBwQ3yMuD4B_A
πŸ‘‰πŸ» Tech DCode Linktree : https://linktr.ee/thetechdcode
πŸ‘‰πŸ» My Personal Handles : https://linktr.ee/virtualshivamin

πŸ§‘β€πŸ’»πŸ§‘β€πŸ’» Social Media Links of SHIVAM SINGH (OWNER) :
πŸ‘‰πŸ» Instagram : https://www.instagram.com/virtualshivamin/
πŸ‘‰πŸ» Facebook Page : https://www.facebook.com/virtualshivamin/
πŸ‘‰πŸ» Twitter : https://twitter.com/virtualshivamin/
πŸ‘‰πŸ» Personal Linktree : https://linktr.ee/virtualshivamin

🀟🀘 Check Best Offers/Deals and Discount on Amazon :
πŸ‘‰ Amazon : https://amzn.to/3tLt2FN
πŸ‘‰ Bestsellers : https://amzn.to/31boSuB
πŸ‘‰ New Realeases : https://amzn.to/3rdru5U
πŸ‘‰ Movers and Shakers : https://amzn.to/3lFu5nY
πŸ‘‰ Computer and accessories : https://amzn.to/3lERTbJ
πŸ‘‰ Electronics : https://amzn.to/3sqHW4l
πŸ‘‰ Softwares : https://amzn.to/3ccwAee

Leave a Reply

Your email address will not be published. Required fields are marked *