Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Project2_Michael_Cheng {
- public static void main(String[] args) {
- final double res1 = 1;
- final double res2 = .75;
- final double res3 = .55;
- final double res4 = .35;
- double multiplier = 0.0;
- double pscore = 0.0;
- int rchoice = 0;
- Scanner keyboard = new Scanner(System.in);
- System.out.print("Please enter the clock speed (in Megahertz) of your graphics card: "); // step 1
- double gcard = keyboard.nextDouble(); // user input for the name of the graphic card
- System.out.print("Please enter the clock speed (in Megahertz) of your processor: ");
- double processor = keyboard.nextDouble(); // variable for processor
- System.out.print("Please enter the number of cores of your processor: ");
- double cores = keyboard.nextDouble(); // variable for cores
- System.out.println("What is the res of your monitor?");
- System.out.println();
- System.out.println(" 1. 1280 x 720");
- System.out.println(" 2. 1920 x 1080");
- System.out.println(" 3. 2560 x 1440");
- System.out.println(" 4. 3840 x 2160");
- System.out.println();
- System.out.print("Please select from the options above: ");
- rchoice = keyboard.nextInt();
- String res = "";
- if(rchoice == 1)
- {
- pscore = ((5 * gcard) + (cores * processor)) * res1;
- res = "1280 x 720";
- }
- else if(rchoice == 2)
- {
- pscore = ((5 * gcard) + (cores * processor)) * res2;
- res = "1920 x 1080";
- }
- else if (rchoice == 3)
- {
- pscore = ((5 * gcard) + (cores * processor)) * res3;
- res = "2560 x 1440";
- }
- else if (rchoice == 4)
- {
- pscore = ((5 * gcard) + (cores * processor)) * res4;
- res = "3840 x 2160";
- }
- String gqual = "";
- if(pscore > 17000) //17001
- {
- gqual = "Ultra";
- }
- else if(pscore > 15000 && pscore <= 17000) //15001 17000
- {
- gqual = "High";
- }
- else if(pscore > 13000 && pscore <= 15000) //13001 15000
- {
- gqual = "Medium";
- }
- else if(pscore > 11000 && pscore <= 13000) //11001 13000 5
- {
- gqual = "Low";
- }
- else if(pscore <= 11000) //11000 242
- {
- gqual = "Unable to Play";
- }
- System.out.println();
- String s1 = "Computer Hardware Graphics Quality Recommendation Tool";
- System.out.println(s1);
- System.out.printf("GPU Clock Speed: " + gcard);
- System.out.println();
- System.out.printf("CPU Clock Speed: " + processor);
- System.out.println();
- System.out.printf("Number of cores: " + cores);
- System.out.println();
- System.out.printf("Monitor Resolution: " + res);
- System.out.println();
- System.out.printf("Performance Score: %,.3f", pscore);
- System.out.println();
- System.out.print("The Recommended Graphics Quality: " + gqual);
- System.out.println();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement