I was wondering if anyone could help me? I'm having trouble with using a function to square values of an array. When I call the function, all I'm getting is zeros. Any help would be appreciated!
//Prompts user to enter the Peak Voltage they'd like to convert to RMS Voltage
cout << "Please enter the Peak Voltage you'd like to convert to RMS Voltage: ";
cin >> vPeak;
cout << endl;
//Loop generating voltages every 15 degrees based on Vpeak
for (int sub = 0; sub < 1; sub++)
{
for (int degree = 15; degree < 375; degree += 15)
{
arrayVoltage[sub] = vPeak * sin(degree * conversion);
cout << fixed << setprecision(3);
cout << arrayVoltage[sub] << "\t";
}cout << "\n" "\n";
}
getVrms(arrayVoltage);
system("pause");
return 0;
}//End of main functoin