Question: It is written in python. DO NOT USE f - string use concatenation. DO NOT USE BUILT IN - FUNCTIONS. Please read the instructions, provide
It is written in python. DO NOT USE fstring use concatenation. DO NOT USE BUILT INFUNCTIONS. Please read the instructions, provide a sample code and make sure the test cases are passed exactly like in the instructions.
CPU Category
Though CPUs, and computer hardware ingeneral, are not the main focus of this course, it can be useful
to know a thing or two about computer hardware. The CPU Central Processing Unit is generally the
piece of hardware that carries out the instructions of the python programs that you run in this class.
In this short project, you will write a program that takes a few input values related to CPU performance.
The program should determine whether or not the specified CPU is within one of four categories: high
performance, mediumperformance, lowperformance, and in need of an upgrade. Name the file
cpu.py
Shown below is an example of the program prompting the user for two inputs, and then printing out the
corresponding CPU performance category:
def main:
gigahertz
corecount
result getresultgigahertz corecount
printresult
main
That is a lowperformance CPU.
The first argument, Gigahertz, should be converted to a float
The second argument, core count, should be an integer
The program should return one of strings:
That is a highperformance CPU.
That is a mediumperformance CPU.
That is a lowperformance CPU.
That CPU could use an upgrade.
How you determine which to return should be based on the below table:
For example, a mediumperformance CPU must satisfy both requirements: a GHz no less than and
b cores no less than
There's also one "specialcase" rule: If a CPU has or more cores, regardless of the other stats, it
should be considered highperformance.
Test Cases
Below are examples of program runs. There will be more tests on Gradescope.
def main:
gigahertz
corecount
assert getresultgigahertz corecount "That is a lowperformance CPU."
gigahertz
corecount
assert getresultgigahertz corecount "That is a mediumperformance CPU."
gigahertz
corecount
assert getresultgigahertz corecount "That CPU could use an upgrade."
printEnd of tests"
main
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
