-
Notifications
You must be signed in to change notification settings - Fork 1
/
_CPP_FUN__Discount_Calc.cpp
44 lines (32 loc) · 1.21 KB
/
_CPP_FUN__Discount_Calc.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
// Discount Calculator!
//
// NAME: discountcalc.cpp
// VERSION: 0.0.0
// AUTHOR: Jesse Leverett (CyberThulhu)
// STATUS: Work In Progress
// DESCRIPTION: Basic Program that Finds Discount Price
// TO-DO: Build Initial Code Framework
// USAGE: discountcalc.exe
// COPYRIGHT © 2021 Jesse Leverett
#include <iostream>
#include <string>
using namespace std;
/* Fun finding Discount Prices */
int main() {
string message; // Initialize message Variable
message = "What is the Non-Discounted Price of the Item?";
std::cout << message << std::endl;
int itemPrice; // Initialize itemPrice Variable
std::cin >> itemPrice; // Get Value for itemPrice Variable
message = "What is the Discount Percentage (Number Only)?";
std::cout << message << std:: endl;
float discPercent; // Initialize discPercent Variable
std::cin >> discPercent; // Get Value for discPercent Variable
// Calculate the Percentage to Subtract
float percentage = (itemPrice * discPercent) / 100;
// Calculate Discounted Price
float discPrice = itemPrice - percentage;
message = "Discounted Price: ";
std::cout << message << discPrice << std::endl;
return 0;
}