From c790cb06242c72a10e2e01036b9de7cc37088763 Mon Sep 17 00:00:00 2001 From: JacobAKnox <91796123+JacobAKnox@users.noreply.github.com> Date: Sat, 23 Oct 2021 09:53:44 -0700 Subject: 8a and 8b --- 8a/8aCode/8aCode.cpp | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 8a/8aCode/8aCode.cpp (limited to '8a/8aCode/8aCode.cpp') diff --git a/8a/8aCode/8aCode.cpp b/8a/8aCode/8aCode.cpp new file mode 100644 index 0000000..e876c71 --- /dev/null +++ b/8a/8aCode/8aCode.cpp @@ -0,0 +1,38 @@ +// 8aCode.cpp : This file contains the 'main' function. Program execution begins and ends there. +// + +#include +using namespace std; + +void readValues(int& a, int& b); +double divideValues(int a, int b); + +int main() +{ + int a, b; + double out; + + readValues(a, b); + out = divideValues(a, b); + + cout << "The double value of " << a << "/" << b << " is: " << out << "."; +} + + +void readValues(int& a, int& b) +{ + cout << "Input the first int: "; + cin >> a; + cout << "\nInput the second int: "; + cin >> b; + cout << "\n\n"; + return; +} + +double divideValues(int a, int b) +{ + double value; + + value = (double)a / (double)b; + return value; +} \ No newline at end of file -- cgit v1.2.3