Page 1 of 1

#1 Zadatak C++, molim pomoć

Posted: 04/02/2015 21:35
by sarkić ajid-paša
Pozdrav!
Zamolio bih nekog ako može da mi uradi sledeći zadatak, unapred hvala:

In this homework, you will design a program to perform the following task:
Calculate the total price based on several key parts required to build a state-of-the-art gaming computer. The user will have the option of selecting different parts. For example, Windows 7, Windows 8 or Mac OS/X for Operating systems, 4 GB, 8 GB or 12 GB for RAM and 15”,17” or 22” Monitors.
There are 5 components of your submission including:
• Program Description- A detailed, clear description of the program you are building.
• Analysis- Demonstrates your thought process and steps used to analyze the problem. Be sure to include the required input and output and how you will obtain the required output from the given input? Also, include your variable names and definitions. Be sure to describe the necessary formulas and sample calculations that might be needed. You should talk about how you determined your computer part prices.
• Test plan - Prepare at least 3 sets of input data (Test data) along with their expected output for testing your program. Your test data can be presented in the form of a table as follows (note: feel free to adapt to your design)
• Flowchart – Provide a flowchart for your design. You can use Word, Powerpoint, Visio or any software you have available that will allow to draw shapes and connectors.
• Pseudocode- Provide pseudocode of your overall design that fulfills the requirements of the project
All of these components should be placed in word document for submission.
Additional details about the program you need to write:
1 You should research current prices of the computer parts on Internet sites such as amazon.com or newegg.com.
2 You can assume a computer will consist of the following components:
CPU
Case
Power supply
Motherboard
Hard Drive
RAM
DVD
Sound Card
Monitor
Graphics Card
Operating System
I would recommend you keep the option choices limited to 3 different components, or your program will really grow fast. For example, you could provide options for the Operating System (Windows 7, Windows 8 or Mac OS/X), the RAM (4 MB, 8 MB, 12 MB) and the Hard Drive Size (500 GB, 1 TB, 1.5 TB) and leave everything else as a baseline. These are just examples. I leave it up to you to determine which components you want the user to select options. Be sure your prices are realistic.
1 There is much flexibility for this project. You should reach a unique design. I recommend keeping it simple at first and then add more user options if you have time.
Example application test data:
Test Case # Input Expected Output
1 Baseline Cost: $500
CPU Option 1 (2.2 GHz,$400)
Monitor Option 2 (Dell,$200)
RAM Option 1 (4 GB,$89)
(Total price would be $500 + cost of CPU+ cost of Monitor + Cost of Ram)
Total Price = $1189
2 Your Computer selection options Your output
3 Your Computer selection options Your output

#2 Re: Zadatak C++, molim pomoć

Posted: 04/02/2015 21:56
by Ajatolah_
Da ti pravo kažem, puno je to posla.

#3 Re: Zadatak C++, molim pomoć

Posted: 05/02/2015 00:30
by NightComer
Napisano je puno teksta, al i nema bas puno posla oko toga. Neda mi se trenutno pisati kod, al jedino sto ti je potrebno je gomila if statementa, i onda kod svakog pojedinog dodas cijena += vrijednostKomponente;

#4 Re: Zadatak C++, molim pomoć

Posted: 05/02/2015 17:27
by sarkić ajid-paša
#include <iostream>
#include <iomanip>
#include <string>

using namespace std;

int main ()
{
//Declare variables
char cpuMobo, RAM, monitor, graphicsCard;
float price_cpuMobo, price_RAM, price_monitor, price_graphicsCard;
float totalPrice;

//Initialize variables
price_cpuMobo = 0;
price_RAM = 0;
price_monitor = 0;
price_graphicsCard = 0;
totalPrice = 0;
// cpuMoBo = 'a';
// RAM = 'c';
// monitor = 'f';
// graphicsCard = 'i';

//Get user input
cin >> cpuMobo;

/* Input choice of CPU – 'a' for Intel Core-i7 and 'b' for AMD FX-6350 */

if (cpuMobo == 'a')
price_cpuMobo=400;
else if (cpuMobo == 'b')
price_cpuMobo=187;


//Input choice of RAM – 'c' for 8GB DDR3 1600, 'd' for 16GB DDR3 1600, 'e' for 32GB DDR3 1866
cin >> RAM;
if (RAM == 'c')
price_RAM=85;
else if (RAM == 'd')
price_RAM =165;
else if (RAM == 'e')
price_RAM =350;

//Input choice of monitor – 'f' for 18.5”, 'g' for 20”, 'h' for 23.5” LED monitor
cin >> monitor;
if (monitor == 'f')
price_monitor=90;
else if (monitor == 'g')
price_ monitor =350;
else if (monitor == 'h')
price_ monitor =500;


//Input choice of graphics card – ‘i’ for nVidia GeForce 2GB, ‘j’ for AMD Radeon R9 4GB
cin >> graphicsCard ;
if (graphicsCard == 'i')
price_graphicsCard=330;
else if (graphicsCard == 'j')
price_ graphicsCard =500;


/*Calculate total price. Price of other fixed components in the computer is $803. Add this to the price of CPU, RAM, monitor, and graphics card according

to customer’s choice above.*/
totalPrice = 803 + price_cpuMobo + price_RAM + price_monitor + price_graphicsCard;

//Output Total Price
cout << fixed << "Total Price of your Gaming Computer is " << setprecision(6) << totalPrice;

return 0;

#5 Re: Zadatak C++, molim pomoć

Posted: 05/02/2015 17:28
by sarkić ajid-paša
Da li ovo izgleda otprilike tacno,OUTPUT mi je error poruka