Advertisement
Guest User

Untitled

a guest
Feb 26th, 2020
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.25 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Project2_Michael_Cheng {
  4.  
  5. public static void main(String[] args) {
  6.  
  7. final double res1 = 1;
  8. final double res2 = .75;
  9. final double res3 = .55;
  10. final double res4 = .35;
  11. double multiplier = 0.0;
  12. double pscore = 0.0;
  13. int rchoice = 0;
  14.  
  15.  
  16. Scanner keyboard = new Scanner(System.in);
  17.  
  18.  
  19. System.out.print("Please enter the clock speed (in Megahertz) of your graphics card: "); // step 1
  20. double gcard = keyboard.nextDouble(); // user input for the name of the graphic card
  21.  
  22.  
  23. System.out.print("Please enter the clock speed (in Megahertz) of your processor: ");
  24. double processor = keyboard.nextDouble(); // variable for processor
  25.  
  26. System.out.print("Please enter the number of cores of your processor: ");
  27. double cores = keyboard.nextDouble(); // variable for cores
  28.  
  29. System.out.println("What is the res of your monitor?");
  30. System.out.println();
  31. System.out.println(" 1. 1280 x 720");
  32. System.out.println(" 2. 1920 x 1080");
  33. System.out.println(" 3. 2560 x 1440");
  34. System.out.println(" 4. 3840 x 2160");
  35. System.out.println();
  36. System.out.print("Please select from the options above: ");
  37. rchoice = keyboard.nextInt();
  38.  
  39. String res = "";
  40.  
  41. if(rchoice == 1)
  42. {
  43. pscore = ((5 * gcard) + (cores * processor)) * res1;
  44. res = "1280 x 720";
  45. }
  46. else if(rchoice == 2)
  47. {
  48. pscore = ((5 * gcard) + (cores * processor)) * res2;
  49. res = "1920 x 1080";
  50. }
  51. else if (rchoice == 3)
  52. {
  53. pscore = ((5 * gcard) + (cores * processor)) * res3;
  54. res = "2560 x 1440";
  55. }
  56. else if (rchoice == 4)
  57. {
  58. pscore = ((5 * gcard) + (cores * processor)) * res4;
  59. res = "3840 x 2160";
  60. }
  61.  
  62. String gqual = "";
  63.  
  64. if(pscore > 17000) //17001
  65. {
  66. gqual = "Ultra";
  67. }
  68. else if(pscore > 15000 && pscore <= 17000) //15001 17000
  69. {
  70. gqual = "High";
  71. }
  72. else if(pscore > 13000 && pscore <= 15000) //13001 15000
  73. {
  74. gqual = "Medium";
  75. }
  76. else if(pscore > 11000 && pscore <= 13000) //11001 13000 5
  77. {
  78. gqual = "Low";
  79. }
  80. else if(pscore <= 11000) //11000 242
  81. {
  82. gqual = "Unable to Play";
  83. }
  84.  
  85.  
  86.  
  87.  
  88.  
  89. System.out.println();
  90. String s1 = "Computer Hardware Graphics Quality Recommendation Tool";
  91. System.out.println(s1);
  92. System.out.printf("GPU Clock Speed: " + gcard);
  93. System.out.println();
  94. System.out.printf("CPU Clock Speed: " + processor);
  95. System.out.println();
  96. System.out.printf("Number of cores: " + cores);
  97. System.out.println();
  98. System.out.printf("Monitor Resolution: " + res);
  99. System.out.println();
  100. System.out.printf("Performance Score: %,.3f", pscore);
  101. System.out.println();
  102. System.out.print("The Recommended Graphics Quality: " + gqual);
  103. System.out.println();
  104.  
  105. }
  106.  
  107. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement