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 f-string use concatenation. DO NOT USE BUILT IN-FUNCTIONS. 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 in-general, 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, medium-performance, low-performance, 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 =2.7
core_count =2
result = get_result(gigahertz, core_count)
print(result)
main()
That is a low-performance 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 4 strings:
That is a high-performance CPU.
That is a medium-performance CPU.
That is a low-performance CPU.
That CPU could use an upgrade.
How you determine which to return should be based on the below table:
For example, a medium-performance CPU must satisfy both requirements: a) GHz no less than 2.5 and
b) cores no less than 6.
There's also one "special-case" rule: If a CPU has 20 or more cores, regardless of the other stats, it
should be considered high-performance.
Test Cases
Below are examples of program runs. There will be more tests on Gradescope.
def main():
gigahertz =2.0
core_count =8
assert get_result(gigahertz, core_count)== "That is a low-performance CPU."
gigahertz =4.0
core_count =7
assert get_result(gigahertz, core_count)== "That is a medium-performance CPU."
gigahertz =1.0
core_count =10
assert get_result(gigahertz, core_count)== "That CPU could use an upgrade."
print("End of tests")
main()
It is written in python. DO NOT USE f - string

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!