Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Created by: Lizette Gomez
- import java.util.Scanner;
- public class Project1_Lizette_Gomez_CSC
- {
- public static void main(String [] args)
- {
- //Declare final constants
- final double MULTIPLIER_RESOLUTION_1280x720 = 1;
- final double MULTIPLIER_RESOLUTION_1920x1080 = .75;
- final double MULTIPLIER_RESOLUTION_2560x1440 = .55;
- final double MULTIPLIER_RESOLUTION_3840x2160 = .35;
- //Declare const Variables
- int resolutionChoice = 0;
- double multiplier = 0.0;
- double performanceScore = 0.0;
- double graphicsCardSpeed = 0.0;
- double processorSpeed = 0.0;
- double numberCores = 0.0;
- String resolution = "";
- String graphicsQuality = "";
- String title;
- //scanner to take userinput
- Scanner keyboard = new Scanner(System.in);
- //Ask the user for GPU, CPU and numberOfCores
- System.out.print("\n\nPlease enter the clock speed (in Megahertz) of your graphics card: ");
- graphicsCardSpeed = keyboard.nextDouble();
- System.out.print("Please enter the clock speed (in Megahertz) of your processor: ");
- processorSpeed = keyboard.nextDouble();
- System.out.print("Please enter the number of cores of your processor: ");
- numberCores = keyboard.nextDouble();
- //Display the Resolution Menu
- System.out.println("What is the resolution of your monitor?");
- System.out.println("\t\t\t1. 1280 x 720");
- System.out.println("\t\t\t2. 1920 x 1080");
- System.out.println("\t\t\t3. 2560 x 1440");
- System.out.println("\t\t\t4. 3840 x 2160");
- //Ask option
- System.out.print("Please select from the options above: ");
- resolutionChoice = keyboard.nextInt();
- //If-else Statement aka ==> logic for performanceScore
- if(resolutionChoice == 1)
- {
- performanceScore = ((5 * graphicsCardSpeed) + (numberCores * processorSpeed)) * MULTIPLIER_RESOLUTION_1280x720;
- resolution = "1280 x 720";
- }
- else if(resolutionChoice == 2)
- {
- performanceScore = ((5 * graphicsCardSpeed) + (numberCores * processorSpeed)) * MULTIPLIER_RESOLUTION_1920x1080;
- resolution = "1920 x 1080";
- }
- else if (resolutionChoice == 3)
- {
- performanceScore = ((5 * graphicsCardSpeed) + (numberCores * processorSpeed)) * MULTIPLIER_RESOLUTION_2560x1440;
- resolution = "2560 x 1440";
- }
- else if (resolutionChoice == 4)
- {
- performanceScore = ((5 * graphicsCardSpeed) + (numberCores * processorSpeed)) * MULTIPLIER_RESOLUTION_3840x2160;
- resolution = "3840 x 2160";
- }
- //Another If-else Statement aka ==> logic for graphicsQuality
- if(performanceScore > 17000) //17001
- {
- graphicsQuality = "Ultra";
- }
- else if(performanceScore > 15000 && performanceScore <= 17000) //15001 17000
- {
- graphicsQuality = "High";
- }
- else if(performanceScore > 13000 && performanceScore <= 15000) //13001 15000
- {
- graphicsQuality = "Medium";
- }
- else if(performanceScore > 11000 && performanceScore <= 13000) //11001 13000 5
- {
- graphicsQuality = "Low";
- }
- else if(performanceScore <= 11000) //11000 242
- {
- graphicsQuality = "Unable to Play";
- }
- title = "Computer Hardware Graphics Quality Recommendation Tool"; // STEP 8: String object to hold the title
- System.out.println("\n" + title + "\n");
- //STEP 9: Display the output
- System.out.printf("GPU Clock Speed: %.0f MHz\n" , graphicsCardSpeed);
- System.out.printf("CPU Clock Speed: %.0f MHz\n" , processorSpeed);
- System.out.printf("Number of cores: %.0f\n" , numberCores);
- System.out.print("Monitor Resolution: " + resolution + "\n");
- System.out.printf("Performance Score: %,.3f\n", performanceScore);
- System.out.print("The Recommended Graphics Quality: " + graphicsQuality);
- } //End of Main
- } //End of Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement