i know im should not ask for help for little things like this but i need help heres my code!
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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
|
#include "stdafx.h"
#include <iostream>
#include <cmath>
#include <string>
void skipline(),options(),input();
using namespace std;
int main()
{
int ans;
int cal;
float number,number2;
cout << "Log in\n";
skipline();
cout << "Password:";
std::string In_Buffer;
std::getline( std::cin, In_Buffer, '\n' );
if( In_Buffer.compare( "admin" ) == 0 )
{
skipline();
system("CLS");
cout << "Welcome!\n";
skipline();
}
options();
skipline();
input();
cin >> ans;
if(ans==1)
{
system("CLS");
cout << "Calculator\n";
skipline();
cout << "1.Addition" << endl;
skipline();
cout << "2.Subtraction" << endl;
skipline();
cout << "3.Multtply" << endl;
skipline();
cout << "4.Division" << endl;
skipline();
cout << "5.Square root" << endl;
skipline();
cout << "6.End program" << endl;
input();
cin.get();
cin >> cal;
if(cal==1)
{
skipline();
cout << "Addition";
skipline();
skipline();
cout << "Enter first number:";
cin >> number;
skipline();
cout << "Enter secound number:";
cin >> number2;
skipline();
cout << "Answer:"<< number + number2;
skipline();
}
if(cal==2)
{
skipline();
cout << "subtraction\n";
skipline();
cout << "Enter first number:";
cin >> number;
skipline();
cout << "Enter secound number:";
cin >> number2;
skipline();
cout << "Answer:"<< number - number2;
cin.get();
}
if(cal==3)
{
skipline();
cout << "multiplying\n";
skipline();
cout << "Enter first number:";
cin >> number;
skipline();
cout << "Enter secound number:";
cin >> number2;
skipline();
skipline();
cout << "Answer:" << number * number2;
skipline();
cin.get();
}
if(cal == 4)
{
skipline();
cout << "Division";
skipline();
skipline();
cout << "Enter First number:";
cin >> number;
skipline();
cout << "Enter secound number:";
cin >> number2;
skipline();
cout << "Answer:"<< number / number2;
skipline();
cin.get();
}
if(cal == 5)
{
skipline();
cout << "Enter number:";
cin >> number;
skipline();
cout << "Answer:" << sqrt(number); /*finds the square root of said number =)*/
cin.get();
}
if(ans == 6) /*if /person inputs 6 exit program*/
{
return 0;
}
if(cal > 6) /*if person enters a number larger than 6 out put error message*/
{
cout << "ERROR";
}
}
}
cin.get();
}
void skipline()
{
cout << "\n";
}
void options()
{
cout << "1.Calculator";
skipline();
cout << "2.Web Browser";
skipline();
cout << "3.Hack Tools";
skipline();
cout << "4.Exit";
}
void input()
{
cout << ":";
}
|
error code
------ Build started: Project: latest practice review, Configuration: Debug Win32 ------
latest practice review.cpp
latest practice review.cpp(173): error C2143: syntax error : missing ';' before '.'
latest practice review.cpp(173): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
latest practice review.cpp(174): error C2059: syntax error : '}'
latest practice review.cpp(174): error C2143: syntax error : missing ';' before '}'
latest practice review.cpp(174): error C2059: syntax error : '}'
latest practice review.cpp(177): error C2143: syntax error : missing ';' before '{'
latest practice review.cpp(177): error C2447: '{' : missing function header (old-style formal list?)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========