# Pset3 Music frequency returns all 440

My frequency function returns all 440. Been researching and trying possible solutions (turn ints to floats, round, power, etc) but still does it. What am I doing wrong? Thank you!

int frequency(string note)
{
double f;
float n; // number of semitones from note to A4
// first get the number of semitones particular note is from A440
// parse note into string
int fullNote = strlen(note);
int LetterNote = note[0];
int octave = note[fullNote - 1] - '0';

switch (LetterNote){

case 'A':
n = 0.0;
break;

case 'B':
n = 2.0;
break;

case 'C':
n = -9.0;
break;

case 'D':
n = -7.0;
break;

case 'E':
n = -5.0;
break;

case 'F':
n = -4.0;
break;

case 'G':
n = -2.0;
break;

default:
return 0;
}

// if note has an accidental calculate either one semitone down or up
if (fullNote == 3)

if (note[1] == 'b')
{
n = n - 1.0;
}

if (note[1] == '#')
{
n = n + 1.0;
}

// calculate octave
if (octave < 8 && octave > 0)
{
n = n + ((octave - 4.0) * 12.0);
}
if (octave > 8 || octave < 0)
{
return 0;
}

// calculate frequency with correct number of semitones

f = round(pow(2.0, (n/12.0))) * 440.00;
return f;
}