Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class targuil3 {
- public static void main(String[] arg) {
- Scanner s = new Scanner(System.in);
- System.out.println("enter your note of the middle test:");
- int middleTest=s.nextInt();
- System.out.println("enter your note of the final test");
- int finalTest=s.nextInt();
- System.out.println("enter your note of your tasks work");
- int taskNote=s.nextInt();
- //if the student was present at 80% that all the courses he can do the final test.
- //else his note are 0.
- System.out.println("please enter a num between 0 at 100 that represent your attendance at school");
- double presence = s.nextDouble() / 100;
- if(presence>=0.8){
- //here if the presence was>at 80% and also>60 we're adjust the finalTest (+20% at the middletest)
- if(finalTest>=60){
- finalTest+=(0.2*middleTest);
- System.out.println("your final note is:"+finalTest);
- }
- // and if it's not >60 so we're adding 10%from the task's work
- else{
- finalTest+=(0.1*taskNote);
- System.out.println("your final note is:"+finalTest);
- }
- }
- else {
- System.out.println("your final note is: "+0+"/100");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement