Question: please write a code Write a function computer-price() that takes the following arguments, in this order, and computes the price of a computer: 1. cpu:
please write a code
Write a function computer-price() that takes the following arguments, in this order, and computes the price of a computer: 1. cpu: the manufacturer of the CPU, which must be "Intel" or "AMD" (capitalized just so) 2. ghz: the gigahertz rating of the CPU, which must be a positive number 3. disk.type: the disk type, which must be "SSD" or "HDD" (capitalized just so 4. disk.size: the disk's size in gigabytes, which must be a positive number The base price of the computer is $1000. Components add to the computer's price as follows: An Intel processor adds $200. An AMD processor adds $175. A CPU running at 2 GHz or higher adds $150. A CPU running at 1 GHz or higher (but less than 2 GHz) adds $80. A solid state disk (SSD) adds $225. . A hard disk (HDD) adds $100 Each gigabyte of disk space costs $2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
