-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Solution of first problem #86
base: master
Are you sure you want to change the base?
Conversation
public class FixMultiplication | ||
{ | ||
|
||
public static int isMissing(int t,int T) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method name should always follow Pascal Casing
public class FixMultiplication | ||
{ | ||
|
||
public static int isMissing(int t,int T) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method should be private, as the scope is within the class and outside.
public static int isMissing(int t,int T) | ||
{ | ||
int count=0; | ||
int missing_digit = -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to write code with proper formatting. This will make it more readable.
missing_digit = -1; | ||
return missing_digit; | ||
} | ||
int FindDigit(string inp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method should be public, as it is being accessed from Program.cs
Also, invoke this method from the Main method in Program.cs file.
missing_digit = -1; | ||
return missing_digit; | ||
} | ||
int FindDigit(string inp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Name of the parameter should be equation
} | ||
return -1; | ||
} | ||
public static void Main(String[] args) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This main method is part of Program.cs. Remove from here
} | ||
int FindDigit(string inp) | ||
{ | ||
int t=0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use the proper name of variables, instead of alphabets
string[] inp2 = inp1[0].Split('*'); | ||
int A = Convert.ToInt32(inp2[0]); | ||
int B = Convert.ToInt32(inp2[1]); | ||
int C = Convert.ToInt32(inp1[1]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code will break, as all inputs are not valid integers.
@tavisca-njain