diff --git a/ChemAcidBaseCalculator.dev b/ChemAcidBaseCalculator.dev index c635e56..abb558c 100644 --- a/ChemAcidBaseCalculator.dev +++ b/ChemAcidBaseCalculator.dev @@ -19,7 +19,7 @@ ObjectOutput= LogOutput= LogOutputEnabled=0 OverrideOutput=0 -OverrideOutputName= +OverrideOutputName=ChemAcidBaseCalculator.exe HostApplication= UseCustomMakefile=0 CustomMakefile= @@ -28,7 +28,7 @@ Folders= IncludeVersionInfo=0 SupportXPThemes=0 CompilerSet=0 -CompilerSettings=0000000000000000000000000 +CompilerSettings=000000d000000000000001000 UnitCount=1 [VersionInfo] @@ -39,14 +39,14 @@ Build=0 LanguageID=1033 CharsetID=1252 CompanyName= -FileVersion= +FileVersion=1.0.0.0 FileDescription=Developed using the Dev-C++ IDE InternalName= LegalCopyright= LegalTrademarks= OriginalFilename= ProductName= -ProductVersion= +ProductVersion=1.0.0.0 AutoIncBuildNr=0 SyncProduct=1 diff --git a/ChemAcidBaseCalculator.exe b/ChemAcidBaseCalculator.exe index f842a0d..50081a1 100644 Binary files a/ChemAcidBaseCalculator.exe and b/ChemAcidBaseCalculator.exe differ diff --git a/ChemAcidBaseCalculator.layout b/ChemAcidBaseCalculator.layout index 08d1c4f..3d83cf0 100644 --- a/ChemAcidBaseCalculator.layout +++ b/ChemAcidBaseCalculator.layout @@ -2,7 +2,7 @@ Order=0 Focused=0 [Editor_0] -CursorCol=34 -CursorRow=82 -TopLine=40 +CursorCol=1 +CursorRow=4 +TopLine=1 LeftChar=1 diff --git a/Makefile.win b/Makefile.win index 91e3783..54b7276 100644 --- a/Makefile.win +++ b/Makefile.win @@ -6,12 +6,12 @@ CC = gcc.exe WINDRES = windres.exe OBJ = main.o LINKOBJ = main.o -LIBS = -L"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib" -L"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib" -static-libgcc +LIBS = -L"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib" -L"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib" -static-libgcc -s INCS = -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include" CXXINCS = -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include/c++" BIN = ChemAcidBaseCalculator.exe -CXXFLAGS = $(CXXINCS) -CFLAGS = $(INCS) +CXXFLAGS = $(CXXINCS) -Os +CFLAGS = $(INCS) -Os RM = rm.exe -f .PHONY: all all-before all-after clean clean-custom diff --git a/main.cpp b/main.cpp index cbf5e1d..b85ee47 100644 --- a/main.cpp +++ b/main.cpp @@ -1,85 +1,56 @@ #include -#include -#include -#include -#include #include -#include #include -#include -#include - -using namespace std; int main() { - cout << "Choose Start point..." << '\n'; - cout << "1. [H+]\n2. [OH-]\n3. pH\n4. pOH\n"; + printf("Choose Start point...\n"); + printf("1. [H+]\n2. [OH-]\n3. pH\n4. pOH\n"); int choice; - cin >> choice; + scanf("%d",&choice); system ("cls"); switch(choice) { case 1: - cout << "Convert [H+] to Scientific Notation of A*10^B and input A,B\n"; - system ("pause"); - cout << '\n'; + printf("Convert [H+] to Scientific Notation of A*10^B and input A,B\n"); double A,B; - cout << "A:"; - cin >> A; - cout << '\n'; - cout << "B:"; - cin >> B; - cout << '\n'; - cout << "[H+]=" << A*pow(10,B) << '\n'; - cout << "[OH-]=" << (1/A)*pow(10,((-14)-B)) << '\n'; - cout << "[pH]=" << (-log10(A)-B) << '\n'; - cout << "[pOH]=" << 14-(-log10(A)-B) << '\n'; + scanf("%le,%le",&A,&B); + printf("\n"); + printf("[H+]=%le\n",A*pow(10,B)); + printf("[OH-]=%le\n",(1/A)*pow(10,((-14)-B))); + printf("[pH]=%le\n",(-log10(A)-B)); + printf("[pOH]=%le\n",14-(-log10(A)-B)); break; case 2: - cout << "Convert [OH-] to Scientific Notation of Z*10^Y and input Z,Y\n"; - system ("pause"); - cout << '\n'; + printf("Convert [OH-] to Scientific Notation of Z*10^Y and input Z,Y\n"); double Z,Y; - cout << "Z:"; - cin >> Z; - cout << '\n'; - cout << "Y:"; - cin >> Y; - cout << '\n'; - cout << "[H+]=" << (1/Z)*pow(10,((-14)-Y)) << '\n'; - cout << "[OH-]=" << Z*pow(10,Y) << '\n'; - cout << "[pH]=" << 14-(-log10(Z)-Y) << '\n'; - cout << "[pOH]=" << (-log10(Z)-Y) << '\n'; + scanf("%le,%le",&Z,&Y); + printf("\n"); + printf("[H+]=%le\n",(1/Z)*pow(10,((-14)-Y))); + printf("[OH-]=%le\n",Z*pow(10,Y)); + printf("[pH]=%le\n",14-(-log10(Z)-Y)); + printf("[pOH]=%le\n",(-log10(Z)-Y)); break; case 3: - cout << "Input pH as X\n"; - system ("pause"); - cout << '\n'; - double X; - cout << "X:"; - cin >> X; - double W; + printf("Input pH as X\n"); + double X,W; + scanf("%le",&X); W = -X; - cout << '\n'; - cout << "[H+]=" << pow(10,W) << '\n'; - cout << "[OH-]=" << pow(10,X-14) << '\n'; - cout << "[pH]=" << X << '\n'; - cout << "[pOH]=" << 14-X << '\n'; + printf("\n"); + printf("[H+]=%le\n",pow(10,W)); + printf("[OH-]=%le\n",pow(10,X-14)); + printf("[pH]=%le\n",X); + printf("[pOH]=%le\n",14-X); break; case 4: - cout << "Input pOH as V\n"; - system ("pause"); - cout << '\n'; - double V; - cout << "V:"; - cin >> V; - double U; + printf("Input pOH as V\n"); + double V,U; + scanf("%le",&V); U = -V; - cout << '\n'; - cout << "[H+]=" << pow(10,V-14) << '\n'; - cout << "[OH-]=" << pow(10,U) << '\n'; - cout << "[pH]=" << 14-V << '\n'; - cout << "[pOH]=" << V << '\n'; + printf("\n"); + printf("[H+]=%le\n",pow(10,V-14)); + printf("[OH-]=%le\n",pow(10,U)); + printf("[pH]=%le\n",14-V); + printf("[pOH]=%le\n",V); break; } system("pause"); diff --git a/main.o b/main.o index 6ac1063..9b94152 100644 Binary files a/main.o and b/main.o differ