Click here to Skip to main content
15,881,852 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
line 2 [Error] 'long' invalid for 'CuttingRotation'
line 3 [Error] 'long' invalid for 'Power'
line 4 [Error] 'long' invalid for 'Machiningtime'
line 5 [Error] 'long' invalid for 'Grooving'
line 42 [Error] expected unqualified-id before '{' token
line 48 [Error] expected unqualified-id before '{' token
line 53 [Error] expected unqualified-id before '{' token


What I have tried:

C++
  1  #include <stdio.h>
  2  long float CuttingRotation(float Dm1, float n1);
  3  long float Power(float f1,float ap1,float kc1,float N1,float VC1);
  4  long float Machiningtime(float n1,float L1,float Dm1,float f1,float VC1);
  5  long float Grooving(float f1,float n1,float d1,float d2);
  6  
  7  int main() {
  8  float VC,Dm,n;
  9  float f,ap,kc,N,PC,H;
 10  float Q;
 11  float L,T;
 12  float T1,D1,D2;
 13  printf("Enter the value of diameter of workpiece(DM) and spindle speed(n):");
 14  scanf("%f %f",&Dm,&n);
 15  VC= CuttingRotation(Dm,n); //function call 1
 16  printf("\nCutting Speed:%f",VC); //gives VC
 17  printf("\nEnter the value of Feed Rate(f),Depth of cut(ap),Specific cutting force(kc) and Machine efficiency(N) one by one");
 18  scanf("%f %f %f %f",&f,&ap,&kc,&N);
 19  PC= Power(f,ap,kc,N,VC); //function call 2
 20  printf("\nNetPower Requirement: %f",PC); //gives PC
 21  H=PC/0.75;
 22  printf("\nRequired horsepower:%f",H); // gives H
 23  Q= VC*ap*f; // direct computation, function not needed
 24  printf("\nChips Discharge amount:%f",Q); //gives Q
 25  printf("\ninput machine length:");
 26  scanf("%f",&L);
 27  T=Machiningtime(n,L,Dm,f,VC); //funtion call 3
 28  printf("\nMachine Time:%f",T); //gives T
 29  printf("\nEnter Maximun diameter of work material and Minimun diameter of work material");
 30  scanf("%f %f",&D1,&D2);
 31  T1=Grooving(f,n,D1,D2); //function call 4
 32  printf("Grooving machine time:%f",T1); //gives T1
 33  
 34  return 0;
 35  }
 36  float CuttingRotation(float Dm1, float n1) //funtion defination 1
 37  { float result;
 38  result=(n1*Dm1*n1)/1000;
 39  return result;
 40  }
 41  float Power(float f1,float ap1,float kc1,float N1,float VC1); //funtion defination 2
 42  { float result;
 43  result=(VC1*f1*ap1*kc1)/(60*1000*N1);
 44  return result;
 45  }
 46  float Machiningtime(float n1,float L1,float Dm1,float f1,float VC1); //funtion defination 3
 47  { float result;
 48  result= (60*n1*L1*Dm1)/(1000*f1*VC1);
 49  return result;
 50  }
 51  float Grooving(float f1,float n1,float d1,float d2); //funtion defination 4
 52  { float result;
 53  result= (60*(d1-d2))/(2*f1*n1);
 54  return result;
 55  }
Posted
Updated 18-Jan-21 1:30am
v3

Quote:
line 2 [Error] 'long' invalid for 'CuttingRotation'
line 3 [Error] 'long' invalid for 'Power'
line 4 [Error] 'long' invalid for 'Machiningtime'
line 5 [Error] 'long' invalid for 'Grooving'

Rather easy for those.
C++
long float CuttingRotation(float Dm1, float n1);

and
C++
float CuttingRotation(float Dm1, float n1) //funtion defination 1

must match, so
C++
long float CuttingRotation(float Dm1, float n1);
 
Share this answer
 
Comments
CPallini 18-Jan-21 7:29am    
5.
There is no such type as a long float, use the double type if you need a wider range of values.

Secondly you have semi-colons at the end of your function definitions on lines 41, 46 and 51. They need to be removed.

It would also help considerably if you used proper indentation in your code.
 
Share this answer
 
Comments
CPallini 18-Jan-21 7:29am    
5.
I followed Richards suggestions and emended your code, try
C
#include <stdio.h>

double CuttingRotation(double Dm1, double n1);
double Power(double f1,double ap1,double kc1,double N1,double VC1);
double Machiningtime(double n1,double L1,double Dm1,double f1,double VC1);
double Grooving(double f1,double n1,double d1,double d2);

int main()
{
  double VC,Dm,n;
  double f,ap,kc,N,PC,H;
  double Q;
  double L,T;
  double T1,D1,D2;

  printf("Enter the value of diameter of workpiece(DM) and spindle speed(n):");
  scanf("%lf %lf",&Dm,&n);
  VC = CuttingRotation(Dm,n); //function call 1
  printf("\nCutting Speed:%lf",VC); //gives VC
  printf("\nEnter the value of Feed Rate(f),Depth of cut(ap),Specific cutting force(kc) and Machine efficiency(N) one by one");
  scanf("%lf %lf %lf %lf",&f,&ap,&kc,&N);
  PC = Power(f,ap,kc,N,VC); //function call 2
  printf("\nNetPower Requirement: %lf",PC); //gives PC
  H = PC/0.75;
  printf("\nRequired horsepower:%lf",H); // gives H
  Q= VC*ap*f; // direct computation, function not needed
  printf("\nChips Discharge amount:%lf",Q); //gives Q
  printf("\ninput machine length:");
  scanf("%lf",&L);
  T = Machiningtime(n,L,Dm,f,VC); //funtion call 3
  printf("\nMachine Time:%lf",T); //gives T
  printf("\nEnter Maximun diameter of work material and Minimun diameter of work material");
  scanf("%lf %lf",&D1,&D2);
  T1=Grooving(f,n,D1,D2); //function call 4
  printf("Grooving machine time:%lf",T1); //gives T1

  return 0;
}
double CuttingRotation(double Dm1, double n1) //funtion defination 1
{
  double result;
  result=(n1*Dm1*n1)/1000;
  return result;
}
double Power(double f1,double ap1,double kc1,double N1,double VC1) //funtion defination 2
{
  double result;
  result=(VC1*f1*ap1*kc1)/(60*1000*N1);
  return result;
}
double Machiningtime(double n1,double L1,double Dm1,double f1,double VC1) //funtion defination 3
{
  double result;
  result= (60*n1*L1*Dm1)/(1000*f1*VC1);
  return result;
}
double Grooving(double f1,double n1,double d1,double d2) //funtion defination 4
{
  double result;
  result= (60*(d1-d2))/(2*f1*n1);
  return result;
}
 
Share this answer
 
Comments
Patrice T 18-Jan-21 7:33am    
+5
CPallini 18-Jan-21 7:44am    
Thank you.
Richard MacCutchan 18-Jan-21 7:56am    
+5 for doing all the work.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900