Horje
Uri/beecrowd problem no 1118 solution in Java Code Example
Uri/beecrowd problem no 1118 solution in Java
import java.util.Scanner;
public class Main{
    public static void main (String[] args) {
        
        Scanner obj = new Scanner(System.in);
        
        int limit = 1;
        while(limit != 2){
            if(limit == 1){
                int counter = 0;
                float sum = 0;
                while(counter != 2){
                    float num = obj.nextFloat();
                    if(num >= 0.0 && num <= 10.0){
                        counter++;
                        sum += num;
                    }else{
                        System.out.println("nota invalida");
                    }
                }
                System.out.format("media = %.2f\n", (sum/counter));
            }
            System.out.println("novo calculo (1-sim 2-nao)");
            limit = obj.nextInt();
        }
        
    }
}




Java

Related
spring boot interview questions 2020 Code Example spring boot interview questions 2020 Code Example
java check if a line is enclosed in quotation marks Code Example java check if a line is enclosed in quotation marks Code Example
how to make more than one jlabel at once in java Code Example how to make more than one jlabel at once in java Code Example
mock dynamodb unit Code Example mock dynamodb unit Code Example
java bitwise xor Code Example java bitwise xor Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10