diff options
Diffstat (limited to 'hw2/convertCurrency.cpp')
-rw-r--r-- | hw2/convertCurrency.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/hw2/convertCurrency.cpp b/hw2/convertCurrency.cpp new file mode 100644 index 0000000..1d19136 --- /dev/null +++ b/hw2/convertCurrency.cpp @@ -0,0 +1,20 @@ +// CSCI 1300 Fall 2022
+// Author: Navan Chauhan
+// Recitation: 307 – TA name
+// Homework 2 - Problem 5
+
+#include<iostream>
+
+using namespace std;
+
+int main() {
+ int gems = 0, gold = 0, bolts = 0;
+ cout << "Enter the number of Bolts:\n";
+ cin >> bolts;
+ gold = bolts/23;
+ bolts = bolts % 23;
+ gems = gold / 13;
+ gold = gold % 13;
+ cout << gems << " Gem(s) " << gold << " GoldCoin(s) " << bolts << " Bolt(s)";
+ return 0;
+}
\ No newline at end of file |