0

i thoguht i had this working and someones done something and its now no longer working, i couldnt workout what was changed.

#include <iostream>
using namespace std;


int main ()
{
    Double annSal, mthSal, nAnnSal, nMthSal, pcent, numBkPyMths, bkPy;
    
    pcent = 0.065;
    numBkPyMths = 5;
    annSal = 0;
    nAnnSal = 0;
    nMthsal = 0;
    
    cout << "Congratulations! You had a " << pcent * 100 << "% pay rise retroactve for five months.\n";
    cout << "I’ll calculate your backpay and new salary.\n";
    cout << "What is your current annual salary? "
    cin >> annSal;
    mthSal = annSal / 12;
    bkPy = numBkPyMths * mthSal * pcent;
    cout << "\nYour backpay is: " << bkPy << endl;
    nAnnSal = annSal * (pcent + 1);
    nMthSal = nAnnSal / 12;
    cout << "Your new annual salary is: " << nAnnSal << endl;
    cout << 'Your new monthly salary is: " << nMthSal << endl;
    
    return 0;
}

das my code
cheers :)

2
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by Slavrix
0

> cout << 'Your new monthly salary is: " << nMthSal << endl;
Well this line should use double quote at the beginning, not single.

0

didnt see that, but it didnt fix it


for some reason the error doesnt like me using Double to declare my variables, its sayig "Double undeclared (first use of variable)

0

ok i got it, effing pos

Double it dont like, it wanted double


i missed a ; on line 17

and typed a variable wrong on line 13


ok all fixed :) cheers :P

This question has already been answered. Start a new discussion instead.
Be sure to adhere to our posting rules.