Skip to content
Open
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
6 changes: 6 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Name: [BEC BRAUGHTON](https://github.com/beckton)
Place: Springfield, MO
About: I'm a geek who loves programming, design, solving problems, coffee & collecting chocolate frog cards.
Programming Language: Project is written in C#
Email: https://www.linkedin.com/in/bec-braughton/

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
6 changes: 6 additions & 0 deletions factorial/bec_braughton_factorial/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
</configuration>
54 changes: 54 additions & 0 deletions factorial/bec_braughton_factorial/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Author: Bec Braughton
// Language: C#
// Github: https://github.com/beckton

//https://github.com/ambujraj/hacktoberfest2019
//Find the factorial of a number.

using System;

namespace bec_braughton_factorial
{
class Program
{
static void Main(string[] args)
{
string userInput;
int userNum;

Console.WriteLine("Welcome to beckton's Factorial Finder Program!\n\nPlease enter a number between 2 and 21: ");
userInput = Console.ReadLine();
userNum = Convert.ToInt32(userInput);
GetFactorialSum(userNum);
}
public static void GetFactorialSum(int userNum)
{
if (userNum > 1 && userNum < 22)
{
int temp = userNum;
int factorial = 0;
for (int i = (userNum - 1); i > 0; i--)
{
temp = temp * i;
factorial = temp;
}
Console.WriteLine("\nThe factorial of the number " + userNum + " is " + factorial + "!\n\nThanks for playing! See you next time.");
Console.ReadLine();
}
else
{
Console.WriteLine("\nThe number entered is invalid.\n\nI'll choose for you: \n8");
userNum = 8;
int temp = userNum;
int factorial = 0;
for (int i = (userNum - 1); i > 0; i--)
{
temp = temp * i;
factorial = temp;
}
Console.WriteLine("\nThe factorial of the number 8 is " + factorial + "!\n\nThanks for playing! See you next time.");
Console.ReadLine();
}
}
}
}
36 changes: 36 additions & 0 deletions factorial/bec_braughton_factorial/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("bec_braughton_factorial")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("bec_braughton_factorial")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("d705630b-cd5c-45c3-9d54-1f7cfa6f5ce4")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
52 changes: 52 additions & 0 deletions factorial/bec_braughton_factorial/bec_braughton_factorial.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{D705630B-CD5C-45C3-9D54-1F7CFA6F5CE4}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>bec_braughton_factorial</RootNamespace>
<AssemblyName>bec_braughton_factorial</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
25 changes: 25 additions & 0 deletions factorial/bec_braughton_factorial/bec_braughton_factorial.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27703.2026
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "bec_braughton_factorial", "bec_braughton_factorial.csproj", "{D705630B-CD5C-45C3-9D54-1F7CFA6F5CE4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D705630B-CD5C-45C3-9D54-1F7CFA6F5CE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D705630B-CD5C-45C3-9D54-1F7CFA6F5CE4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D705630B-CD5C-45C3-9D54-1F7CFA6F5CE4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D705630B-CD5C-45C3-9D54-1F7CFA6F5CE4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8EE9BB97-913B-4DDA-9E71-B6540A21E6E4}
EndGlobalSection
EndGlobal
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
</configuration>
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ea1b58cafba02c95201193990c64ceddf316f9ab
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
C:\Users\Bec\Documents\Hacktoberfest19\factorial_function_cSharp\hacktoberfest2019\factorial\bec_braughton_factorial\bin\Debug\bec_braughton_factorial.exe.config
C:\Users\Bec\Documents\Hacktoberfest19\factorial_function_cSharp\hacktoberfest2019\factorial\bec_braughton_factorial\bin\Debug\bec_braughton_factorial.exe
C:\Users\Bec\Documents\Hacktoberfest19\factorial_function_cSharp\hacktoberfest2019\factorial\bec_braughton_factorial\bin\Debug\bec_braughton_factorial.pdb
C:\Users\Bec\Documents\Hacktoberfest19\factorial_function_cSharp\hacktoberfest2019\factorial\bec_braughton_factorial\obj\Debug\bec_braughton_factorial.csprojAssemblyReference.cache
C:\Users\Bec\Documents\Hacktoberfest19\factorial_function_cSharp\hacktoberfest2019\factorial\bec_braughton_factorial\obj\Debug\bec_braughton_factorial.csproj.CoreCompileInputs.cache
C:\Users\Bec\Documents\Hacktoberfest19\factorial_function_cSharp\hacktoberfest2019\factorial\bec_braughton_factorial\obj\Debug\bec_braughton_factorial.exe
C:\Users\Bec\Documents\Hacktoberfest19\factorial_function_cSharp\hacktoberfest2019\factorial\bec_braughton_factorial\obj\Debug\bec_braughton_factorial.pdb
Binary file not shown.
Binary file not shown.
Binary file not shown.