Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Build Artifacts
bin/
obj/
*.dll
*.exe
*.pdb

# Visual Studio / .NET specific
*.suo
*.user
*.sln.docstates
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
build/
bld/
[Bb]in/
[Oo]bj/

# NuGet Packages
*.nupkg
**/packages/*
!**/packages/build/

# Other
.vs/
*.log
40 changes: 39 additions & 1 deletion BusinessApp/Mathoperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,75 @@ public class DoMath
{
public void Area(){
{
Console.ForegroundColor = ConsoleColor.Green;
Console.Write("Enter Radius: ");
Console.ResetColor();
double rad = Convert.ToDouble(Console.ReadLine());
double area = Math.PI * rad * rad;
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("Area of circle is: " + area);
Console.ResetColor();

Console.ForegroundColor = ConsoleColor.DarkGray;
Console.WriteLine("Press Enter to continue...");
Console.ResetColor();
Console.ReadLine();
}
}

public void CheckLeap()
{
Console.ForegroundColor = ConsoleColor.Green;
Console.Write("Enter a year: ");
Console.ResetColor();
int year = int.Parse(Console.ReadLine());
if (year % 4 == 0)
{
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("Entered year {0} is a leap year.", year);
}
else
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("Entered year {0} is not a leap year.", year);
}
Console.ResetColor();

Console.ForegroundColor = ConsoleColor.DarkGray;
Console.WriteLine("Press Enter to continue...");
Console.ResetColor();
Console.ReadLine();
}

public void IsP()
{
int num;
bool x = true;
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("Enter the Number to check Prime: ");
Console.ResetColor();
num = int.Parse(Console.ReadLine());
for (int i = 2; i <= num / 2; i++){if (num % i == 0){ Console.WriteLine("Number is not P.");x = false; break;} } if (x == true) Console.WriteLine("Number is P.");
for (int i = 2; i <= num / 2; i++)
{
if (num % i == 0)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("Number is not P.");
Console.ResetColor();
x = false;
break;
}
}
if (x == true)
{
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("Number is P.");
Console.ResetColor();
}

Console.ForegroundColor = ConsoleColor.DarkGray;
Console.WriteLine("Press any key to continue...");
Console.ResetColor();
Console.ReadKey();
}

