-
Notifications
You must be signed in to change notification settings - Fork 17
Попова Мария #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ivinoiz
wants to merge
2
commits into
ISUCT:master
Choose a base branch
from
ivinoiz:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Попова Мария #9
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>netcoreapp3.0</TargetFramework> | ||
|
|
||
| <IsPackable>false</IsPackable> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" /> | ||
| <PackageReference Include="xunit" Version="2.4.0" /> | ||
| <PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" /> | ||
| <PackageReference Include="coverlet.collector" Version="1.0.1" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <ProjectReference Include="..\App\App.csproj" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| using System; | ||
| using Xunit; | ||
|
|
||
| namespace App.Tests | ||
| { | ||
| public class UnitTest1 | ||
| { | ||
| [Fact] | ||
| public void Display() | ||
| { | ||
| Duck duck = new Duck("Утьоночек", 3, 5, true); | ||
| string str = duck.Display(); | ||
| Assert.Equal("Уточки - милые создания", str); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void Area() | ||
| { | ||
| Duck duck = new Duck("Утьоночек", 3, 5, true); | ||
| string str = duck.PlaceOfLiving(); | ||
| Assert.Equal("Я живу на озере, если что", str); | ||
| Duck duck2 = new Duck("Дональд", 4, 10, false); | ||
| string str2 = duck2.PlaceOfLiving(); | ||
| Assert.Equal("Живу на реке, держу в курсе", str2); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void FlightDirection() | ||
| { | ||
| Duck duck = new Duck("Утьоночек", 3, 5, true); | ||
| string str = duck.FlightDirection(); | ||
| Assert.Equal("Я улетаю на юг!!!", str); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <OutputType>Exe</OutputType> | ||
| <TargetFramework>netcoreapp3.0</TargetFramework> | ||
| </PropertyGroup> | ||
|
|
||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| using System; | ||
|
|
||
| namespace App | ||
| { | ||
| public class Duck : absDuck | ||
| { | ||
| public string name; | ||
| public int count; | ||
| public bool isLake; | ||
| public int age; | ||
|
|
||
| public int Age | ||
| { | ||
| get | ||
| { | ||
| return age; | ||
| } | ||
| set | ||
| { | ||
| if ( age >= 0 && age < 20) | ||
| { | ||
| age = value; | ||
| } | ||
| else | ||
| { | ||
| Console.WriteLine("Установите возраст от 0 до 20"); | ||
| } | ||
| } | ||
| } | ||
| public Duck(string name, int age, int count, bool isLake) { this.name = name; Age = age; Count = count; this.isLake = isLake; } | ||
|
|
||
| public override int Count | ||
| { | ||
| get | ||
| { | ||
| return count; | ||
| } | ||
| set | ||
| { | ||
| count = value; | ||
| } | ||
| } | ||
|
|
||
| public override string PlaceOfLiving() | ||
| { | ||
| if (isLake == true) | ||
| { | ||
| return "Я живу на озере, если что"; | ||
| } | ||
| else | ||
| { | ||
| return "Живу на реке, держу в курсе"; | ||
| } | ||
| } | ||
|
|
||
| public override string Display() | ||
| { | ||
| return "Уточки - милые создания"; | ||
| } | ||
|
|
||
|
|
||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| namespace App | ||
| { | ||
| interface IFly | ||
| { | ||
| string FlightDirection(); // куда летят | ||
| int Count { get; set; } // число уток | ||
| } | ||
| interface IQuack | ||
| { | ||
| string PlaceOfLiving(); //где обитает | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| using System; | ||
|
|
||
| namespace App | ||
| { | ||
| class Program | ||
| { | ||
| static void Main(string[] args) | ||
| { | ||
| Duck krya = new Duck("Утьоночек", 3, 5, true); | ||
| Console.WriteLine(krya.name); | ||
| Console.WriteLine(krya.Age + " лет"); | ||
| Console.WriteLine($"Нас {krya.Count}"); | ||
| Console.WriteLine(krya.PlaceOfLiving()); | ||
| Console.WriteLine("+++++++++++++++++"); | ||
| Console.WriteLine(krya.Display()); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| using System; | ||
|
|
||
| namespace App | ||
| { | ||
| public abstract class absDuck : IFly, IQuack | ||
| { | ||
| public string FlightDirection() | ||
| { | ||
| return "Я улетаю на юг!!!"; | ||
| } | ||
| public virtual int Count { get; set; } | ||
| public virtual string PlaceOfLiving() | ||
| { | ||
| return "Я уточка, живу где хочу"; | ||
| } | ||
| public static string Swim() | ||
| { | ||
| return "Утки хорошо держатся на поверхности воды благодаря форме тела — оно у неё сплюснутое"; | ||
| } | ||
|
|
||
| public abstract string Display(); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,3 @@ | ||
| # exam_147_2020 | ||
| Попова Мария 2/147 | ||
|
|
||
| Создайте иерархию классов моделирующее игру. Создайте различные виды персонажей и вооружения. Отделите поведение различного типа вооружения. (Используйте интерфейсы для определения поведения) | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А причем тогда уточка?