Skip to content
This repository was archived by the owner on Nov 10, 2022. It is now read-only.

Commit 9575219

Browse files
committed
update10
1 parent 50aa7bf commit 9575219

File tree

15 files changed

+470
-16
lines changed

15 files changed

+470
-16
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.26730.16
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "infty_for", "infty_for\infty_for.csproj", "{E6F6E8DD-E3B9-4A73-851D-3E7D62D677BE}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{E6F6E8DD-E3B9-4A73-851D-3E7D62D677BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{E6F6E8DD-E3B9-4A73-851D-3E7D62D677BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{E6F6E8DD-E3B9-4A73-851D-3E7D62D677BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{E6F6E8DD-E3B9-4A73-851D-3E7D62D677BE}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {4BB92B27-5235-4848-9A18-814652219BC8}
24+
EndGlobalSection
25+
EndGlobal
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
5+
</startup>
6+
</configuration>
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
/*
8+
* A teraz... alternatywa do nieskonczonej petli while :) czyli nieskoczona petla for :)
9+
10+
==================================
11+
Treść zadania:
12+
==================================
13+
1. Stwórz klasę Cwiczenie.
14+
2. Stwórz metodę Infty_for()
15+
3. W metodzie Infty_for()
16+
napisz pętlę nieskończoną for, która będzie sumowała dwie liczby podane przez użytkownika.
17+
Po wypisaniu wyniku znowu sumuje dwie liczby itd...
18+
19+
przykład działania programu:
20+
Podaj liczbe 1:
21+
5
22+
Podaj liczbe 2:
23+
6
24+
5 + 6 = 11
25+
Podaj liczbe 1
26+
.. i tak dalej.
27+
28+
4. Stwórz obiekt a następnie wywołaj metodę infty_for().
29+
5. Przetestuj program.
30+
*/
31+
namespace infty_for
32+
{
33+
class Cwiczenie
34+
{
35+
public void InftyFor()
36+
{
37+
for(int i = 0; i < 1; )
38+
{
39+
Console.WriteLine("\nPodaj liczbe1: ");
40+
int liczba1 = Convert.ToInt32(Console.ReadLine());
41+
42+
Console.WriteLine("Podaj liczbe2: ");
43+
int liczba2 = Convert.ToInt32(Console.ReadLine());
44+
45+
Console.WriteLine("Wynik: " + (liczba1 + liczba2));
46+
}
47+
}
48+
}
49+
50+
class Program
51+
{
52+
static void Main(string[] args)
53+
{
54+
// tworzymy obiekt
55+
Cwiczenie obiekt = new Cwiczenie();
56+
57+
// wywolujemy metode
58+
obiekt.InftyFor();
59+
60+
Console.ReadLine();
61+
}
62+
}
63+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("infty_for")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("infty_for")]
13+
[assembly: AssemblyCopyright("Copyright © 2017")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("e6f6e8dd-e3b9-4a73-851d-3e7d62d677be")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{E6F6E8DD-E3B9-4A73-851D-3E7D62D677BE}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<RootNamespace>infty_for</RootNamespace>
10+
<AssemblyName>infty_for</AssemblyName>
11+
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16+
<PlatformTarget>AnyCPU</PlatformTarget>
17+
<DebugSymbols>true</DebugSymbols>
18+
<DebugType>full</DebugType>
19+
<Optimize>false</Optimize>
20+
<OutputPath>bin\Debug\</OutputPath>
21+
<DefineConstants>DEBUG;TRACE</DefineConstants>
22+
<ErrorReport>prompt</ErrorReport>
23+
<WarningLevel>4</WarningLevel>
24+
</PropertyGroup>
25+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26+
<PlatformTarget>AnyCPU</PlatformTarget>
27+
<DebugType>pdbonly</DebugType>
28+
<Optimize>true</Optimize>
29+
<OutputPath>bin\Release\</OutputPath>
30+
<DefineConstants>TRACE</DefineConstants>
31+
<ErrorReport>prompt</ErrorReport>
32+
<WarningLevel>4</WarningLevel>
33+
</PropertyGroup>
34+
<ItemGroup>
35+
<Reference Include="System" />
36+
<Reference Include="System.Core" />
37+
<Reference Include="System.Xml.Linq" />
38+
<Reference Include="System.Data.DataSetExtensions" />
39+
<Reference Include="Microsoft.CSharp" />
40+
<Reference Include="System.Data" />
41+
<Reference Include="System.Net.Http" />
42+
<Reference Include="System.Xml" />
43+
</ItemGroup>
44+
<ItemGroup>
45+
<Compile Include="Program.cs" />
46+
<Compile Include="Properties\AssemblyInfo.cs" />
47+
</ItemGroup>
48+
<ItemGroup>
49+
<None Include="App.config" />
50+
</ItemGroup>
51+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
52+
</Project>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.26730.16
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "infty_for", "infty_for\infty_for.csproj", "{E6F6E8DD-E3B9-4A73-851D-3E7D62D677BE}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{E6F6E8DD-E3B9-4A73-851D-3E7D62D677BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{E6F6E8DD-E3B9-4A73-851D-3E7D62D677BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{E6F6E8DD-E3B9-4A73-851D-3E7D62D677BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{E6F6E8DD-E3B9-4A73-851D-3E7D62D677BE}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {4BB92B27-5235-4848-9A18-814652219BC8}
24+
EndGlobalSection
25+
EndGlobal
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.26730.16
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "zagniezdzona_for", "zagniezdzona_for\zagniezdzona_for.csproj", "{25545EEB-945D-45F7-8AD1-DE837AA01377}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{25545EEB-945D-45F7-8AD1-DE837AA01377}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{25545EEB-945D-45F7-8AD1-DE837AA01377}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{25545EEB-945D-45F7-8AD1-DE837AA01377}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{25545EEB-945D-45F7-8AD1-DE837AA01377}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {EF26D85F-F1DD-407F-B9A8-4389098AC96B}
24+
EndGlobalSection
25+
EndGlobal
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
5+
</startup>
6+
</configuration>
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
/*
8+
======================================
9+
Treść zadania:
10+
======================================
11+
1. Stwórz klasę Testowanie
12+
2. Stwórz metodę Zagniezdzanie()
13+
3. W metodzie Zagnieżdzanie stwórz kod o następującym:
14+
15+
zadeklaruj zmienna typu calkowitego ktora bedzie pokazywala ktore dzien dobry sie wypisuje
16+
np. powitanie
17+
int powitanie = 0;
18+
19+
for(x = 0; x < 10; x++)
20+
{
21+
wypisuje na ekran 'Dzien dobry'
22+
zwieksza powitanie o 1
23+
24+
for(y = 0; y < 6; y++)
25+
{
26+
if(y % 2 == 0)
27+
{
28+
wypisuje na ekran 'Huraaa!'
29+
}
30+
}
31+
}
32+
33+
4. Stwórz obiekt i wywołaj metody. Spróbuj rozgryźć jak działa ta pętla zagnieżdzona. Wyobraź sobie że jesteś
34+
kompilatorem i przejdź po kolei kroki jak on po tych pętlach. Zobaczymy wtedy czy dobrze rozumiesz pętle for
35+
w pętli for. :)
36+
37+
5. Jeśli już Ci się udało ogarnąć powyższy kod i wiesz co się dzieje, to znaczy kiedy dana komenda ma swoją
38+
kolej... to spróbuj napisać swoją jakąś pętlę zagnieżdzoną. Poćwicz aby sobie utrwalić jak taką pętlę zagnieżdzoną
39+
się tworzy. Wymyśl coś może ;) Tak jakoś tam pogłówkuj. A potem jak coś wymyślisz i napiszesz to przetestuj
40+
a następnie sobie wytłumacz jak działa twój kod, to znaczy: linijka po linijce idź po kodzie i mów sobie
41+
co się dzieje w danej chwili. :) Tak aby sobie to utrwalić.
42+
*/
43+
namespace zagniezdzona_for
44+
{
45+
class Testowanie
46+
{
47+
public void Zagniezdzanie()
48+
{
49+
int powitanie = 0;
50+
51+
for (int x = 0; x < 10; x++)
52+
{
53+
Console.WriteLine("Dzien dobry nr." + powitanie);
54+
powitanie++;
55+
56+
for (int y = 0; y < 6; y++)
57+
{
58+
if (y % 2 == 0)
59+
{
60+
Console.WriteLine("Huraaa");
61+
}
62+
}
63+
}
64+
}
65+
}
66+
67+
class Program
68+
{
69+
static void Main(string[] args)
70+
{
71+
// tworzenie obiektu
72+
Testowanie obiekt = new Testowanie();
73+
74+
// wywołanie metody Zagniezdzanie
75+
obiekt.Zagniezdzanie();
76+
77+
Console.ReadLine();
78+
}
79+
}
80+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("zagniezdzona_for")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("zagniezdzona_for")]
13+
[assembly: AssemblyCopyright("Copyright © 2017")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("25545eeb-945d-45f7-8ad1-de837aa01377")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

0 commit comments

Comments
 (0)