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 :)

Recommended Answers

All 3 Replies

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

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)

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.