-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
54 lines (49 loc) · 1.19 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include <iostream>
#include <Windows.h>
#include <cstdlib>
#include "protonon.h"
#include "ion.h"
#include "stable.h"
#include "Mass.h"
void Color(int color) {
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), color);
}
void input() {
int input;
//first place is proton second is electron third is neutron
int atomList[] = { 0, 0, 0 };
std::cout << "protons:" << std::endl;
std::cin >> input;
atomList[0] = input;
std::cout << "electrons:" << std::endl;
std::cin >> input;
atomList[1] = input;
std::cout << "neutrons:" << std::endl;
std::cin >> input;
atomList[2] = input;
setElementName(atomList[0]);
ionFinder(atomList);
checkStability(atomList);
calMass(atomList);
}
void backEnd() {
input();
Color(6);
std::cout << "\n";
std::cout << "\n";
std::cout << "atom name: " << atom << std::endl;
if (ion == "Neutral Atom") {
std::cout << ion << std::endl;
}
else {
std::cout << ion << " ion" << std::endl;
}
std::cout << Stability << "\n";
std::cout << "mass:" << massReal << "\n";
std::cout << "weight: " << weight << "(kg) \n";
Color(7);
}
int main() {
backEnd();
system("pause");
}