Advertisement
Guest User

targuil3

a guest
May 22nd, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.31 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class targuil3 {
  4.     public static void main(String[] arg) {
  5.         Scanner s = new Scanner(System.in);
  6.  
  7.         System.out.println("enter your note of the middle test:");
  8.         int middleTest=s.nextInt();
  9.         System.out.println("enter your note of the final test");
  10.         int finalTest=s.nextInt();
  11.         System.out.println("enter your note of your tasks work");
  12.         int taskNote=s.nextInt();
  13.  
  14. //if the student was present at 80% that all the courses he can do the final test.
  15. //else his note are 0.
  16.  
  17.         System.out.println("please enter a num between 0 at 100 that represent your attendance at school");
  18.         double presence = s.nextDouble() / 100;
  19.  
  20.  
  21.         if(presence>=0.8){
  22.  //here if the presence was>at 80% and also>60 we're adjust the finalTest (+20% at the middletest)
  23.             if(finalTest>=60){
  24.                finalTest+=(0.2*middleTest);
  25.                System.out.println("your final note is:"+finalTest);
  26.            }
  27. // and if it's not >60 so we're adding 10%from the task's work
  28.             else{
  29.                finalTest+=(0.1*taskNote);
  30.                System.out.println("your final note is:"+finalTest);
  31.            }
  32.         }
  33.         else {
  34.             System.out.println("your final note is: "+0+"/100");
  35.         }
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement