C++ Caculator :P

Started by TheCatArtist, 2012 Sep 26, 15:40:51

previous topic - next topic

0 Members and 1 Guest are viewing this topic.

Go Down

TheCatArtist

Hello guys!. This is my unfinished caculator. That i will release when its done. Looking for a backround pony design.
But here is the code.


Code Select
#include "stdafx.h"


#include <iostream>

using namespace std;

int main()
{
cout << "Here is a number you have to guess!";
cout << endl;
cout << "Here is a number:" ;
cout << 10 ;
cout << endl;

cout << "How much is 6 * 6? Answer" ;
cout << endl;
cout << 6 * 6;
cin.get();



return 0;

}

Book Smarts

Interesting, I've never touched C ++ , but I have used basic Java programming and some of the code looks familiar. Makes sense in a way   ^-^

Good luck, and don't divide by 0

Lord of Madness

now imma have to look into this... lol

The Wandering Magus

interesting... although I'm not quite sure how it's a "calculator" x3  Looks kind of like it just continuously prints lines without much input necessary.

You should try PMing the dev team; you might be able to join in if you have enough experience ^-^
(sorry Bakasan, chose this image)
Descriptions and art of my OCs here: http://legendsofequestria.com/forum/index.php?topic=2636
my art: http://legendsofequestria.com/forum/index.php?topic=298
visiting soldier sister, be back 8/12/2013

ajf

Hey... when I was maybe 8 or 9 years old (a little colt! :P) I made this:

http://ajf.me/archive/MATHS.EXE

It was a primitive calculator made in Delphi 1 for Windows (3.x!), using vertical progress bars for "liquid containers". :)

If you're too scared to download some arbitrary 16-bit exe, or you're on 64-bit windows, or whatever, here's a screenie from it running under Wine:


LaptopCommandStation

I can't access the code for my projects because VB6 isn't compatible with windows 7  >A< (Yeah, I know, a MICROSOFT program MICROSOFT'S OS doesn't support......)  So idk how many lines of code my retail calculator is nor can I post it atm(still looking for a laptop)
but here's a screenshot of the interface
sigh, why does avast think all my programs are viruses?

ajf

Quote from: LaptopCommandStation on 2012 Oct 10, 15:21:09
I can't access the code for my projects because VB6 isn't compatible with windows 7  >A< (Yeah, I know, a MICROSOFT program MICROSOFT'S OS doesn't support......)
to be fair MS killed off VB6 quite a while ago...

LaptopCommandStation

Well too bad MS, i'm still using it  :P

That was why I switched from 7 back to XP
Twice

LaptopCommandStation

I was able to access my code.  only took a week.  Very basic, as you'll see  X3
This pales in comparison to my other program.  I'm not posting the code for that baby.  My calculator is 40kb.  My main program is 7 MB....
Spoiler: show
Code Select
Option Explicit
Dim GPconv As String
Dim lbpriceconv As Integer
Dim kgpriceconv As Integer
Dim hundgpriceconv As Integer
Dim gramconv As Integer
Dim kgconv As Integer
Dim lbconv As Integer
Dim ozconv As Integer
Dim Cconv As Integer
Dim Fconv As Integer
Dim cost As Integer
Dim ret As Integer
Dim response As String


Private Sub Command1_Click()
' This is the GP calculator

cost = Text1.Text
ret = Text2.Text

GPconv = (ret - cost) / ret * 100
Text3.Text = GPconv

End Sub

Private Sub Command10_Click()
' This is the Fahrenheit unit convertor
Dim FtoC As String
Dim Fto As String

Fto = Text18.Text

FtoC = (Fto - 32) * (5 / 9)
Text24.Text = FtoC
End Sub

Private Sub Command11_Click()
' Exit Button

response = MsgBox("Do you wish to exit?", vbYesNo, "Exit?")
If response = vbYes Then
End
End If

End Sub

Private Sub Command2_Click()
' This is the lb to convertor
Dim lbconvkg As String
Dim lbconv100g As String
Dim lbamount As String

lbamount = Text4.Text

lbconvkg = (lbamount * 2.2046)
lbconv100g = (lbamount * 22.046)
Text7.Text = lbconvkg
Text8.Text = lbconv100g

End Sub

Private Sub Command3_Click()
' This is the kg to convertor
Dim kgconvlb As String
Dim kgconv100g As String
Dim kgamount As String

kgamount = Text5.Text

