Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

CompositeScore

import java.util.Scanner;
import java.text.DecimalFormat;
public class CompositeScore{

     public static void main(String []args){
         System.out.println("Enter three exam scores: ");
         Scanner sc = new Scanner(System.in);
         int exam1 = sc.nextInt();
         int exam2 = sc.nextInt();
         int exam3 = sc.nextInt();
         int min = Math.min(exam1, Math.min(exam2, exam3));
         
         int sum = exam1 + exam2 + exam3 - min;
         double avg = sum / 2;
         double score = new DecimalFormat(0#.#);
         
         
         System.out.println("Composite Score: " + score);
         
     }
}

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.