|
-
March 14th, 2018, 08:18 PM
#1
[RESOLVED] Round Up/Down Function? I'm looking to build a program that solves basic equations?
I know a little bit of Objective-C and I'm not too familiar with the differences between C++ and Obj. C I'm looking for a solution to a business need that I have. I'm looking to create a C++ program on my Windows computer to solve a few simple equations, one after the other. I don't know where to start or if using Python would be better suited for this problem.
Problem: I want to be able to open up the application on my computer and then be prompted to enter a value for 2 different variables (these values will be called x and p). I then need the program to run through a set of equations (6 in total). I then need the program to return the value of 3 different variables (we'll call them: c, g and h). A big issue I'm finding, is that I need to round up/down a couple of variables for the other equations to work, yet I don't know what function I need to use to make this happen. Here is a breakdown of how it should go:
Prompt-
Please enter the Buy Price:
1. 1000/x = t
2. t (rounded to the nearest one) = c (this value to display as the result)
3. c(x) = f
4. (p + f) / c = k
5. k (rounded to the nearest hundredth) = g (this value to display as the result)
6. g(c) - f = h (this value to display as the result)
--Translated----
Prompt-
Please enter the Buy Price: 30
1. 1,000/30 = 33.33333333333333
2. 33.33333333333333 = 33
3. 33(30) = 990
4. (140 + 990) / 33 = k
(1,130) / 33 = 34.24242424242424
5. 34.24242424242424 = 34.24
6. 34.24(33) - 990 = 139.92
Result:
Contracts: 33
Sell Price: $34.24
Gross Profit: $139.92
--------------------------------------------------
Has anyone ever worked with a website or program builder that can easily go through these set of equations? Or can anyone tell me how to use the round up/down function in C++? Also how would I go about carrying the value of a variable over to the next equation in order to solve it?
Much appreciated!
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|