Advertisement
CR7CR7

02.Passed

Sep 17th, 2022
704
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.55 KB | None | 0 0
  1. //Write a program that takes as an input a grade and prints "Passed!" if the grade is equal or more than 3.00.
  2. //The input comes as a single floating-point number.
  3. //The output is either "Passed!" if the grade is equal or more than 3.00, otherwise, you should print nothing.
  4. import java.util.Scanner;
  5. public class Pass{
  6.   public static void main(String[] args) {
  7.    //Source Code
  8.     Scanner sc = new Scanner(System.in);
  9.     double grade = Double.parseDouble(sc.nextLine());
  10.     if (grade >= 3.00) {
  11.    System.out.println("Passed!");
  12. }
  13.  
  14.   }
  15. }
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement