repl.it
@shalomeyifru1/

Assignment 1, Movie Ratings

Java

No description

fork
loading
Files
  • Main.java
  • jdt.ls-java-project
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import java.util.Scanner;
import java.lang.Math;

class Main {
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    System.out.println("Please enter ratings from the movie review website.");
    int w1 = scan.nextInt(); //website movie ratings
    int w2 = scan.nextInt();
    int w3 = scan.nextInt();
    System.out.println("Please enter ratings from the focus group.");
    double g1 = scan.nextDouble(); //group ratings
    double g2 = scan.nextDouble();
    System.out.println("Please enter the average movie critic rating.");
    double c = scan.nextDouble(); // avg critic rating
    double aw = (w1 + w2 + w3)/3.0; //avg website rating
    double ag = (g1 + g2)/2.0; //avg group rating
    double o = ((aw*0.20) + (ag*0.30) + (c*0.50)); //overall rating
    System.out.println("Average website rating:" + aw); //print avg web rating
    System.out.println("Average focus group rating:" + ag); //print avg group rating
    System.out.println("Average movie critic rating:" + c); //print avg critic rating
    System.out.println("Overall movie rating:" + o); //print overall rating
  }
}
?