Computer Hardware Quote Generator

Have you ever wondered how computer manufacturers calculate the price of a custom PC? Or maybe you have dreamed of building your own computer but were not sure how much it would cost? In this Python challenge, you’ll step into the shoes of a computer builder! Your mission: write a program that lets users pick their ideal hardware components and generates a quote price for their custom computer.

Your Challenge

For this challenge you will create a Python program that:

  • Displays a menu of hardware options (e.g., screen size, RAM, CPU, storage).
  • Lets the user select their preferred components.
  • Calculates the total price based on their choices.
  • Outputs a detailed quote with the selected specifications and total cost.

Hardware Options

Your program should allow users to customise at least the following components:

Component Options (with Base Prices)
Screen Size 13″ (ÂŁ50), 15″ (ÂŁ100), 17″ (ÂŁ150)
RAM 8GB (ÂŁ40), 16GB (ÂŁ80), 32GB (ÂŁ150)
CPU Clock Speed 2.5GHz (ÂŁ100), 3.2GHz (ÂŁ200), 4.0GHz (ÂŁ350)
Storage 256GB HDD (ÂŁ30), 512GB SSD (ÂŁ60), 1TB SSD (ÂŁ120)
Graphics Card Integrated (ÂŁ0), Dedicated (ÂŁ150), High-End (ÂŁ400)

Feel free to add more components or options in your code!

Sample Output

Welcome to the Custom Computer Quote Generator!

Please select your screen size:
a. 13" (ÂŁ50)
b. 15" (ÂŁ100)
c. 17" (ÂŁ150)
> b

Please select your RAM:
a. 8GB (ÂŁ40)
b. 16GB (ÂŁ80)
c. 32GB (ÂŁ150)
> b

Please select your CPU clock speed:
a. 2.5GHz (ÂŁ100)
b. 3.2GHz (ÂŁ200)
c. 4.0GHz (ÂŁ350)
> c

Please select your storage:
a. 256GB HDD (ÂŁ30)
b. 512GB SSD (ÂŁ60)
c. 1TB SSD (ÂŁ120)
> c

---
Your Custom Computer Quote:
 - Screen Size: 15" (ÂŁ100)
 - RAM: 16GB (ÂŁ80)
 - CPU: 4.0GHz (ÂŁ350)
 - Storage: 1TB SSD (ÂŁ120)
TOTAL PRICE: ÂŁ650
---

Python Code

We have started the code for you but you will need to complete it to:

    Let the user pick up more hardware options
    Calculate and output the total cost of the PC
    Display a summary of the selected hardware specifications

Extension Task: Entering a Discount Code

Once the user has made their selection, they should be prompted to enter a voucher code. The system currently accepts the following three voucher codes:

  • PROMO-10 which gives a 10% discount on the total cost of the computer.
  • PROMO-20 which gives a 20% discount on the total cost of the computer.
  • PROMO-30 which gives a 30% discount on the total cost of the computer but is only applicable on computers costing ÂŁ600 or more.

unlock-access

Solution...

The solution for this challenge is available to full members!
Find out how to become a member:
➤ Members' Area

Did you like this challenge?

Click on a star to rate it!

Average rating 3.1 / 5. Vote count: 74

No votes so far! Be the first to rate this post.

As you found this challenge interesting...

Follow us on social media!