Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tavisca-ragupta
Copy link

public class FixMultiplication
{

public static int isMissing(int t,int T)

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)

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;

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)

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)

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)

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;

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]);

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants