Skip to content

Commit

Permalink
IPT LAB1 & LAB2
Browse files Browse the repository at this point in the history
  • Loading branch information
RehmatGul0 committed Nov 1, 2019
0 parents commit 059ad15
Show file tree
Hide file tree
Showing 127 changed files with 4,263 additions and 0 deletions.
Binary file added Lab 1/k163680_Q1/.vs/k163680_Q1/v16/.suo
Binary file not shown.
Empty file.
Binary file not shown.
25 changes: 25 additions & 0 deletions Lab 1/k163680_Q1/k163680_Q1.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 Version 16
VisualStudioVersion = 16.0.29326.143
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "k163680_Q1", "k163680_Q1\k163680_Q1.csproj", "{87E1F92E-5743-4572-AE3B-6365B165227A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{87E1F92E-5743-4572-AE3B-6365B165227A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{87E1F92E-5743-4572-AE3B-6365B165227A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{87E1F92E-5743-4572-AE3B-6365B165227A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{87E1F92E-5743-4572-AE3B-6365B165227A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {829DD86E-32E5-4003-A945-F3DBA854A46E}
EndGlobalSection
EndGlobal
30 changes: 30 additions & 0 deletions Lab 1/k163680_Q1/k163680_Q1/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace k163680_Q1
{
class Program
{
static void Main(string[] args)
{

Console.WriteLine("Enter a string..");
String str = Console.ReadLine();
String requiredString = "";

if (str.Length > 4)
{
requiredString = String.Concat(str.Substring(0, 4).ToLower(), str.Substring(4, str.Length - 4).ToUpper());
}
else
{
requiredString = str.Substring(0, str.Length).ToLower();
}
Console.WriteLine(requiredString);
Console.ReadLine();

}
}
}
36 changes: 36 additions & 0 deletions Lab 1/k163680_Q1/k163680_Q1/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("k163680_Q1")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("k163680_Q1")]
[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("87e1f92e-5743-4572-ae3b-6365b165227a")]

// 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")]
48 changes: 48 additions & 0 deletions Lab 1/k163680_Q1/k163680_Q1/k163680_Q1.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?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>{87E1F92E-5743-4572-AE3B-6365B165227A}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>k163680_Q1</RootNamespace>
<AssemblyName>k163680_Q1</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</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.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
Binary file added Lab 1/k163680_Q2/.vs/k163680_Q2/v16/.suo
Binary file not shown.
Empty file.
Binary file not shown.
25 changes: 25 additions & 0 deletions Lab 1/k163680_Q2/k163680_Q2.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 Version 16
VisualStudioVersion = 16.0.29326.143
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "k163680_Q2", "k163680_Q2\k163680_Q2.csproj", "{D0574FAF-ABA6-48A8-AA3F-B95779F6BBD6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D0574FAF-ABA6-48A8-AA3F-B95779F6BBD6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D0574FAF-ABA6-48A8-AA3F-B95779F6BBD6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D0574FAF-ABA6-48A8-AA3F-B95779F6BBD6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D0574FAF-ABA6-48A8-AA3F-B95779F6BBD6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8BBD551C-B22E-4487-A7BC-57781FDE9F6A}
EndGlobalSection
EndGlobal
41 changes: 41 additions & 0 deletions Lab 1/k163680_Q2/k163680_Q2/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace k163680_Q2
{
class Program
{
static void Main(string[] args)
{
Random random = new Random();
Console.WriteLine("Enter size of a matrix..");
int rows = Convert.ToInt32(Console.ReadLine());

int[,] array = new int[rows, rows];
for (int i=0; i < rows; i++)
{
for(int j=0; j< rows; j++)
{
array[i,j] = random.Next(1, 1000);
Console.Write($"{array[i,j]} ");
}
Console.WriteLine();
}
long sum = 0;
for (int i = 0; i < rows; i++)
{
for (int j = 0; j < rows; j++)
{
if(i>=j)
sum += array[i, j];
}
}
Console.WriteLine($"The sum of left diagonals is {sum}..");
Console.ReadLine();


}
}
}
36 changes: 36 additions & 0 deletions Lab 1/k163680_Q2/k163680_Q2/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("k163680_Q2")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("k163680_Q2")]
[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("d0574faf-aba6-48a8-aa3f-b95779f6bbd6")]

// 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")]
48 changes: 48 additions & 0 deletions Lab 1/k163680_Q2/k163680_Q2/k163680_Q2.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?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>{D0574FAF-ABA6-48A8-AA3F-B95779F6BBD6}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>k163680_Q2</RootNamespace>
<AssemblyName>k163680_Q2</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</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.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
Binary file added Lab 1/k163680_Q3/.vs/k163680_Q3/v16/.suo
Binary file not shown.
Empty file.
Binary file not shown.
25 changes: 25 additions & 0 deletions Lab 1/k163680_Q3/k163680_Q3.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 Version 16
VisualStudioVersion = 16.0.29326.143
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "k163680_Q3", "k163680_Q3\k163680_Q3.csproj", "{45635301-FC98-46EC-BD52-DE27BBE814B4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{45635301-FC98-46EC-BD52-DE27BBE814B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{45635301-FC98-46EC-BD52-DE27BBE814B4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{45635301-FC98-46EC-BD52-DE27BBE814B4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{45635301-FC98-46EC-BD52-DE27BBE814B4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DEE586C9-EE19-4166-AE77-E5A6AA62E930}
EndGlobalSection
EndGlobal
40 changes: 40 additions & 0 deletions Lab 1/k163680_Q3/k163680_Q3/Calculator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace k163680_Q3
{
public class Calculator
{
public float add(float num1, float num2)
{
return num1 + num2;
}

public float add(float num1, params float[] parameters)
{
float sum = num1;
foreach(float param in parameters)
sum += param;
return sum;
}
public float substract(float num1, float num2)
{
return num1 - num2;

}
public float multiply(float num1, float num2)
{
return num1 * num2;
}
public float divide(float num1, float num2)
{
if (num2 != 0)
return num1 / num2;
else
return float.MaxValue;
}

}
}
20 changes: 20 additions & 0 deletions Lab 1/k163680_Q3/k163680_Q3/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace k163680_Q3
{
class Program
{
static void Main(string[] args)
{
//For demo purpose only calculator class required as mentioned in question.
Calculator calculator = new Calculator();

Console.WriteLine(calculator.add(1, 2, 3, 4));
Console.WriteLine(calculator.add(1, 2, 3, 4, 5, 6));
Console.ReadLine();
}
}
}
Loading

0 comments on commit 059ad15

Please sign in to comment.