Expand Down
27 changes: 27 additions & 0 deletions BusinessApp/PrintOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ public class Printoperations{
public void PrintSomething(){
char ch = 'A';
int i, j, k, m, n;
Console.ForegroundColor = ConsoleColor.Green;
Console.Write("Enter the number of rows:");
Console.ResetColor();
n = int.Parse(Console.ReadLine());

Console.ForegroundColor = ConsoleColor.Yellow;
for (i = 1; i <= n; i++)
{
for (j = n; j >= i; j--)
Expand All @@ -24,15 +28,24 @@ public void PrintSomething(){
Console.Write("\n");
ch = 'A';
}
Console.ResetColor();

Console.ForegroundColor = ConsoleColor.DarkGray;
Console.WriteLine("\nPress Enter to continue...");
Console.ResetColor();
Console.ReadLine();
}

public void PrintS()
{
int i, j, k, l, n;
char c = '*';
Console.ForegroundColor = ConsoleColor.Green;
Console.Write("Enter the number of rows:");
Console.ResetColor();
n = int.Parse(Console.ReadLine());

Console.ForegroundColor = ConsoleColor.Magenta;
for (i = 1; i <= n; i++)
{
for (j = 1; j <= n - i; j++)
Expand All @@ -49,26 +62,40 @@ public void PrintS()
}
Console.Write("\n");
}
Console.ResetColor();

Console.ForegroundColor = ConsoleColor.DarkGray;
Console.WriteLine("\nPress Enter to continue...");
Console.ResetColor();
Console.ReadLine();

}
public void Check()
{
string str, revstr = "";
Console.ForegroundColor = ConsoleColor.Green;
Console.Write("Enter string: ");
Console.ResetColor();
str = Console.ReadLine();
for (int i = str.Length - 1; i >= 0; i--) //String Reverse
{
revstr += str[i].ToString();
}
if (revstr.ToLower() == str.ToLower()) // Checking whether string is palindrome or not
{
Console.ForegroundColor = ConsoleColor.Green;
Console.Write("Entered string {0} is a Palindrome string. ", str);
}
else
{
Console.ForegroundColor = ConsoleColor.Red;
Console.Write("Entered string {0} is not a Palindrome string. ", str);
}
Console.ResetColor();

Console.ForegroundColor = ConsoleColor.DarkGray;
Console.WriteLine("\nPress Enter to continue...");
Console.ResetColor();
Console.ReadLine();
}

Expand Down
98 changes: 60 additions & 38 deletions BusinessApp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,30 @@ static void Main(string[] args)
showMenu = MainMenu();
}
}
private static bool MainMenu()
{
Printoperations p = new Printoperations();
DoMath d = new DoMath();

Console.Clear();
Console.WriteLine("Choose an option:");
Console.WriteLine("1) Reverse String");
Console.WriteLine("2) Remove Whitespace");
Console.WriteLine("3) Print");
Console.WriteLine("4) Print star");
Console.WriteLine("5) Calculate area");
Console.WriteLine("6) Is number p");
Console.WriteLine("0) Exit");
Console.Write("\r\nSelect an option: ");
private static bool MainMenu()
{
Printoperations p = new Printoperations();
DoMath d = new DoMath();

Console.Clear();
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine("Choose an option:");
Console.ResetColor();

Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine("1) Reverse String");
Console.WriteLine("2) Remove Whitespace");
Console.WriteLine("3) Print");
Console.WriteLine("4) Print star");
Console.WriteLine("5) Calculate area");
Console.WriteLine("6) Is number p");
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("0) Exit");
Console.ResetColor();

Console.ForegroundColor = ConsoleColor.Green;
Console.Write("\r\nSelect an option: ");
Console.ResetColor();

switch (Console.ReadLine())
{
Expand Down Expand Up @@ -54,35 +63,48 @@ private static bool MainMenu()
return true;
}
}
private static string CaptureInput()
{
Console.Write("Enter the string you want to modify: ");
return Console.ReadLine();
private static string CaptureInput()
{
Console.ForegroundColor = ConsoleColor.Green;
Console.Write("Enter the string you want to modify: ");
Console.ResetColor();
return Console.ReadLine();
}

private static void ReverseString()
{
Console.Clear();
Console.WriteLine("Reverse String");

char[] charArray = CaptureInput().ToCharArray();
Array.Reverse(charArray);
DisplayResult(String.Concat(charArray));
private static void ReverseString()
{
Console.Clear();
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine("Reverse String");
Console.ResetColor();

char[] charArray = CaptureInput().ToCharArray();
Array.Reverse(charArray);
DisplayResult(String.Concat(charArray));
}

private static void RemoveWhitespace()
{
Console.Clear();
Console.WriteLine("Remove Whitespace");

DisplayResult(CaptureInput().Replace(" ", ""));
private static void RemoveWhitespace()
{
Console.Clear();
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine("Remove Whitespace");
Console.ResetColor();

DisplayResult(CaptureInput().Replace(" ", ""));
}

private static void DisplayResult(string message)
{
Console.WriteLine($"\r\nYour modified string is: {message}");
Console.Write("\r\nPress Enter to return to Main Menu");
Console.ReadLine();
private static void DisplayResult(string message)
{
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine($"\r\nYour modified string is: ");
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine(message);
Console.ResetColor();

Console.ForegroundColor = ConsoleColor.DarkGray;
Console.Write("\r\nPress Enter to return to Main Menu");
Console.ResetColor();
Console.ReadLine();
}

}
Expand Down
Binary file modified BusinessApp/bin/Debug/net7.0/BusinessApp
Binary file not shown.
Binary file modified BusinessApp/bin/Debug/net7.0/BusinessApp.dll
Binary file not shown.
Binary file modified BusinessApp/bin/Debug/net7.0/BusinessApp.pdb
Binary file not shown.
30 changes: 22 additions & 8 deletions BusinessApp/obj/BusinessApp.csproj.nuget.dgspec.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"format": 1,
"restore": {
"/workspaces/ItWorksDoNotTouch/BusinessApp/BusinessApp.csproj": {}
"/home/runner/work/ItWorksDoNotTouch/ItWorksDoNotTouch/BusinessApp/BusinessApp.csproj": {}
},
"projects": {
"/workspaces/ItWorksDoNotTouch/BusinessApp/BusinessApp.csproj": {
"/home/runner/work/ItWorksDoNotTouch/ItWorksDoNotTouch/BusinessApp/BusinessApp.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "/workspaces/ItWorksDoNotTouch/BusinessApp/BusinessApp.csproj",
"projectUniqueName": "/home/runner/work/ItWorksDoNotTouch/ItWorksDoNotTouch/BusinessApp/BusinessApp.csproj",
"projectName": "BusinessApp",
"projectPath": "/workspaces/ItWorksDoNotTouch/BusinessApp/BusinessApp.csproj",
"packagesPath": "/home/codespace/.nuget/packages/",
"outputPath": "/workspaces/ItWorksDoNotTouch/BusinessApp/obj/",
"projectPath": "/home/runner/work/ItWorksDoNotTouch/ItWorksDoNotTouch/BusinessApp/BusinessApp.csproj",
"packagesPath": "/home/runner/.nuget/packages/",
"outputPath": "/home/runner/work/ItWorksDoNotTouch/ItWorksDoNotTouch/BusinessApp/obj/",
"projectStyle": "PackageReference",
"configFilePaths": [
"/home/codespace/.nuget/NuGet/NuGet.Config"
"/home/runner/.nuget/NuGet/NuGet.Config"
],
"originalTargetFrameworks": [
"net7.0"
Expand Down Expand Up @@ -58,12 +58,26 @@
],
"assetTargetFallback": true,
"warn": true,
"downloadDependencies": [
{
"name": "Microsoft.AspNetCore.App.Ref",
"version": "[7.0.20, 7.0.20]"
},
{
"name": "Microsoft.NETCore.App.Host.linux-x64",
"version": "[7.0.20, 7.0.20]"
},
{
"name": "Microsoft.NETCore.App.Ref",
"version": "[7.0.20, 7.0.20]"
}
],
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "/usr/local/dotnet/7.0.306/sdk/7.0.306/RuntimeIdentifierGraph.json"
"runtimeIdentifierGraphPath": "/usr/lib/dotnet/sdk/8.0.115/RuntimeIdentifierGraph.json"
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions BusinessApp/obj/BusinessApp.csproj.nuget.g.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">/home/codespace/.nuget/packages/</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">/home/codespace/.nuget/packages/</NuGetPackageFolders>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">/home/runner/.nuget/packages/</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">/home/runner/.nuget/packages/</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.6.0</NuGetToolVersion>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.8.1</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="/home/codespace/.nuget/packages/" />
<SourceRoot Include="/home/runner/.nuget/packages/" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion BusinessApp/obj/Debug/net7.0/BusinessApp.AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
[assembly: System.Reflection.AssemblyCompanyAttribute("BusinessApp")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f87e664cf248cae502ec594ace152989c41855ed")]
[assembly: System.Reflection.AssemblyProductAttribute("BusinessApp")]
[assembly: System.Reflection.AssemblyTitleAttribute("BusinessApp")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
08b444d6e48b75c761b3fc97398b9105d3e7ad3c
09e27f985ac4ca361f5b78c33443d250c66a9d9b6a19ee0dffb32167bb855402
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = BusinessApp
build_property.ProjectDir = /workspaces/ItWorksDoNotTouch/BusinessApp/
build_property.ProjectDir = /home/runner/work/ItWorksDoNotTouch/ItWorksDoNotTouch/BusinessApp/
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
Binary file modified BusinessApp/obj/Debug/net7.0/BusinessApp.assets.cache
Binary file not shown.
Binary file not shown.
Loading