hey guys am new in c++.ihve been worrking around de clock to get my class to work..to simply calculate voltage using classes but keep getting error "request for member which is a non type float" i dont knw wat am doing wrong please help.......... ihve included all my 3 separate files. the last lines are the 4 errors
my voltage.h file
[#ifndef VOLTAGE_H
#define VOLTAGE_H
class Voltage
{
public:
// default consructor
Voltage();
//overload consructor
Voltage(int,int);
int Voltage::calculateVoltage() const
{
return newCurrent*newResistor;
}]
errors
[C:\Users\rofhiwa.eskom\Desktop\Cpp Folder\eee\main.cpp||In function 'int main()':|
C:\Users\rofhiwa.eskom\Desktop\Cpp Folder\eee\main.cpp|22|error: expected ';' before 'polts'|
C:\Users\rofhiwa.eskom\Desktop\Cpp Folder\eee\main.cpp|22|warning: statement has no effect [-Wunused-value]|
C:\Users\rofhiwa.eskom\Desktop\Cpp Folder\eee\main.cpp|24|error: request for member 'setResistor' in 'polts', which is of non-class type 'float'|
C:\Users\rofhiwa.eskom\Desktop\Cpp Folder\eee\main.cpp|25|error: request for member 'setCurrent' in 'polts', which is of non-class type 'float'|
C:\Users\rofhiwa.eskom\Desktop\Cpp Folder\eee\main.cpp|27|error: request for member 'calculateVoltage' in 'polts', which is of non-class type 'float'|
||=== Build finished: 4 errors, 1 warnings (0 minutes, 0 seconds) ===|
][/output]
sori still dnt get coz polts is my object and when i remove my declaration of float polts it says polts was not declared....am i creating my object in a wrong way maybe