Question
Project 2 is a continuation of Project 1. Modify the code from Project 1 in the following ways: Step 1: Add code that prompts the
Project 2 is a continuation of Project 1. Modify the code from Project 1 in the following ways:
Step 1: Add code that prompts the user for the number of computers that they wish to enter information for. Do not accept a number less than 1 for the user's input.
Step 2: Display the title String "Computer Hardware Graphics Quality Recommendation Tool" once at the top of the output.
Step 3: Add code to let the user enter information for each computer, and output all of the information about the computer (including the performance score and recommended graphics quality) as shown in the Sample Input and Output below.
Step 4: Add Input Validation to the program using the following rules:
- The GPU clock speed should be between 800 and 2000 MHz
- The CPU clock speed should be between 1000 and 5500 MHz
- The number of cores should be between 1 and 16
- The user's input for the menu selection should be between 1 and 4
The code should not proceed until a valid value is entered for each of the rules listed in the bullets above.
Step 5: At the end of the output, the program should display the highest and lowest performance score.
The code you submit should be thoroughly documented with comments where appropriate.
**This program should be written in C++ language** **I have attached photos of my Project 1 below. This is the code that should be altered to meet Project 2 criteria**
#include
int main() { int choice; int clkspGPU; int clkspCPU; int numCores; cout<<"Enter the clock speed (in Megahertz) of your graphics card (GPU): "; cin>>clkspGPU; cout<<"Enter the clock speed (in Megahertz) of your processor (CPU): "; cin>>clkspCPU; cout<<"Enter the number of cores that your processor (CPU) has: "; cin>>numCores; cout<<"What is the resolution of your monitor?"; const int Low=1, Mid=2, High=3, Highest=4; cout<< " Resolution Menu " << "1. 1280 x 720 " << "2. 1920 x 1080 " << "3. 2560 x 1440 " << "4. 3840 x 2160 " << "Enter the number (1-4) that corresponds to your choice."; cin>>choice; //mult values float multiplier; if (choice==1) { multiplier=1; } else if (choice==2) { multiplier=0.75; } else if (choice==3) { multiplier=0.55; } else { multiplier=0.35; } //Calculate Performance Score //Performance Score = ((5 * GPU Clock Speed) + (Number of Cores * CPU Clock Speed)) * Multiplier int Perf_Score; Perf_Score=((5*clkspGPU)+(numCores*clkspCPU))*multiplier; if (Perf_Score>17000) { cout<<"Recommended Quality is Ultra/n/n"; } else if (Perf_Score>=15000 && Perf_Score<=17000) { cout<<"Recommended Quality is High "; } else if (Perf_Score>=13000 && Perf_Score<15000) { cout<<"Recommended Quality is Medium "; } else if (Perf_Score>=11000 && Perf_Score<13000) { cout<<"Recommended Quality is Low "; } else { cout<<"Unable to Play "; }
cout<<"Computer Hardware Graphics Quality Tool "; cout<<"GPU clock speed:"<
string reso;
if (choice==1) { reso="1280 x 720"; } else if (choice==2) { reso="1920 x 1080"; } else if (choice==3) { reso="2560 x 1440"; } else if (choice==4) { reso="3840 x 2160"; } else { cout<<"Error in entry "; } cout<<"Monitor Resolution:"<
return 0; }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started