kgconvlb = (kgamount * 0.454)
kgconv100g = (kgamount * 10)
Text9.Text = kgconvlb
Text10.Text = kgconv100g
End Sub

Private Sub Command4_Click()
' This is the 100g to convertor
Dim gconvlb As String
Dim gconvkg As String
Dim gamount As String

gamount = Text6.Text

gconvlb = (gamount * 0.0454)
gconvkg = (gamount * 0.1)
Text11.Text = gconvlb
Text12.Text = gconvkg
End Sub

Private Sub Command5_Click()
' This is the gram unit convertor
Dim gtolb As String
Dim gtokg As String
Dim gtooz As String
Dim gto As String

gto = Text13.Text

gtolb = (gto * 0.002205)
gtokg = (gto * 0.001)
gtooz = (gto * 0.035274)
Text25.Text = gtolb
Text19.Text = gtokg
Text29.Text = gtooz
End Sub

Private Sub Command6_Click()
' This is the kilogram unit convertor
Dim kgtolb As String
Dim kgtog As String
Dim kgtooz As String
Dim kgto As String

kgto = Text14.Text

kgtolb = (kgto * 2.205)
kgtog = (kgto * 1000)
kgtooz = (kgto * 35.274)
Text26.Text = kgtolb
Text20.Text = kgtog
Text30.Text = kgtooz
End Sub

Private Sub Command7_Click()
' This is the pound unit convertor
Dim lbtokg As String
Dim lbtog As String
Dim lbtooz As String
Dim lbto As String

lbto = Text15.Text

lbtokg = (lbto * 0.454)
lbtog = (lbto * 454)
lbtooz = (lbto * 16)
Text27.Text = lbtokg
Text21.Text = lbtog
Text31.Text = lbtooz
End Sub

Private Sub Command8_Click()
' This is the ounce unit convertor
Dim oztokg As String
Dim oztog As String
Dim oztolb As String
Dim ozto As String

ozto = Text16.Text

oztokg = (ozto * 0.02835)
oztog = (ozto * 28.34952)
oztolb = (ozto * 0.0625)
Text22.Text = oztog
Text28.Text = oztokg
Text32.Text = oztolb
End Sub

Private Sub Command9_Click()
' This is the Celcius unit convertor
Dim CtoF As String
Dim Cto As String

Cto = Text17.Text

CtoF = (9 / 5) * Cto + 32
Text23.Text = CtoF
End Sub

Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
Text16.Text = ""
Text17.Text = ""
Text18.Text = ""
Text19.Text = ""
Text20.Text = ""
Text21.Text = ""
Text22.Text = ""
Text23.Text = ""
Text24.Text = ""
Text25.Text = ""
Text26.Text = ""
Text27.Text = ""
Text28.Text = ""
Text29.Text = ""
Text30.Text = ""
Text31.Text = ""
Text32.Text = ""
End Sub

Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)

If KeyCode = vbKeyReturn Then
Call Command1_Click
End If

End Sub

Private Sub Text4_KeyDown(KeyCode As Integer, Shift As Integer)

If KeyCode = vbKeyReturn Then
Call Command2_Click
End If

End Sub

Private Sub Text5_KeyDown(KeyCode As Integer, Shift As Integer)

If KeyCode = vbKeyReturn Then
Call Command3_Click
End If

End Sub
Private Sub Text6_KeyDown(KeyCode As Integer, Shift As Integer)

If KeyCode = vbKeyReturn Then
Call Command4_Click
End If

End Sub
Private Sub Text13_KeyDown(KeyCode As Integer, Shift As Integer)

If KeyCode = vbKeyReturn Then
Call Command5_Click
End If

End Sub

Private Sub Text14_KeyDown(KeyCode As Integer, Shift As Integer)

If KeyCode = vbKeyReturn Then
Call Command6_Click
End If

End Sub
Private Sub Text15_KeyDown(KeyCode As Integer, Shift As Integer)

If KeyCode = vbKeyReturn Then
Call Command7_Click
End If

End Sub
Private Sub Text16_KeyDown(KeyCode As Integer, Shift As Integer)

If KeyCode = vbKeyReturn Then
Call Command8_Click
End If

End Sub
Private Sub Text17_KeyDown(KeyCode As Integer, Shift As Integer)

If KeyCode = vbKeyReturn Then
Call Command9_Click
End If

End Sub
Private Sub Text18_KeyDown(KeyCode As Integer, Shift As Integer)

If KeyCode = vbKeyReturn Then
Call Command10_Click
End If

End Sub

Go Up