Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication35
- {
- class Program
- {
- static void Main(string[] args)
- {
- CPU cp1 = new CPU("Intel", 2800);
- GPU gp1 = new GPU("Radeon", 1024);
- DDR ddr1 = new DDR("DDR2", 2048);
- MB mb1 = new MB("P5QC", 1333);
- Computer setup1 = new Computer(cp1, gp1, ddr1, mb1);
- setup1.GetTotalIndex();
- }
- }
- class Computer
- {
- public CPU cpu;
- public GPU gpu;
- public DDR ddr;
- public MB mb;
- public Computer(CPU cp, GPU gp, DDR ram, MB board)
- {
- cpu = cp;
- gpu = gp;
- ddr = ram;
- mb = board;
- }
- public int GetTotalIndex()
- {
- int indexCP = 0;
- if (cpu.perf >= 2000 & cpu.perf <= 2400)
- indexCP = 1;
- else if (cpu.perf > 2400 & cpu.perf <= 2800)
- indexCP = 2;
- else if (cpu.perf > 2800 & cpu.perf <= 3200)
- indexCP = 3;
- else if (cpu.perf > 3200 & cpu.perf <= 3600)
- indexCP = 4;
- else if (cpu.perf > 3600)
- indexCP = 5;
- return indexCP;
- }
- }
- class CPU
- {
- public string title;
- public int perf;
- public CPU(string t, int p)
- {
- title = t;
- perf = p;
- }
- }
- class GPU
- {
- public string title;
- public int perf;
- public GPU(string t, int p)
- {
- title = t;
- perf = p;
- }
- }
- class DDR
- {
- public string title;
- public int perf;
- public DDR(string t, int p)
- {
- title = t;
- perf = p;
- }
- }
- class MB
- {
- public string title;
- public int perf;
- public MB(string t, int p)
- {
- title = t;
- perf = p;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement