Question__4

PHOTO EMBED

Wed Apr 05 2023 14:58:20 GMT+0000 (Coordinated Universal Time)

Saved by @Mohamedshariif #java

import java.util.Scanner;
public class BooleanExpression2 {
    

    public static void main(String[] args) {
        
/*   Question 4.
write a program that increases score by 3 % if attendance 
 is greater than 9 and displays the final score.
*/
    Scanner scanner = new Scanner(System.in);
       
    System.out.println("Enter your score, Please: ");
    double score = scanner.nextDouble();
//data type   
    System.out.println("Enter the days you have attended, Please: ");
    int attendence = scanner.nextInt();
    
    if(attendence > 9)
    {
        score = score + score * 0.03;
    }
    System.out.println("Your final score is: "+score);
    
    }
}

//output:
/*Please Enter your score: 
80
Please Enter your attendence: 
10
Your final score is= 82.4
*/
content_copyCOPY