-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmovieInventory_lab.cpp
102 lines (76 loc) · 1.98 KB
/
movieInventory_lab.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
// movieInventory_LAB.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <iomanip>
#include <string>
#include "screen.h"
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
double gPrice;
int numGotG;
double totalG;
double xPrice;
int numXmen;
double totalX;
double ePrice;
int numEdge;
double totalE;
int numTotal;
double avgValue;
double totalValue;
// set fixed number notation, showpoint and decimal accuracy
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout << setprecision(2);
//ask movie prices and the ammount in inventory
cout << "How much is Guardians? ";
cin >> gPrice;
cout << "How many Guardians does the store own? ";
cin >> numGotG;
cout << "How much is X-Men? ";
cin >> xPrice;
cout << "How many X-Men does the store own? ";
cin >> numXmen;
cout << "How much is Edge? ";
cin >> ePrice;
cout << "How many Edge does the store own? ";
cin >> numEdge;
// chart displaying the information given above
delay(500);
gotoxy(2, 8);
cout << "Video Title \t \t Cost \t # in Stock" << endl;
gotoxy(2, 9);
cout << "Guardians of the Galaxy";
gotoxy(27, 9);
cout << "$" << gPrice << endl;
gotoxy(35, 9);
cout << numGotG << endl;
gotoxy(2, 10);
cout << "X-Men" << endl;
gotoxy(27, 10);
cout << "$" << xPrice << endl;
gotoxy(35, 10);
cout << numXmen << endl;
gotoxy(2, 11);
cout << "Edge of Tomorrow" << endl;
gotoxy(27, 11);
cout << "$" << ePrice << endl;
gotoxy(35, 11);
cout << numEdge << endl;
// figure the total value
totalG = gPrice * numGotG;
totalX = xPrice * numXmen;
totalE = ePrice * numEdge;
totalValue = totalG + totalX + totalE;
// figure the average value
numTotal = numGotG + numXmen + numEdge;
avgValue = totalValue / numTotal;
// Display both the total value and average value
cout << "The total value of all dvds is: $" << totalValue << endl;
cout << "The average value is: $" << avgValue << endl;
cout << "\n \n";
system("pause");
return 0;
}