Write a program to estimate the computer cost. The cost of RAM is Rs. 1100 per GB, cost of Hard Disk is Rs. 10 per GB, cost of speakers is Rs. 1200, cost of LCD monitor is Rs. 5500, cost of LED monitor is Rs. 6700, and processor is Rs. 7000. There is a fixed cost of Rs. 3200 for Cabinet, Keyboard, Mouse and assembly. NOTE: For every computer, the processor and the fixed cost is must. The user has to choose either LED or LCD for the monitor.
Input (Computer) |
Output (Estimated Cost) |
Ram = 3, Hard Disk = 200, Speakers and LED |
3 * 1100.0 (RAM cost) + 200 * 10.0 (Hard Disk cost) + 1200.0 (Speakers) + 6700.0 (LED cost) + 7000.0 (Processor Cost) + 3200.0 (Fixed Cost)
= 3300.0 + 2000.0 + 1200.0 + 6700.0 + 7000.0 + 3200.0
= 23400.0 |
Ram = 1, Hard Disk = 500, LCD |
1 * 1100.0 (RAM cost) + 500 * 10.0 (Hard Disk cost) + 5500.0 (LCD cost) + 7000.0 (Processor Cost) + 3200.0 (Fixed Cost)
= 1100.0 + 5000.0 + 5500.0 + 7000.0 + 3200.0
= 21800.0 |