Moving project to folder and making methods public
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.5.2.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BasicProgramming", "BasicProgramming.csproj", "{F852DB4D-952E-CFAF-DFC6-298FB48C8A28}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BasicProgramming", "BasicProgramming\BasicProgramming.csproj", "{F852DB4D-952E-CFAF-DFC6-298FB48C8A28}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace BasicProgramming
|
||||
{
|
||||
internal class Program
|
||||
public class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
@@ -41,12 +41,12 @@ namespace BasicProgramming
|
||||
Console.WriteLine($"IfYearIsLeap(2018): {IfYearIsLeap(2018)}");
|
||||
}
|
||||
|
||||
static int AddAndMultiply(int a, int b, int c)
|
||||
public static int AddAndMultiply(int a, int b, int c)
|
||||
{
|
||||
return (a + b) * c;
|
||||
}
|
||||
|
||||
static string CtoF(int celcius)
|
||||
public static string CtoF(int celcius)
|
||||
{
|
||||
if (celcius <= -271.15)
|
||||
return "Temperature below absolute zero!";
|
||||
@@ -56,7 +56,7 @@ namespace BasicProgramming
|
||||
return $"T = {fahrenheit}F";
|
||||
}
|
||||
|
||||
static List<double> ElementaryOperations(double a, double b)
|
||||
public static List<double> ElementaryOperations(double a, double b)
|
||||
{
|
||||
List<double> retval = [a + b, a - b, a * b];
|
||||
if (a > 0 && b > 0)
|
||||
@@ -65,32 +65,32 @@ namespace BasicProgramming
|
||||
return retval;
|
||||
}
|
||||
|
||||
static bool IsResultTheSame(double a, double b)
|
||||
public static bool IsResultTheSame(double a, double b)
|
||||
{
|
||||
return a == b;
|
||||
}
|
||||
|
||||
static int ModuloOperations(int a, int b, int c)
|
||||
public static int ModuloOperations(int a, int b, int c)
|
||||
{
|
||||
return (a % b) % c;
|
||||
}
|
||||
|
||||
static double CubeOf(double a)
|
||||
public static double CubeOf(double a)
|
||||
{
|
||||
return a * a * a;
|
||||
}
|
||||
|
||||
static List<int> SwapTwoNumbers(int a, int b)
|
||||
public static List<int> SwapTwoNumbers(int a, int b)
|
||||
{
|
||||
return [b, a];
|
||||
}
|
||||
|
||||
static int AbsoluteValue(int a)
|
||||
public static int AbsoluteValue(int a)
|
||||
{
|
||||
return Math.Abs(a);
|
||||
}
|
||||
|
||||
static int DivisibleBy2Or3(int a, int b)
|
||||
public static int DivisibleBy2Or3(int a, int b)
|
||||
{
|
||||
if (_DivisibleBy2Or3(a) && _DivisibleBy2Or3(b))
|
||||
{
|
||||
@@ -106,12 +106,12 @@ namespace BasicProgramming
|
||||
return a + b;
|
||||
}
|
||||
|
||||
static bool IfConsistsOfUppercaseLetters(string str)
|
||||
public static bool IfConsistsOfUppercaseLetters(string str)
|
||||
{
|
||||
return str.Equals(Regex.Match(str, "[A-ZÆØÅ]+").Value);
|
||||
}
|
||||
|
||||
static bool IfGreaterThanThirdOne(List<int> ints)
|
||||
public static bool IfGreaterThanThirdOne(List<int> ints)
|
||||
{
|
||||
if (ints.Count < 3)
|
||||
{
|
||||
@@ -121,12 +121,12 @@ namespace BasicProgramming
|
||||
return (ints[0] * ints[1]) > ints[2];
|
||||
}
|
||||
|
||||
static bool IfNumberIsEven(int a)
|
||||
public static bool IfNumberIsEven(int a)
|
||||
{
|
||||
return a % 2 == 0;
|
||||
}
|
||||
|
||||
static bool IfSortedAscending(List<int> ints)
|
||||
public static bool IfSortedAscending(List<int> ints)
|
||||
{
|
||||
int lastNumber = 0;
|
||||
bool retval = true;
|
||||
@@ -146,7 +146,7 @@ namespace BasicProgramming
|
||||
return retval;
|
||||
}
|
||||
|
||||
static string PositiveNegativeOrZero(double a)
|
||||
public static string PositiveNegativeOrZero(double a)
|
||||
{
|
||||
switch (a)
|
||||
{
|
||||
@@ -159,7 +159,7 @@ namespace BasicProgramming
|
||||
}
|
||||
}
|
||||
|
||||
static bool IfYearIsLeap(int year)
|
||||
public static bool IfYearIsLeap(int year)
|
||||
{
|
||||
return DateTime.IsLeapYear(year);
|
||||
}
|
||||
Reference in New Issue
Block a user