I received some help with my code earlier. I just have one more problem the error I get is line: 77 col: 10 Sel: 0 Lines: 80 Length: 1078 insert Done parsing in 0.36 seconds Here is
1 2 3 4 5 6
|
my code.
//Eric Gilliam
// CS104
// 4-13-2016
#include <iostream>
|
using namespace std;
int myArray [] = {11, 9, 63, 27, 85};// my Array
int n, result=0;
int addition (int a, int b)
{
int r;
r=a+b;
return r;
}
int main(){
int t;
switch (t) {
case 1:
case 2:
case 3:
cout << "t is 1, 2 or 3";
break;
default:
cout << "t is not 1, 2 nor 3";
break;
}
{
for ( n=0 ; n<5 ; ++n )
{
result += myArray[n];
}
int z;
z = addition (5,3);
cout << "The result is " << z;
double den, num, result;
char op;
do{
cout << "\nCalculator - Please enter a number :";
cin >> num;
cout << "Please enter a what kind of math +, -, *, /";
cin >> op;
cout << "Please enter second number :";
cin >> den;
if (op=='+') result=num+den;
// How the calculator calculates
if (op=='-') result=num-den;
if (op=='*') result=num*den;
if (op=='/') result=num/den;
cout<< result;
}
while (op!='e');
cout<<"HELLO WORLD MY NAME IS ERIC! "<< endl;
return 0;
}