├── 06-getting-user-data ├── the-metric-system │ ├── README.md │ ├── Tests │ │ ├── Usings.cs │ │ └── UnitTest1.cs │ └── TheMetricSystem │ │ ├── Program.cs │ │ └── TheMetricSystem.csproj ├── student_id │ ├── StudentID │ │ ├── StudentID.csproj │ │ └── Program.cs │ ├── Tests │ │ └── Tests.csproj │ └── README.md └── time_machine │ ├── TimeMachine │ ├── TimeMachine.csproj │ ├── Program.cs │ └── Clock.cs │ └── Tests │ ├── Tests.csproj │ └── UnitTestClock.cs ├── 10-strings ├── beginning_of_zork │ └── .todo ├── sort_the_letters │ └── .todo ├── holo_gram │ ├── HoloGram │ │ ├── HoloGram.csproj │ │ ├── PangramChecker.cs │ │ └── Program.cs │ ├── Solution │ │ ├── Solution.csproj │ │ ├── PangramChecker.cs │ │ └── Program.cs │ └── Tests │ │ ├── Tests.csproj │ │ └── UnitTestPangramChecker.cs ├── not_my_mail │ ├── Solution │ │ ├── Solution.csproj │ │ ├── EmailValidator.cs │ │ └── Program.cs │ ├── NotMyMail │ │ ├── NotMyMail.csproj │ │ ├── EmailValidator.cs │ │ └── Program.cs │ └── Tests │ │ └── Tests.csproj ├── reversal │ ├── Reversal │ │ ├── Reversal.csproj │ │ ├── StringReverser.cs │ │ └── Program.cs │ ├── README.md │ └── Tests │ │ ├── Tests.csproj │ │ └── UnitTestStringReverser.cs ├── abbreviate_this │ ├── Solution │ │ ├── Solution.csproj │ │ └── Program.cs │ ├── AbbreviateThis │ │ ├── AbbreviateThis.csproj │ │ ├── Program.cs │ │ └── Abbreviator.cs │ └── Tests │ │ ├── Tests.csproj │ │ └── UnitTestAbbreviator.cs ├── binary_coding │ ├── Solution │ │ ├── Solution.csproj │ │ └── Program.cs │ ├── BinaryCoding │ │ ├── BinaryCoding.csproj │ │ ├── Program.cs │ │ └── BinaryConverter.cs │ └── Tests │ │ ├── Tests.csproj │ │ └── UnitTestBinaryConverter.cs ├── palindrome │ ├── Palindrome │ │ ├── Palindrome.csproj │ │ ├── PalindromeChecker.cs │ │ └── Program.cs │ ├── Tests │ │ └── Tests.csproj │ └── README.md ├── binary_nibble │ ├── BinaryNibble │ │ ├── BinaryNibble.csproj │ │ ├── NumberSystemConverter.cs │ │ └── Program.cs │ └── Tests │ │ ├── Tests.csproj │ │ └── UnitTestNumberSystemConverter.cs ├── how_many_times │ ├── HowManyTimes │ │ ├── HowManyTimes.csproj │ │ ├── StringFinder.cs │ │ └── Program.cs │ ├── Tests │ │ └── Tests.csproj │ └── README.md ├── text_properties │ ├── TextProperties │ │ ├── TextProperties.csproj │ │ └── Program.cs │ ├── Tests │ │ └── Tests.csproj │ └── README.md ├── words_everywhere │ ├── WordsEverywhere │ │ ├── WordsEverywhere.csproj │ │ ├── WordCounter.cs │ │ └── Program.cs │ ├── README.md │ └── Tests │ │ └── Tests.csproj ├── parentheses_checker │ ├── ParenthesesChecker │ │ ├── ParenthesesChecker.csproj │ │ ├── CodeLinter.cs │ │ └── Program.cs │ └── Tests │ │ └── Tests.csproj ├── replace_performance │ ├── ReplacePerformance │ │ ├── ReplacePerformance.csproj │ │ └── StringHelper.cs │ └── Tests │ │ └── Tests.csproj └── pattern_builder │ └── README.md ├── img ├── powershell.png ├── failing_tests.png ├── pull_changes.png ├── classroom-roster.png ├── run_all_unit_tests.png ├── succeeding_tests.png ├── nuget_package_source.png ├── commit_push_powershell.png └── authorize-github-classroom.png ├── 07-methods ├── la_resistance │ ├── img │ │ ├── parallel.png │ │ ├── series.png │ │ ├── basic_network.png │ │ └── advanced_network.png │ └── LaResistance │ │ └── LaResistance.csproj ├── hail_c_sharp │ ├── HailCSharp │ │ ├── HailCSharp.csproj │ │ └── Program.cs │ └── README.md ├── hello_mister_roboto │ ├── HelloMisterRoboto │ │ ├── HelloMisterRoboto.csproj │ │ └── Program.cs │ └── README.md ├── sum_and_difference │ ├── SumAndDifference │ │ └── SumAndDifference.csproj │ └── README.md ├── toss_a_die_to_your_witcher │ ├── TossADieToYourWitcher │ │ ├── TossADieToYourWitcher.csproj │ │ └── Program.cs │ └── README.md └── its_all_about_timing │ └── README.md ├── 09-loops ├── series_of_squares │ ├── img │ │ ├── series.png │ │ ├── formula.png │ │ └── series_of_squares.png │ ├── SeriesOfSquares │ │ ├── SeriesOfSquares.csproj │ │ ├── SquaredSeries.cs │ │ └── Program.cs │ └── Tests │ │ ├── UnitTestSquaredSeries.cs │ │ └── Tests.csproj ├── apple_cake │ ├── AppleCake │ │ ├── AppleCake.csproj │ │ └── Program.cs │ ├── Solution │ │ ├── Solution.csproj │ │ └── Program.cs │ └── Tests │ │ └── Tests.csproj ├── start_to_end │ ├── StartToEnd │ │ ├── StartToEnd.csproj │ │ ├── Program.cs │ │ └── Series.cs │ ├── Tests │ │ └── Tests.csproj │ └── README.md ├── number_manipulator │ ├── NumberManipulator │ │ ├── NumberManipulator.csproj │ │ └── Manipulator.cs │ └── Tests │ │ └── Tests.csproj ├── greatest_common_factor │ ├── GreatestCommonFactor │ │ ├── GreatestCommonFactor.csproj │ │ ├── MathHelper.cs │ │ └── Program.cs │ ├── Tests │ │ └── Tests.csproj │ └── README.md ├── roll_em_all │ └── README.md ├── fibonacci_sequence │ └── README.md ├── visual_rectangle │ └── README.md ├── higher_lower │ └── README.md └── up_and_down │ └── README.md ├── 05-processing-data ├── ex_pythagoras │ ├── img │ │ └── formula.png │ ├── Pythagoras │ │ ├── Pythagoras.csproj │ │ ├── Program.cs │ │ └── RightHandTriangle.cs │ ├── Tests │ │ ├── Tests.csproj │ │ └── UnitTestRightHandTriangle.cs │ └── README.md ├── ex_evaluation │ ├── Evaluation │ │ ├── Evaluation.csproj │ │ └── Program.cs │ ├── Tests │ │ └── Tests.csproj │ └── README.md ├── ex_pizza_time │ ├── PizzaTime │ │ ├── PizzaTime.csproj │ │ └── Program.cs │ ├── README.md │ └── Tests │ │ └── Tests.csproj ├── ex_calculate_vat │ ├── CalculateVAT │ │ ├── CalculateVAT.csproj │ │ ├── Program.cs │ │ └── Invoice.cs │ ├── Tests │ │ ├── Tests.csproj │ │ └── UnitTestInvoice.cs │ └── README.md ├── ex_fundamental_calculus │ ├── FundamentalCalculus │ │ ├── FundamentalCalculus.csproj │ │ └── Program.cs │ ├── README.md │ └── Tests │ │ └── Tests.csproj ├── ex_rectangle_properties │ ├── RectangleProperties │ │ ├── RectangleProperties.csproj │ │ └── Program.cs │ ├── Tests │ │ └── Tests.csproj │ └── README.md └── ch_circle_properties │ └── README.md ├── 08-making-decisions ├── led_series_resistor │ ├── img │ │ └── formula.png │ ├── Solution │ │ └── Solution.csproj │ ├── LEDSeriesResistor │ │ ├── LEDSeriesResistor.csproj │ │ └── ResistorCalculator.cs │ └── Tests │ │ └── Tests.csproj ├── biggest_number │ ├── BiggestNumber │ │ ├── BiggestNumber.csproj │ │ ├── Biggest.cs │ │ └── Program.cs │ ├── Tests │ │ └── Tests.csproj │ └── README.md ├── converternator │ ├── Converternator │ │ ├── Converternator.csproj │ │ └── Program.cs │ └── Tests │ │ ├── Tests.csproj │ │ └── UnitTestConverter.cs ├── drifting_years │ ├── DriftingYears │ │ ├── DriftingYears.csproj │ │ ├── LeapYearChecker.cs │ │ └── Program.cs │ └── Tests │ │ ├── Tests.csproj │ │ └── UnitTestLeapYearChecker.cs ├── rectangle_area │ ├── RectangleArea │ │ ├── RectangleArea.csproj │ │ ├── Rectangle.cs │ │ └── Program.cs │ └── Tests │ │ ├── Tests.csproj │ │ └── UnitTestRectangle.cs └── coordinate_plane │ ├── CoordinatePlane │ ├── CoordinatePlane.csproj │ ├── Program.cs │ └── Point.cs │ ├── Tests │ └── Tests.csproj │ └── README.md ├── 03-starting-in-csharp ├── ch_hello_world │ ├── README.md │ └── HelloWorld │ │ ├── HelloWorld.csproj │ │ └── Program.cs ├── ex_need_a_break │ ├── Solution │ │ ├── Solution.csproj │ │ └── Program.cs │ ├── NeedABreak │ │ ├── NeedABreak.csproj │ │ └── Program.cs │ └── README.md ├── ch_developed_by │ ├── DevelopedBy │ │ ├── DevelopedBy.csproj │ │ └── Program.cs │ └── README.md ├── ch_java_programmer │ ├── JavaProgrammer │ │ ├── JavaProgrammer.csproj │ │ └── Program.cs │ └── README.md ├── ch_personal_details │ ├── PersonalDetails │ │ ├── PersonalDetails.csproj │ │ └── Program.cs │ └── README.md ├── ch_basic_syntax_error │ ├── BasicSyntaxError │ │ ├── BasicSyntaxError.csproj │ │ └── Program.cs │ └── README.md ├── ch_my_first_app │ └── README.md └── challenges.md ├── 26-constructors ├── vector_from_start_to_end │ ├── img │ │ └── add-vectors.gif │ ├── VectorFromStartToEnd │ │ └── VectorFromStartToEnd.csproj │ └── Tests │ │ └── Tests.csproj ├── quadratic │ ├── Quadratic │ │ ├── Quadratic.csproj │ │ └── Program.cs │ └── Tests │ │ ├── UnitTest1.cs │ │ └── Tests.csproj ├── things_are_complex │ ├── Solution │ │ ├── Solution.csproj │ │ └── Program.cs │ ├── ThingsAreComplex │ │ ├── ThingsAreComplex.csproj │ │ └── Program.cs │ └── Tests │ │ └── Tests.csproj ├── back_to_the_future │ └── BackToTheFuture │ │ ├── BackToTheFuture.csproj │ │ └── Program.cs └── i_can_hear_colors │ ├── ICanHearColors │ ├── ICanHearColors.csproj │ └── Program.cs │ └── Tests │ └── Tests.csproj ├── 50-introduction-to-wpf ├── complex-calculator │ └── img │ │ └── gui-mockup.png └── hangman-refactored │ └── HangmanRefactored │ └── HangmanRefactored │ ├── words.txt │ └── HangmanRefactored.csproj ├── 02-basic-building-blocks ├── ex_circle_circumference │ ├── img │ │ ├── circle.png │ │ └── flowchart_circle_circumference.png │ ├── README.md │ └── solution.md ├── ch_personalized_bmi │ ├── img │ │ └── flowchart_bmi.png │ └── README.md ├── ex_bmi_adult_check │ ├── img │ │ ├── flowchart_bmi.png │ │ └── flowchart_bmi_adult_check.png │ ├── README.md │ └── solution.md ├── ex_cinema │ ├── README.md │ └── solution.md ├── ch_smartphones │ └── README.md ├── ch_motorcycles │ └── README.md ├── ch_rectangle_area │ └── README.md ├── ch_sum_of_numbers │ └── README.md └── ch_student_grader │ └── README.md ├── 11-arrays ├── absolute_sum │ ├── Solution │ │ ├── Solution.csproj │ │ ├── Program.cs │ │ └── Summator.cs │ ├── AbsoluteSum │ │ ├── AbsoluteSum.csproj │ │ ├── Summator.cs │ │ └── Program.cs │ ├── Tests │ │ ├── Tests.csproj │ │ └── UnitTestSummator.cs │ └── README.md ├── parallel_arrays │ ├── ParallelArrays │ │ ├── ParallelArrays.csproj │ │ └── ArrayHelper.cs │ └── Tests │ │ └── Tests.csproj ├── turn_the_tables │ ├── TurnTheTables │ │ ├── TurnTheTables.csproj │ │ └── ArrayMultiplier.cs │ ├── Tests │ │ └── Tests.csproj │ └── README.md ├── biggest_of_them_all │ ├── BiggestOfThemAll │ │ └── BiggestOfThemAll.csproj │ └── Tests │ │ └── Tests.csproj ├── multiples_of_three │ ├── MultiplesOfThree │ │ ├── MultiplesOfThree.csproj │ │ ├── MultipleGenerator.cs │ │ └── Program.cs │ ├── README.md │ └── Tests │ │ ├── Tests.csproj │ │ └── UnitTestsMultipleGenerator.cs ├── strings_to_numbers │ ├── StringsToNumbers │ │ ├── StringsToNumbers.csproj │ │ └── StringArrayConverter.cs │ ├── Tests │ │ └── Tests.csproj │ └── README.md ├── the_sum_of_all_numbers │ ├── TheSumOfAllNumbers │ │ ├── TheSumOfAllNumbers.csproj │ │ └── SumOfIntegers.cs │ ├── Tests │ │ └── Tests.csproj │ └── README.md ├── time_for_change │ └── README.md └── join_the_resistance │ └── README.md ├── 04-storing-data ├── ex_marco_polo │ ├── MarcoPolo │ │ ├── MarcoPolo.csproj │ │ └── Program.cs │ ├── Tests │ │ ├── Tests.csproj │ │ └── TestPersonalInformation.cs │ └── README.md ├── ex_csharp_land │ ├── CSharpLand │ │ ├── CSharpLand.csproj │ │ ├── Program.cs │ │ └── RollerCoaster.cs │ ├── Tests │ │ ├── RollerCoasterTest.cs │ │ └── Tests.csproj │ └── README.md ├── ex_frame_delimiter │ ├── FrameDelimiter │ │ ├── FrameDelimiter.csproj │ │ ├── Program.cs │ │ └── Frame.cs │ ├── Tests │ │ ├── FrameTest.cs │ │ └── Tests.csproj │ └── README.md └── ex_programming_bugs │ ├── ProgrammingBugs │ ├── ProgrammingBugs.csproj │ ├── Program.cs │ └── MessageOfTheDay.cs │ ├── Tests │ ├── UnitTestMessageOfTheDay.cs │ └── Tests.csproj │ └── README.md ├── 23-creating-and-using-objects ├── round_about │ ├── RoundAbout │ │ ├── RoundAbout.csproj │ │ ├── Circle.cs │ │ └── Program.cs │ └── Tests │ │ └── Tests.csproj └── point_in_space │ ├── PointInSpace │ ├── PointInSpace.csproj │ ├── Point.cs │ └── Program.cs │ └── Tests │ └── Tests.csproj ├── 24-defining-custom-classes ├── kings_of_nothing │ └── KingsOfNothing │ │ └── KingsOfNothing.csproj ├── teach_the_teacher │ ├── TeachTheTeacher │ │ ├── TeachTheTeacher.csproj │ │ └── Program.cs │ └── Tests │ │ ├── Tests.csproj │ │ └── UnitTestTeacher.cs └── the_paint_factory │ ├── ThePaintFactory │ ├── ThePaintFactory.csproj │ ├── PaintCalculator.cs │ └── Program.cs │ └── Tests │ └── Tests.csproj ├── 25-getters-setters-properties ├── super_string_theory │ └── SuperStringTheory │ │ └── SuperStringTheory.csproj └── third_rock_from_the_sun │ └── ThirdRockFromTheSun │ ├── ThirdRockFromTheSun.csproj │ └── Program.cs ├── ideas.md ├── 01-introduction ├── ch_making_a_sandwich │ └── README.md ├── ch_processor_architecture │ └── README.md ├── ch_programming_languages │ └── README.md └── ch_biggest_number_in_a_list │ └── README.md └── 28-interfaces ├── total-surface ├── TotalSurface │ ├── TotalSurface.csproj │ ├── Square.cs │ └── Circle.cs └── TotalSurface.sln └── generator-of-numbers └── GeneratorOfNumbers └── GeneratorOfNumbers.csproj /06-getting-user-data/the-metric-system/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /10-strings/beginning_of_zork/.todo: -------------------------------------------------------------------------------- 1 | Basic command parser. -------------------------------------------------------------------------------- /10-strings/sort_the_letters/.todo: -------------------------------------------------------------------------------- 1 | Sort the letters of a word. -------------------------------------------------------------------------------- /06-getting-user-data/the-metric-system/Tests/Usings.cs: -------------------------------------------------------------------------------- 1 | global using Xunit; -------------------------------------------------------------------------------- /img/powershell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioBoost/csharp_practical/HEAD/img/powershell.png -------------------------------------------------------------------------------- /img/failing_tests.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioBoost/csharp_practical/HEAD/img/failing_tests.png -------------------------------------------------------------------------------- /img/pull_changes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioBoost/csharp_practical/HEAD/img/pull_changes.png -------------------------------------------------------------------------------- /img/classroom-roster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioBoost/csharp_practical/HEAD/img/classroom-roster.png -------------------------------------------------------------------------------- /img/run_all_unit_tests.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioBoost/csharp_practical/HEAD/img/run_all_unit_tests.png -------------------------------------------------------------------------------- /img/succeeding_tests.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioBoost/csharp_practical/HEAD/img/succeeding_tests.png -------------------------------------------------------------------------------- /img/nuget_package_source.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioBoost/csharp_practical/HEAD/img/nuget_package_source.png -------------------------------------------------------------------------------- /img/commit_push_powershell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioBoost/csharp_practical/HEAD/img/commit_push_powershell.png -------------------------------------------------------------------------------- /img/authorize-github-classroom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioBoost/csharp_practical/HEAD/img/authorize-github-classroom.png -------------------------------------------------------------------------------- /07-methods/la_resistance/img/parallel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioBoost/csharp_practical/HEAD/07-methods/la_resistance/img/parallel.png -------------------------------------------------------------------------------- /07-methods/la_resistance/img/series.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioBoost/csharp_practical/HEAD/07-methods/la_resistance/img/series.png -------------------------------------------------------------------------------- /09-loops/series_of_squares/img/series.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioBoost/csharp_practical/HEAD/09-loops/series_of_squares/img/series.png -------------------------------------------------------------------------------- /09-loops/series_of_squares/img/formula.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioBoost/csharp_practical/HEAD/09-loops/series_of_squares/img/formula.png -------------------------------------------------------------------------------- /07-methods/la_resistance/img/basic_network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioBoost/csharp_practical/HEAD/07-methods/la_resistance/img/basic_network.png -------------------------------------------------------------------------------- /05-processing-data/ex_pythagoras/img/formula.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioBoost/csharp_practical/HEAD/05-processing-data/ex_pythagoras/img/formula.png -------------------------------------------------------------------------------- /07-methods/la_resistance/img/advanced_network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioBoost/csharp_practical/HEAD/07-methods/la_resistance/img/advanced_network.png -------------------------------------------------------------------------------- /09-loops/series_of_squares/img/series_of_squares.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioBoost/csharp_practical/HEAD/09-loops/series_of_squares/img/series_of_squares.png -------------------------------------------------------------------------------- /08-making-decisions/led_series_resistor/img/formula.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioBoost/csharp_practical/HEAD/08-making-decisions/led_series_resistor/img/formula.png -------------------------------------------------------------------------------- /03-starting-in-csharp/ch_hello_world/README.md: -------------------------------------------------------------------------------- 1 | # Hello World 2 | 3 | Open the C# project in this directory and edit the code so it outputs `Hello World` to the terminal. 4 | -------------------------------------------------------------------------------- /06-getting-user-data/the-metric-system/TheMetricSystem/Program.cs: -------------------------------------------------------------------------------- 1 | // See https://aka.ms/new-console-template for more information 2 | Console.WriteLine("Hello, World!"); 3 | -------------------------------------------------------------------------------- /26-constructors/vector_from_start_to_end/img/add-vectors.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioBoost/csharp_practical/HEAD/26-constructors/vector_from_start_to_end/img/add-vectors.gif -------------------------------------------------------------------------------- /50-introduction-to-wpf/complex-calculator/img/gui-mockup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioBoost/csharp_practical/HEAD/50-introduction-to-wpf/complex-calculator/img/gui-mockup.png -------------------------------------------------------------------------------- /02-basic-building-blocks/ex_circle_circumference/img/circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioBoost/csharp_practical/HEAD/02-basic-building-blocks/ex_circle_circumference/img/circle.png -------------------------------------------------------------------------------- /02-basic-building-blocks/ch_personalized_bmi/img/flowchart_bmi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioBoost/csharp_practical/HEAD/02-basic-building-blocks/ch_personalized_bmi/img/flowchart_bmi.png -------------------------------------------------------------------------------- /02-basic-building-blocks/ex_bmi_adult_check/img/flowchart_bmi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioBoost/csharp_practical/HEAD/02-basic-building-blocks/ex_bmi_adult_check/img/flowchart_bmi.png -------------------------------------------------------------------------------- /06-getting-user-data/the-metric-system/Tests/UnitTest1.cs: -------------------------------------------------------------------------------- 1 | namespace Tests; 2 | 3 | public class UnitTest1 4 | { 5 | [Fact] 6 | public void Test1() 7 | { 8 | 9 | } 10 | } -------------------------------------------------------------------------------- /02-basic-building-blocks/ex_bmi_adult_check/img/flowchart_bmi_adult_check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioBoost/csharp_practical/HEAD/02-basic-building-blocks/ex_bmi_adult_check/img/flowchart_bmi_adult_check.png -------------------------------------------------------------------------------- /50-introduction-to-wpf/hangman-refactored/HangmanRefactored/HangmanRefactored/words.txt: -------------------------------------------------------------------------------- 1 | Hello World 2 | Immutable 3 | Scope Resolution Operator 4 | Dude 5 | CSharp is Ok 6 | JavaScript is Fun 7 | C plus plus is powerful -------------------------------------------------------------------------------- /02-basic-building-blocks/ex_circle_circumference/img/flowchart_circle_circumference.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BioBoost/csharp_practical/HEAD/02-basic-building-blocks/ex_circle_circumference/img/flowchart_circle_circumference.png -------------------------------------------------------------------------------- /09-loops/apple_cake/AppleCake/AppleCake.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /09-loops/apple_cake/Solution/Solution.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /10-strings/holo_gram/HoloGram/HoloGram.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /10-strings/holo_gram/Solution/Solution.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /10-strings/not_my_mail/Solution/Solution.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /10-strings/reversal/Reversal/Reversal.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /11-arrays/absolute_sum/Solution/Solution.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /07-methods/hail_c_sharp/HailCSharp/HailCSharp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /09-loops/start_to_end/StartToEnd/StartToEnd.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /10-strings/abbreviate_this/Solution/Solution.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /10-strings/binary_coding/Solution/Solution.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /10-strings/not_my_mail/NotMyMail/NotMyMail.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /10-strings/palindrome/Palindrome/Palindrome.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /11-arrays/absolute_sum/AbsoluteSum/AbsoluteSum.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /26-constructors/quadratic/Quadratic/Quadratic.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /04-storing-data/ex_marco_polo/MarcoPolo/MarcoPolo.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /06-getting-user-data/student_id/StudentID/StudentID.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /07-methods/la_resistance/LaResistance/LaResistance.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /10-strings/binary_coding/BinaryCoding/BinaryCoding.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /10-strings/binary_nibble/BinaryNibble/BinaryNibble.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /10-strings/how_many_times/HowManyTimes/HowManyTimes.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /03-starting-in-csharp/ex_need_a_break/Solution/Solution.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /04-storing-data/ex_csharp_land/CSharpLand/CSharpLand.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /05-processing-data/ex_evaluation/Evaluation/Evaluation.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /05-processing-data/ex_pizza_time/PizzaTime/PizzaTime.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /05-processing-data/ex_pythagoras/Pythagoras/Pythagoras.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /10-strings/abbreviate_this/AbbreviateThis/AbbreviateThis.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /10-strings/text_properties/TextProperties/TextProperties.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /11-arrays/parallel_arrays/ParallelArrays/ParallelArrays.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /11-arrays/turn_the_tables/TurnTheTables/TurnTheTables.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /26-constructors/things_are_complex/Solution/Solution.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /03-starting-in-csharp/ch_developed_by/DevelopedBy/DevelopedBy.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /03-starting-in-csharp/ch_hello_world/HelloWorld/HelloWorld.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /03-starting-in-csharp/ex_need_a_break/NeedABreak/NeedABreak.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /05-processing-data/ex_calculate_vat/CalculateVAT/CalculateVAT.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /06-getting-user-data/time_machine/TimeMachine/TimeMachine.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /08-making-decisions/led_series_resistor/Solution/Solution.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /09-loops/series_of_squares/SeriesOfSquares/SeriesOfSquares.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /10-strings/words_everywhere/WordsEverywhere/WordsEverywhere.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /04-storing-data/ex_frame_delimiter/FrameDelimiter/FrameDelimiter.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /07-methods/hello_mister_roboto/HelloMisterRoboto/HelloMisterRoboto.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /07-methods/sum_and_difference/SumAndDifference/SumAndDifference.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /08-making-decisions/biggest_number/BiggestNumber/BiggestNumber.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /08-making-decisions/converternator/Converternator/Converternator.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /08-making-decisions/drifting_years/DriftingYears/DriftingYears.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /08-making-decisions/rectangle_area/RectangleArea/RectangleArea.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /09-loops/number_manipulator/NumberManipulator/NumberManipulator.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /11-arrays/biggest_of_them_all/BiggestOfThemAll/BiggestOfThemAll.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /11-arrays/multiples_of_three/MultiplesOfThree/MultiplesOfThree.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /11-arrays/strings_to_numbers/StringsToNumbers/StringsToNumbers.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /23-creating-and-using-objects/round_about/RoundAbout/RoundAbout.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /26-constructors/back_to_the_future/BackToTheFuture/BackToTheFuture.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /26-constructors/i_can_hear_colors/ICanHearColors/ICanHearColors.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /26-constructors/quadratic/Tests/UnitTest1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Xunit; 3 | 4 | namespace Tests 5 | { 6 | public class UnitTest1 7 | { 8 | [Fact] 9 | public void Test1() 10 | { 11 | 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /03-starting-in-csharp/ch_java_programmer/JavaProgrammer/JavaProgrammer.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /04-storing-data/ex_programming_bugs/ProgrammingBugs/ProgrammingBugs.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /08-making-decisions/coordinate_plane/CoordinatePlane/CoordinatePlane.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /10-strings/parentheses_checker/ParenthesesChecker/ParenthesesChecker.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /10-strings/replace_performance/ReplacePerformance/ReplacePerformance.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /11-arrays/the_sum_of_all_numbers/TheSumOfAllNumbers/TheSumOfAllNumbers.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /23-creating-and-using-objects/point_in_space/PointInSpace/PointInSpace.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /26-constructors/things_are_complex/ThingsAreComplex/ThingsAreComplex.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /03-starting-in-csharp/ch_personal_details/PersonalDetails/PersonalDetails.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /08-making-decisions/led_series_resistor/LEDSeriesResistor/LEDSeriesResistor.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /09-loops/greatest_common_factor/GreatestCommonFactor/GreatestCommonFactor.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /24-defining-custom-classes/kings_of_nothing/KingsOfNothing/KingsOfNothing.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /24-defining-custom-classes/teach_the_teacher/TeachTheTeacher/TeachTheTeacher.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /24-defining-custom-classes/the_paint_factory/ThePaintFactory/ThePaintFactory.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /02-basic-building-blocks/ex_cinema/README.md: -------------------------------------------------------------------------------- 1 | # Cinema 2 | 3 | Take a look at the website of [Kinepolis](https://kinepolis.be). Name 5 properties of a film screening. Propose variable names for each. 4 | 5 | ## Solution 6 | 7 | The solution can be found [here](./solution.md) 8 | -------------------------------------------------------------------------------- /03-starting-in-csharp/ch_basic_syntax_error/BasicSyntaxError/BasicSyntaxError.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /07-methods/toss_a_die_to_your_witcher/TossADieToYourWitcher/TossADieToYourWitcher.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /23-creating-and-using-objects/round_about/RoundAbout/Circle.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace RoundAbout 6 | { 7 | public class Circle 8 | { 9 | // TODO Implement Circle 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /26-constructors/quadratic/Quadratic/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Quadratic 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Hello World!"); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /02-basic-building-blocks/ch_smartphones/README.md: -------------------------------------------------------------------------------- 1 | # Smartphones 2 | 3 | Take a look at the CoolBlue website for one of the latest models of smartphones. What data would you require to store some of the most common properties of a smartphone product? Propose variables names for each. 4 | -------------------------------------------------------------------------------- /05-processing-data/ex_fundamental_calculus/FundamentalCalculus/FundamentalCalculus.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /05-processing-data/ex_rectangle_properties/RectangleProperties/RectangleProperties.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /25-getters-setters-properties/super_string_theory/SuperStringTheory/SuperStringTheory.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /26-constructors/vector_from_start_to_end/VectorFromStartToEnd/VectorFromStartToEnd.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /03-starting-in-csharp/ch_hello_world/HelloWorld/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace HelloWorld 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | // Make it output Hello World 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /23-creating-and-using-objects/point_in_space/PointInSpace/Point.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace PointInSpace 6 | { 7 | public class Point 8 | { 9 | // TODO Needs implementation 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /26-constructors/things_are_complex/Solution/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Solution 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Hello World!"); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /03-starting-in-csharp/ch_developed_by/DevelopedBy/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DevelopedBy 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | // Write your implementation here 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /25-getters-setters-properties/third_rock_from_the_sun/ThirdRockFromTheSun/ThirdRockFromTheSun.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ideas.md: -------------------------------------------------------------------------------- 1 | Digital WaveForm generator using WPF charts. 2 | 3 | 4 | We zouden wel eens een oefening kunnen maken om bv. de spanning van een sinus te bepalen met een bepaalde DC-offset op een bepaald tijdstip. 5 | Kunnen we misschien zelfs voor verschillende golfvormen doen (blok, zaagtand, ...). -------------------------------------------------------------------------------- /03-starting-in-csharp/ch_personal_details/PersonalDetails/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace PersonalDetails 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | // Add implementation here 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /23-creating-and-using-objects/round_about/RoundAbout/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RoundAbout 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Hello World!"); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /23-creating-and-using-objects/point_in_space/PointInSpace/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace PointInSpace 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Please write some code here"); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /26-constructors/back_to_the_future/BackToTheFuture/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BackToTheFuture 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Hello World!"); 10 | 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /03-starting-in-csharp/ch_basic_syntax_error/README.md: -------------------------------------------------------------------------------- 1 | # Basic Syntax Error 2 | 3 | The application has a small syntax error. Find it and fix it. 4 | 5 | The application should output the following text to the terminal if you fixed the error: 6 | 7 | ```text 8 | Nice, you just fixed the application. 9 | ``` 10 | -------------------------------------------------------------------------------- /26-constructors/things_are_complex/ThingsAreComplex/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ThingsAreComplex 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Please add some demo code here!"); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /05-processing-data/ex_evaluation/Evaluation/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Evaluation 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Grader grader = new Grader(); 10 | grader.PrintToTerminal(); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /06-getting-user-data/student_id/StudentID/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace StudentID 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Student student = new Student(); 10 | student.PrintToTerminal(); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /25-getters-setters-properties/third_rock_from_the_sun/ThirdRockFromTheSun/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ThirdRockFromTheSun 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Hello World!"); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /24-defining-custom-classes/teach_the_teacher/TeachTheTeacher/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace TeachTheTeacher 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Please write your own main to test."); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /03-starting-in-csharp/ch_basic_syntax_error/BasicSyntaxError/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BasicSyntaxError 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Nice, you just fixed the application.") 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /03-starting-in-csharp/ch_java_programmer/JavaProgrammer/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace JavaProgrammer 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | System.out.println("I switched from Java to C# and this is my app."); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /03-starting-in-csharp/ch_my_first_app/README.md: -------------------------------------------------------------------------------- 1 | # My First App 2 | 3 | Open Visual Studio and make a new project yourself. Make sure to create a `Console App (.NET Core)`. Save the application in this directory. 4 | 5 | Output the following message to the terminal: 6 | 7 | ```text 8 | Awesome! My first C# project! 9 | ``` 10 | -------------------------------------------------------------------------------- /05-processing-data/ex_calculate_vat/CalculateVAT/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CalculateVAT 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Invoice invoice = new Invoice(); 10 | invoice.PrintToTerminal(); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /01-introduction/ch_making_a_sandwich/README.md: -------------------------------------------------------------------------------- 1 | # Making a Sandwich 2 | 3 | Describe the process of making a ham and cheese sandwich. Now imagine you had to explain it to a computer. Have you forgotten anything that would be obvious for us humans? 4 | 5 | ## Solution 6 | 7 | 8 | -------------------------------------------------------------------------------- /02-basic-building-blocks/ch_motorcycles/README.md: -------------------------------------------------------------------------------- 1 | # Motorcycle 2 | 3 | Imagine you needed to create a website to sell motorcycles. What data would you need to store about each motorcycle? Name at least 5 properties. Propose names for each variable. 4 | 5 | ## Solution 6 | 7 | 8 | -------------------------------------------------------------------------------- /04-storing-data/ex_csharp_land/CSharpLand/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CSharpLand 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | RollerCoaster coaster = new RollerCoaster(); 10 | coaster.ShowMinimumHeight(); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /01-introduction/ch_processor_architecture/README.md: -------------------------------------------------------------------------------- 1 | # Processor Architecture 2 | 3 | Search the Internet for the meaning of a "processor architecture". Find at least 3 different architectures. Try to find a small assembly example for each architecture. 4 | 5 | ## Solution 6 | 7 | 8 | -------------------------------------------------------------------------------- /02-basic-building-blocks/ch_rectangle_area/README.md: -------------------------------------------------------------------------------- 1 | # Rectangle Area 2 | 3 | Use a flowchart to model an application that calculates the `area` of a rectangle (`width` times `height`). Request the required data from the user and output the result back. 4 | 5 | ## Solution 6 | 7 | 8 | -------------------------------------------------------------------------------- /05-processing-data/ex_pizza_time/PizzaTime/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace PizzaTime 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | PizzaDivider pizzaDivider = new PizzaDivider(); 10 | pizzaDivider.PrintToTerminal(); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /28-interfaces/total-surface/TotalSurface/TotalSurface.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /01-introduction/ch_programming_languages/README.md: -------------------------------------------------------------------------------- 1 | # Programming Languages 2 | 3 | Search the Internet for 5 programming languages that you never heard of before. Try to find a small code example of each. Determine if the language is compiled or interpreted. 4 | 5 | ## Solution 6 | 7 | 8 | -------------------------------------------------------------------------------- /03-starting-in-csharp/ch_developed_by/README.md: -------------------------------------------------------------------------------- 1 | # Developed By 2 | 3 | Modify the application so it prints out a welcome message to the user. It should also print your name as shown below. 4 | 5 | Example output: 6 | 7 | ```text 8 | Hello and welcome to my Hello World in C#. 9 | This application was developed by Nico De Witte. 10 | ``` 11 | -------------------------------------------------------------------------------- /04-storing-data/ex_programming_bugs/ProgrammingBugs/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ProgrammingBugs 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | MessageOfTheDay message = new MessageOfTheDay(); 10 | message.ShowMessage(); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /03-starting-in-csharp/ex_need_a_break/NeedABreak/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace NeedABreak 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine"One programmer said to another:"); 10 | Console.WriteLine("I need a
); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /03-starting-in-csharp/ex_need_a_break/Solution/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Solution 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("One programmer said to another:"); 10 | Console.WriteLine("I need a
"); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /04-storing-data/ex_frame_delimiter/FrameDelimiter/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace FrameDelimiter 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Frame frame = new Frame(); 10 | frame.StartOfFrame(); 11 | frame.EndOfFrame(); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /05-processing-data/ex_rectangle_properties/RectangleProperties/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RectangleProperties 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Rectangle rectangle = new Rectangle(); 10 | rectangle.PrintToTerminal(); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /28-interfaces/generator-of-numbers/GeneratorOfNumbers/GeneratorOfNumbers.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /06-getting-user-data/the-metric-system/TheMetricSystem/TheMetricSystem.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /02-basic-building-blocks/ch_sum_of_numbers/README.md: -------------------------------------------------------------------------------- 1 | # Sum of Numbers 2 | 3 | Create a flowchart of a process that asks the user for 5 numbers. Make the sum of all the numbers the user gave. Output the result to the terminal. Also list the variables that you expect to need for this. 4 | 5 | ## Solution 6 | 7 | 8 | -------------------------------------------------------------------------------- /05-processing-data/ex_pythagoras/Pythagoras/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Pythagoras 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | RightHandTriangle triangle = new RightHandTriangle(); 10 | 11 | // If you wish you can add some demo code here 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /02-basic-building-blocks/ex_circle_circumference/README.md: -------------------------------------------------------------------------------- 1 | # Circle Circumference 2 | 3 | Use a flowchart to model an application that calculates the `circumference` of a circle. Request the `radius` of the circle from the user and output the result back. 4 | 5 | ![Circle Properties](./img/circle.png) 6 | 7 | ## Solution 8 | 9 | The solution can be found [here](./solution.md) 10 | -------------------------------------------------------------------------------- /04-storing-data/ex_marco_polo/MarcoPolo/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MarcoPolo 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | PersonalInformation info = new PersonalInformation(); 10 | info.FullName(); 11 | info.Age(); 12 | info.EyeColor(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /03-starting-in-csharp/ch_java_programmer/README.md: -------------------------------------------------------------------------------- 1 | # Java Programmers 2 | 3 | The problem with Java programmers is that they can't see sharp. This was an application developed by a Java programmer and he/she did not know the correct methods to output something to the terminal. Fix the code so the application output the following text: 4 | 5 | ```text 6 | I switched from Java to C# and this is my app. 7 | ``` 8 | -------------------------------------------------------------------------------- /02-basic-building-blocks/ex_bmi_adult_check/README.md: -------------------------------------------------------------------------------- 1 | # BMI Adult Check 2 | 3 | Extend the BMI example (section on operators) to ask the user for his/her age. If the persons age is below 18, output a message that the calculated BMI is not accurate as the person is not an adult. 4 | 5 | ![BMI Example](./img/flowchart_bmi.png) 6 | 7 | ## Solution 8 | 9 | The solution can be found [here](./solution.md) 10 | -------------------------------------------------------------------------------- /02-basic-building-blocks/ch_student_grader/README.md: -------------------------------------------------------------------------------- 1 | # Student Grader 2 | 3 | Model an application using a flowchart that asks the user to give his/her grade for a particular course. If its below average (`< 10`) output an encouraging message, if its above average give a well done. If it's a perfect score output an original message. 4 | 5 | ## Solution 6 | 7 | 8 | -------------------------------------------------------------------------------- /02-basic-building-blocks/ex_bmi_adult_check/solution.md: -------------------------------------------------------------------------------- 1 | # BMI Adult Check 2 | 3 | Extend the BMI example (section on operators) to ask the user for his/her age. If the persons age is below 18, output a message that the calculated BMI is not accurate as the person is not an adult. 4 | 5 | ![BMI Example](./img/flowchart_bmi.png) 6 | 7 | ## Solution 8 | 9 | ![BMI with Adult Check](./img/flowchart_bmi_adult_check.png) 10 | -------------------------------------------------------------------------------- /04-storing-data/ex_csharp_land/Tests/RollerCoasterTest.cs: -------------------------------------------------------------------------------- 1 | using CSharpLand; 2 | using System; 3 | using Xunit; 4 | 5 | namespace Tests 6 | { 7 | public class RollerCoasterTest 8 | { 9 | [Fact] 10 | public void TestMinimumHeight() 11 | { 12 | RollerCoaster coaster = new RollerCoaster(); 13 | Assert.Equal(1.30, coaster.ShowMinimumHeight(), 2); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /10-strings/words_everywhere/README.md: -------------------------------------------------------------------------------- 1 | # Words Everywhere 2 | 3 | Words Everywhere is a simple and user friendly app that counts the number of words in a text. 4 | 5 | Implement the method `CountWords(string text)` in the class `WordCounter` so it returns the number of words in the given text. 6 | 7 | ## Unit Tests 8 | 9 | This project has accompanying unit tests. See [xUnit Tests](/README.md#xunit-tests) on how to run them. 10 | -------------------------------------------------------------------------------- /03-starting-in-csharp/ch_personal_details/README.md: -------------------------------------------------------------------------------- 1 | # Personal Details 2 | 3 | Complete the application so it prints out some personal information about yourself, like for example: 4 | 5 | * your name 6 | * your age 7 | * your height 8 | * your weight 9 | * the color of your eyes 10 | * ... 11 | 12 | Try to concatenate strings with actual numbers like for example: 13 | 14 | ```csharp 15 | Console.WriteLine("I am " + 3.2 + " feet tall"); 16 | ``` 17 | -------------------------------------------------------------------------------- /50-introduction-to-wpf/hangman-refactored/HangmanRefactored/HangmanRefactored/HangmanRefactored.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | 7 | 8 | 9 | 10 | Always 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /03-starting-in-csharp/ex_need_a_break/README.md: -------------------------------------------------------------------------------- 1 | # Need a Break 2 | 3 | The application has two small syntax errors. Find them and fix them. 4 | 5 | The application should output the following text to the terminal if you fixed the errors: 6 | 7 | ```text 8 | One programmer said to another: 9 | I need a
10 | ``` 11 | 12 | ## Solution 13 | 14 | The solution can be found as a second project in the Visual Studio Solution under the name `Solution`. 15 | -------------------------------------------------------------------------------- /09-loops/apple_cake/AppleCake/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace AppleCake 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Welcome to the AppleCake generator"); 10 | AppleCakeGenerator generator = new AppleCakeGenerator(); 11 | string output = generator.Generate(1, 15); 12 | Console.WriteLine(output); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /09-loops/apple_cake/Solution/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Solution 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Welcome to the AppleCake generator"); 10 | AppleCakeGenerator generator = new AppleCakeGenerator(); 11 | string output = generator.Generate(1, 15); 12 | Console.WriteLine(output); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /07-methods/hail_c_sharp/README.md: -------------------------------------------------------------------------------- 1 | # Hail C Sharp 2 | 3 | It's time to tell C# what we think about it. I have prepared a method `HailCSharp` that outputs a statement about C# to the terminal. 4 | 5 | Call the method in `Main` so the following output is generated when the application runs: 6 | 7 | ```text 8 | C# is good starter language as its syntax is easy to learn. 9 | Microsoft first time use the name C# in 1988. 10 | C# can also be used to develop games. 11 | ``` 12 | -------------------------------------------------------------------------------- /02-basic-building-blocks/ex_cinema/solution.md: -------------------------------------------------------------------------------- 1 | # Cinema 2 | 3 | Take a look at the website of [Kinepolis](https://kinepolis.be). Name 5 properties of a film screening. Propose variable names for each. 4 | 5 | ## Solution 6 | 7 | | Property | Variable | 8 | | --- | --- | 9 | | Name of the movie | name | 10 | | Description of the movie | description | 11 | | Time of screenings | timeOfScreenings | 12 | | Genre of the movie | genre | 13 | | Duration of the movie | duration | 14 | -------------------------------------------------------------------------------- /03-starting-in-csharp/challenges.md: -------------------------------------------------------------------------------- 1 | ## Chapter 03 - Starting in Java - Challenges 2 | 3 | ### Personal Details 4 | 5 | Create an application that prints out some personal information about yourself, like for example: 6 | * your name 7 | * your age 8 | * your height 9 | * your weight 10 | * the color of your eyes 11 | * ... 12 | 13 | Try to concatenate strings with actual numbers like for example: 14 | ```java 15 | System.out.println("I am " + 3 + " feet tall"); 16 | ``` 17 | -------------------------------------------------------------------------------- /10-strings/reversal/README.md: -------------------------------------------------------------------------------- 1 | # Reversal 2 | 3 | This application allows the user to enter a tex. The application will then reverse the order of the characters and return the result to the user. 4 | 5 | Implement the method `Reverse(string text)` in the class `StringReverser` so it returns the given string with the characters reversed. 6 | 7 | ## Unit Tests 8 | 9 | This project has accompanying unit tests. See [xUnit Tests](/README.md#xunit-tests) on how to run them. 10 | -------------------------------------------------------------------------------- /10-strings/abbreviate_this/Solution/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Solution 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Welcome to Abbreviate Thhis ..."); 10 | 11 | Abbreviator abbr = new Abbreviator(); 12 | 13 | string text = "Laughing Out Loud"; 14 | Console.WriteLine($"{abbr.Abbreviate(text)} means {text}"); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /10-strings/abbreviate_this/AbbreviateThis/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace AbbreviateThis 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Welcome to Abbreviate Thhis ..."); 10 | 11 | Abbreviator abbr = new Abbreviator(); 12 | 13 | string text = "Laughing Out Loud"; 14 | Console.WriteLine($"{abbr.Abbreviate(text)} means {text}"); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /02-basic-building-blocks/ch_personalized_bmi/README.md: -------------------------------------------------------------------------------- 1 | # Personalized BMI 2 | 3 | Extend the BMI example (section on operators) to ask the user for his/her name and gender so a more personalized message can be outputted to the terminal. 4 | 5 | ![BMI Example](./img/flowchart_bmi.png) 6 | 7 | What if the person did not like to provide his/her name. How would you handle that? Can you model it in the flowchart? 8 | 9 | ## Solution 10 | 11 | 12 | -------------------------------------------------------------------------------- /05-processing-data/ex_fundamental_calculus/README.md: -------------------------------------------------------------------------------- 1 | # Fundamental Calculus 2 | 3 | This app models a basic calculator. Implement all the methods of the `Calculator` class so they return the correct values. 4 | 5 | The `Add()` method has already been implemented to provide you with an example. 6 | 7 | You can also extend the `Main()` with more code to test your implementation. 8 | 9 | ## Unit Tests 10 | 11 | This project has accompanying unit tests. See [xUnit Tests](/README.md#xunit-tests) on how to run them. 12 | -------------------------------------------------------------------------------- /10-strings/pattern_builder/README.md: -------------------------------------------------------------------------------- 1 | # Pattern Builder 2 | 3 | Create a new .NET Core app that can build a pattern as shown below. Let the user choose some options (for example `height` and `width`). Choose the pattern for yourself. 4 | 5 | * Rectangle 6 | 7 | ```text 8 | ******* 9 | ******* 10 | ******* 11 | ******* 12 | ******* 13 | ``` 14 | 15 | * Pyramid 16 | 17 | ```text 18 | * 19 | *** 20 | ***** 21 | ``` 22 | 23 | * Diamond 24 | 25 | ```text 26 | * 27 | *** 28 | ***** 29 | *** 30 | * 31 | ``` 32 | -------------------------------------------------------------------------------- /10-strings/palindrome/Palindrome/PalindromeChecker.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Palindrome 6 | { 7 | public class PalindromeChecker 8 | { 9 | public bool IsPalindrome(string word) 10 | { 11 | bool isPalindrome = false; 12 | 13 | // TODO Determine if word is a palindrome 14 | 15 | // Please dont change the code below (automatic unit tests) 16 | return isPalindrome; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /10-strings/words_everywhere/WordsEverywhere/WordCounter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace WordsEverywhere 6 | { 7 | public class WordCounter 8 | { 9 | public int CountWords(string text) 10 | { 11 | int numberOfWords = 0; 12 | 13 | // TODO Count the number of words in the text 14 | 15 | // Please dont change the code below (automatic unit tests) 16 | return numberOfWords; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /10-strings/holo_gram/HoloGram/PangramChecker.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace HoloGram 6 | { 7 | public class PangramChecker 8 | { 9 | public bool IsPangram(string text) 10 | { 11 | bool isAPangram = true; 12 | 13 | // TODO Check if text is a pangram and thereby contains all the letters of the alphabet 14 | // TODO Convert text to lowercase first 15 | 16 | return isAPangram; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /08-making-decisions/biggest_number/BiggestNumber/Biggest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace BiggestNumber 6 | { 7 | public class Biggest 8 | { 9 | public int DetermineBiggest(int first, int second, int third) 10 | { 11 | // TODO Determine the biggest number of the three 12 | int biggest = 0; 13 | 14 | // Please dont change the code below (automatic unit tests) 15 | return biggest; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /11-arrays/absolute_sum/AbsoluteSum/Summator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace AbsoluteSum 6 | { 7 | public class Summator 8 | { 9 | public int Sum(int[] values) 10 | { 11 | int sum = 0; 12 | 13 | // TODO Determine the absolute sum of all the numbers in the values array 14 | // TODO If the array does not contain any values (Length is 0), the result should be 0 15 | 16 | return sum; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /09-loops/greatest_common_factor/GreatestCommonFactor/MathHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GreatestCommonFactor 6 | { 7 | public class MathHelper 8 | { 9 | public int DetermineGreatestCommonFactor(int first, int second) 10 | { 11 | // TODO Determine the Greatest Common Factor 12 | int gcf = 0; 13 | 14 | // Please dont change the code below (automatic unit tests) 15 | return gcf; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /10-strings/reversal/Reversal/StringReverser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Reversal 6 | { 7 | public class StringReverser 8 | { 9 | public string Reverse(string text) 10 | { 11 | string reversed = ""; 12 | 13 | // TODO Reverse the character order of the text and put the result in reversed. 14 | 15 | // Please dont change the code below (automatic unit tests) 16 | return reversed; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /10-strings/parentheses_checker/ParenthesesChecker/CodeLinter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace ParenthesesChecker 6 | { 7 | public class CodeLinter 8 | { 9 | public bool HasMatchingParentheses(string code) 10 | { 11 | bool isValid = true; 12 | 13 | // TODO Determine if the code has matching parentheses 14 | 15 | // Please dont change the code below (automatic unit tests) 16 | return isValid; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /11-arrays/the_sum_of_all_numbers/TheSumOfAllNumbers/SumOfIntegers.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace TheSumOfAllNumbers 6 | { 7 | public class SumOfIntegers 8 | { 9 | public int CalculateSum(int[] numbers) 10 | { 11 | int sum = 0; 12 | 13 | // TODO Determine the sum of the numbers using a for loop 14 | 15 | 16 | // Please don't change the code below (automatic unit tests) 17 | return sum; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /09-loops/roll_em_all/README.md: -------------------------------------------------------------------------------- 1 | ### Roll Em All 2 | 3 | Create a new C# Console App (.NET Core) to simulate a dice throwing game. Allow the user of your application to select the number of throws that can be simulated and also the number of eyes for the throws. 4 | 5 | For example: 6 | 7 | ```text 8 | This is a dice throwing simulator. Select the number of throws you wish to simulate and the eyes of the dice to use. 9 | 10 | Number of throws to simulate? 3 11 | Number of eyes of the dice to use? 20 12 | 13 | Throw 1: 12 14 | Throw 2: 2 15 | Throw 3: 19 16 | ``` -------------------------------------------------------------------------------- /02-basic-building-blocks/ex_circle_circumference/solution.md: -------------------------------------------------------------------------------- 1 | # Circle Circumference 2 | 3 | Use a flowchart to model an application that calculates the `circumference` of a circle. Request the `radius` of the circle from the user and output the result back. 4 | 5 | ![Circle Properties](./img/circle.png) 6 | 7 | ## Solution 8 | 9 | While not strictly part of the instructions, it is a good idea to check user input. In this case checking if the radius is not negative is a good example. 10 | 11 | ![Circumference of a Circle](./img/flowchart_circle_circumference.png) 12 | -------------------------------------------------------------------------------- /08-making-decisions/rectangle_area/RectangleArea/Rectangle.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace RectangleArea 6 | { 7 | public class Rectangle 8 | { 9 | public double CalculateArea(double width, double height) 10 | { 11 | // TODO Calculate area if both width and height are positive, else set area to 0 12 | double area = -1; 13 | 14 | // Please dont change the code below (automatic unit tests) 15 | return area; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /10-strings/reversal/Reversal/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Reversal 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Welcome to the Super Duper String Reverser"); 10 | Console.Write("Please enter a text to reverse: "); 11 | string text = Console.ReadLine(); 12 | 13 | StringReverser reverser = new StringReverser(); 14 | 15 | Console.WriteLine($"\n{text}\n\nreversed:\n{reverser.Reverse(text)}"); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /10-strings/how_many_times/HowManyTimes/StringFinder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace HowManyTimes 6 | { 7 | public class StringFinder 8 | { 9 | public int SearchAndCount(string text, string word) 10 | { 11 | int numberOfOccurrences = 0; 12 | 13 | // TODO Count the number of times the word occurs in the text 14 | 15 | // Please dont change the code below (automatic unit tests) 16 | return numberOfOccurrences; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /10-strings/binary_nibble/BinaryNibble/NumberSystemConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace BinaryNibble 6 | { 7 | public class NumberSystemConverter 8 | { 9 | public string DecimalToBinary(int decimalValue) 10 | { 11 | // TODO Convert the decimal value to 12 | // binary string representation 13 | string binary = ""; 14 | 15 | // Please dont change the code below (automatic unit tests) 16 | return binary; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /28-interfaces/total-surface/TotalSurface/Square.cs: -------------------------------------------------------------------------------- 1 | namespace TotalSurface 2 | { 3 | class Square 4 | { 5 | public Square(double side) 6 | { 7 | Side = side; 8 | } 9 | 10 | public double GetArea() 11 | { 12 | return Side * Side; 13 | } 14 | 15 | private double side; 16 | public double Side 17 | { 18 | get { return side; } 19 | set { side = Math.Abs(value); } 20 | } 21 | 22 | public override string ToString() 23 | { 24 | return $" [side = {Side}]: {GetArea()} sq. meters"; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /04-storing-data/ex_frame_delimiter/Tests/FrameTest.cs: -------------------------------------------------------------------------------- 1 | using FrameDelimiter; 2 | using System; 3 | using Xunit; 4 | 5 | namespace Tests 6 | { 7 | public class FrameTest 8 | { 9 | [Fact] 10 | public void TestStartDelimiter() 11 | { 12 | Frame frame = new Frame(); 13 | Assert.Equal(0xAA, frame.StartOfFrame()); 14 | } 15 | 16 | [Fact] 17 | public void TestEndDelimiter() 18 | { 19 | Frame frame = new Frame(); 20 | Assert.Equal(0x55, frame.EndOfFrame()); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /05-processing-data/ex_pizza_time/README.md: -------------------------------------------------------------------------------- 1 | # Pizza Time 2 | 3 | This little app lets us divide slices of pizza among people. Everyone gets his/her fair share. 4 | 5 | Two methods need to implemented inside of the file `PizzaTime\PizzaDivider.cs`: 6 | 7 | * `HowManySlicesPerPerson()`: Should calculate how many slices everyone gets. Fairly divided. 8 | * `HowManySlicesLeft()`: Determines how many slices are left after everyone gets his/her fair share. 9 | 10 | ## Unit Tests 11 | 12 | This project has accompanying unit tests. See [xUnit Tests](/README.md#xunit-tests) on how to run them. 13 | -------------------------------------------------------------------------------- /08-making-decisions/drifting_years/DriftingYears/LeapYearChecker.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace DriftingYears 6 | { 7 | public class LeapYearChecker 8 | { 9 | public bool IsLeapYear(int year) 10 | { 11 | // TODO: Check if year is a leap year and 12 | // place the result in the boolean variable below 13 | bool isLeapYear = false; 14 | 15 | // Please dont change the code below (automatic unit tests) 16 | return isLeapYear; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /10-strings/abbreviate_this/AbbreviateThis/Abbreviator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace AbbreviateThis 6 | { 7 | public class Abbreviator 8 | { 9 | public string Abbreviate(string text) 10 | { 11 | string letters = ""; 12 | 13 | // TODO Convert text to an abbreviation 14 | // TODO Make sure that the end result contains upper-case letters only 15 | // TODO If text is empty, than so should letters be 16 | 17 | return letters; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /10-strings/holo_gram/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /10-strings/reversal/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /09-loops/apple_cake/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /09-loops/start_to_end/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /10-strings/not_my_mail/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /10-strings/palindrome/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /07-methods/hello_mister_roboto/HelloMisterRoboto/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace HelloMisterRoboto 4 | { 5 | class Program 6 | { 7 | // TODO Create a method called GreetTheUser that outputs the following 8 | // message to the terminal: 9 | // Hello, I am Mister Roboto. 10 | // I am the next-gen chat-bot created by VIVES students. 11 | 12 | static void Main(string[] args) 13 | { 14 | //TODO Call the GreetTheUser method here so the message 15 | // is shown when the application is launched 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /11-arrays/absolute_sum/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /26-constructors/quadratic/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /28-interfaces/total-surface/TotalSurface/Circle.cs: -------------------------------------------------------------------------------- 1 | namespace TotalSurface 2 | { 3 | class Circle 4 | { 5 | public Circle(double radius) 6 | { 7 | Radius = radius; 8 | } 9 | 10 | public double GetArea() 11 | { 12 | return Math.PI * Radius * Radius; 13 | } 14 | 15 | private double radius; 16 | public double Radius 17 | { 18 | get { return radius; } 19 | set { radius = Math.Abs(value); } 20 | } 21 | 22 | public override string ToString() 23 | { 24 | return $" [radius = {Radius}]: {GetArea()} sq. meters"; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /04-storing-data/ex_csharp_land/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /04-storing-data/ex_marco_polo/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /05-processing-data/ex_pizza_time/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /06-getting-user-data/student_id/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /07-methods/toss_a_die_to_your_witcher/README.md: -------------------------------------------------------------------------------- 1 | # Toss a Die to Your Witcher 2 | 3 | This app simulates a die throw which can be used for boardgames. It generates a value between `0` and `6`. However the application developer forgot to actually call the method that generates the die throw. 4 | 5 | Fix the application by calling the method `ThrowDie` in `Main` and store the result in the variable `dieValue` which is then outputted to the terminal. 6 | 7 | Expected Output: 8 | 9 | ```text 10 | Throwing a die ... 11 | Cool, we threw 3 12 | ``` 13 | 14 | Ofcourse the thrown value changes everytime you run the application. 15 | -------------------------------------------------------------------------------- /09-loops/series_of_squares/SeriesOfSquares/SquaredSeries.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace SeriesOfSquares 6 | { 7 | public class SquaredSeries 8 | { 9 | public static int SeriesSum(int n) 10 | { 11 | // TODO - Determine the sum of a squared series using a simple loop 12 | return -1; 13 | } 14 | 15 | public static int CalculateSumSeries(int n) 16 | { 17 | // TODO - Determine the sum using the formula for a squared series 18 | return -1; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /10-strings/binary_coding/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /10-strings/binary_nibble/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /10-strings/how_many_times/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /11-arrays/turn_the_tables/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /04-storing-data/ex_programming_bugs/Tests/UnitTestMessageOfTheDay.cs: -------------------------------------------------------------------------------- 1 | using ProgrammingBugs; 2 | using System; 3 | using Xunit; 4 | 5 | namespace Tests 6 | { 7 | public class UnitTestMessageOfTheDay 8 | { 9 | [Fact] 10 | public void TestShowMessage() 11 | { 12 | MessageOfTheDay message = new MessageOfTheDay(); 13 | Assert.Equal("If debugging is the process of removing software bugs, " + 14 | "then programming must be the process of putting them in.\n" + 15 | "\tBy \"Edsger Dijkstra\"", message.ShowMessage()); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /05-processing-data/ex_evaluation/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /05-processing-data/ex_pythagoras/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /06-getting-user-data/time_machine/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /08-making-decisions/biggest_number/BiggestNumber/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BiggestNumber 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Biggest biggest = new Biggest(); 10 | 11 | Console.WriteLine($"The biggest number of (1, -3, 104) = {biggest.DetermineBiggest(1, -3, 104)}"); 12 | Console.WriteLine($"The biggest number of (-5, 11, 3) = {biggest.DetermineBiggest(-5, 11, 3)}"); 13 | Console.WriteLine($"The biggest number of (0, 109, 66) = {biggest.DetermineBiggest(0, 109, 66)}"); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /10-strings/abbreviate_this/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /10-strings/palindrome/Palindrome/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Palindrome 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Welcome to Palindrome"); 10 | Console.Write("Please enter a word to check: "); 11 | string word = Console.ReadLine(); 12 | 13 | PalindromeChecker checker = new PalindromeChecker(); 14 | bool isPalindrome = checker.IsPalindrome(word); 15 | 16 | Console.WriteLine($"\n{word} is{(isPalindrome ? "" : " not")} a palindrome"); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /10-strings/text_properties/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /05-processing-data/ex_calculate_vat/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /05-processing-data/ex_pythagoras/README.md: -------------------------------------------------------------------------------- 1 | # Pythagoras 2 | 3 | Search the Internet for the Pythagorean theorem. It is a mathematical relation between the lengths of the sides of right hand triangles. 4 | 5 | The formula is: 6 | 7 | ![Formula Pythagoras](./img/formula.png) 8 | 9 | The class `RightHandTriangle` defines three methods (`DetermineA()`, `DetermineB()` and `DetermineC()`) to calculate the different side length if the other two are given. Implement the formulas so the Unit tests pass. 10 | 11 | ## Unit Tests 12 | 13 | This project has accompanying unit tests. See [xUnit Tests](/README.md#xunit-tests) on how to run them. 14 | -------------------------------------------------------------------------------- /08-making-decisions/biggest_number/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /08-making-decisions/drifting_years/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /08-making-decisions/rectangle_area/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /10-strings/words_everywhere/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /11-arrays/biggest_of_them_all/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /11-arrays/strings_to_numbers/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /23-creating-and-using-objects/round_about/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /04-storing-data/ex_frame_delimiter/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /04-storing-data/ex_programming_bugs/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /08-making-decisions/converternator/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /08-making-decisions/coordinate_plane/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /10-strings/parentheses_checker/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /10-strings/replace_performance/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /26-constructors/things_are_complex/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /09-loops/greatest_common_factor/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /11-arrays/the_sum_of_all_numbers/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /23-creating-and-using-objects/point_in_space/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /04-storing-data/ex_csharp_land/README.md: -------------------------------------------------------------------------------- 1 | # RollerCoaster 2 | 3 | The C# RollerCoaster app is an app that informs the passengers of the minimum required height to rider the rollercoaster. However, a small bug has slipped into the code and the programmer did not initialize the variable correctly that stores the minimum height. 4 | 5 | Please correct the mistake and set the minimum required height to `1m and 30cm`. 6 | 7 | Change the code in the method `ShowMinimumHeight` in the file `CSharpLand\RollerCoaster.cs`. 8 | 9 | ## Unit Tests 10 | 11 | This project has accompanying unit tests. See [xUnit Tests](/README.md#xunit-tests) on how to run them. 12 | -------------------------------------------------------------------------------- /08-making-decisions/led_series_resistor/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /24-defining-custom-classes/teach_the_teacher/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /05-processing-data/ex_fundamental_calculus/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /05-processing-data/ex_rectangle_properties/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /26-constructors/vector_from_start_to_end/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /09-loops/start_to_end/StartToEnd/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace StartToEnd 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Series series = new Series(); 10 | Console.WriteLine("This app can sum a series of numbers."); 11 | 12 | Console.WriteLine($"\nSum(1, 5) results in {series.Sum(1, 5)}"); 13 | Console.WriteLine($"Sum(0, 0) results in {series.Sum(0, 0)}"); 14 | Console.WriteLine($"Sum(1, 2, 8) results in {series.Sum(1, 2, 8)}"); 15 | 16 | Console.WriteLine("\nThanks for using our app."); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /10-strings/binary_coding/Solution/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Solution 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Binary converter can convert a binary number to decimal."); 10 | 11 | Console.WriteLine("Try it out. Just enter a binary value here: "); 12 | string binary = Console.ReadLine().Trim(); 13 | 14 | BinaryConverter converter = new BinaryConverter(); 15 | int decimalValue = converter.ToDecimal(binary); 16 | Console.WriteLine($"This equals {decimalValue}"); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /10-strings/binary_coding/BinaryCoding/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BinaryCoding 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Binary converter can convert a binary number to decimal."); 10 | 11 | Console.WriteLine("Try it out. Just enter a binary value here: "); 12 | string binary = Console.ReadLine().Trim(); 13 | 14 | BinaryConverter converter = new BinaryConverter(); 15 | int decimalValue = converter.ToDecimal(binary); 16 | Console.WriteLine($"This equals {decimalValue}"); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /10-strings/words_everywhere/WordsEverywhere/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace WordsEverywhere 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Welcome to the Word Counter App."); 10 | Console.WriteLine("Please enter a text. This app will then count the number of words."); 11 | Console.WriteLine("Your text:"); 12 | string text = Console.ReadLine(); 13 | 14 | WordCounter counter = new WordCounter(); 15 | 16 | Console.WriteLine($"\nThe text contains {counter.CountWords(text)} words"); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /10-strings/not_my_mail/NotMyMail/EmailValidator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace NotMyMail 6 | { 7 | public class EmailValidator 8 | { 9 | public bool IsValidEmail(string email) 10 | { 11 | bool isValid = false; 12 | 13 | // TODO Check if email contains an @ 14 | // TODO Check if email contains a . after the @ with at least 1 letter in between 15 | // TODO Check if at least 1 letter proceeds the @ 16 | // TODO Check if at least 1 letter is present after the last . 17 | 18 | return isValid; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /10-strings/palindrome/README.md: -------------------------------------------------------------------------------- 1 | # Palindrome 2 | 3 | A palindrome is a word, number or phrase of characters which reads the same backward as forward, such as `radar` or `madam` or `racecar` or the number `10801`. 4 | 5 | Implement the method `IsPalindrome(string word)` in the class `Palindrome` so it returns a boolean value indicating if the string is a palindrome or not. 6 | 7 | Make sure to convert the word to lowercase before starting your check. You should also apply the `Trim()` method to remove all whitespace before and after the word. 8 | 9 | ## Unit Tests 10 | 11 | This project has accompanying unit tests. See [xUnit Tests](/README.md#xunit-tests) on how to run them. 12 | -------------------------------------------------------------------------------- /11-arrays/multiples_of_three/README.md: -------------------------------------------------------------------------------- 1 | # Multiples of Three 2 | 3 | Multiples of Three is a small application that can output the multiples of the number 3. Simple but effective. 4 | 5 | Implement the method `generate()` in `MultipleGenerator` so it generates the array of integers. 6 | 7 | ## Expected Output 8 | 9 | ```text 10 | Welcome to Multiples of Three ... 11 | This app prints out the first 10 multiples of three 12 | 13 | List of multiples: 14 | 3 6 9 12 15 18 21 24 27 30 15 | 16 | Thank you for using Multiples of Three 17 | ``` 18 | 19 | ## Unit Tests 20 | 21 | This project has accompanying unit tests. See [xUnit Tests](/README.md#xunit-tests) on how to run them. 22 | -------------------------------------------------------------------------------- /07-methods/hail_c_sharp/HailCSharp/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace HailCSharp 4 | { 5 | class Program 6 | { 7 | static void HailCSharp() 8 | { 9 | Console.WriteLine("C# is good starter language as its syntax is easy to learn."); 10 | Console.WriteLine("Microsoft used the name C# for the first time in 1988."); 11 | Console.WriteLine("C# can also be used to develop games."); 12 | } 13 | 14 | static void Main(string[] args) 15 | { 16 | // TODO Call the HailCSharp method here so it outputs 17 | // its statements to the terminal. 18 | 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /01-introduction/ch_biggest_number_in_a_list/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Biggest Number in a List 3 | description: Document the process of finding the biggest number in a list. 4 | details: ./01_introduction/ch_biggest_number_in_a_list/README.md 5 | difficulty: Hard 6 | solution: false 7 | unitTests: false 8 | keywords: algorithm 9 | solved: false 10 | notes: 11 | --- 12 | 13 | # Biggest Number in a List 14 | 15 | Imagine you had a list of numbers: `1, 18, 5, 12, 11, 0, 33, 105, 20, 88, 9, 32`. How would you determine the biggest number? Document the algorithm in plain English how you would achieve this. 16 | 17 | ## Solution 18 | 19 | -------------------------------------------------------------------------------- /11-arrays/multiples_of_three/MultiplesOfThree/MultipleGenerator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace MultiplesOfThree 6 | { 7 | public class MultipleGenerator 8 | { 9 | public int[] generate() 10 | { 11 | // TODO - Create an array of 10 integers (remove the null assignment) 12 | int[] multiples = null; 13 | 14 | // TODO - Fill the array with the first 10 multiples of 3. Start with 3 itself 15 | // So: 3 6 9 ... 16 | 17 | // Please don't change the code below (automatic unit tests) 18 | return multiples; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /10-strings/how_many_times/README.md: -------------------------------------------------------------------------------- 1 | # How Many Times 2 | 3 | This app allows a user to enter a text and a word. The app will search the text for the word and count how many times the word appears in the text. 4 | 5 | Well at least that's the idea, but the functionality is not there yet. 6 | 7 | Implement the method `SearchAndCount(string text, string word)` in the class `StringFinder` to search and count the number of occurrences of the string `word` inside the `text`. 8 | 9 | The implementation should treat lowercase and uppercase versions the same. 10 | 11 | ## Unit Tests 12 | 13 | This project has accompanying unit tests. See [xUnit Tests](/README.md#xunit-tests) on how to run them. 14 | -------------------------------------------------------------------------------- /10-strings/holo_gram/Tests/UnitTestPangramChecker.cs: -------------------------------------------------------------------------------- 1 | using HoloGram; 2 | using System; 3 | using Xunit; 4 | 5 | namespace Tests 6 | { 7 | public class UnitTestPangramChecker 8 | { 9 | private PangramChecker checker = new PangramChecker(); 10 | 11 | [Fact] 12 | public void TestIsPangram() 13 | { 14 | Assert.True(checker.IsPangram("Op brute wijze ving de schooljuf de quasi kalme lynx")); 15 | Assert.True(checker.IsPangram("The quick brown fox jumps over the lazy dog")); 16 | Assert.False(checker.IsPangram("Dude dit is totaal geen Pangram")); 17 | Assert.False(checker.IsPangram("")); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /11-arrays/multiples_of_three/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /11-arrays/strings_to_numbers/StringsToNumbers/StringArrayConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace StringsToNumbers 6 | { 7 | public class StringArrayConverter 8 | { 9 | public int[] ConvertToIntegers(string[] stringValues) 10 | { 11 | // TODO Create an array of integers with the same size as the stringValues array 12 | int[] numbers = null; 13 | 14 | // TODO Convert each string in stringValues to an integer and store the result in numbers 15 | 16 | // Please don't change the code below (automatic unit tests) 17 | return numbers; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /09-loops/fibonacci_sequence/README.md: -------------------------------------------------------------------------------- 1 | # Fibonacci Sequence 2 | 3 | Create an application that calculates the first 20 numbers of the Fibonacci sequence and outputs them to the terminal. Calculate the sum of the numbers. It should be `17710`. 4 | 5 | In mathematics, the Fibonacci numbers are the numbers in the following integer sequence, called the Fibonacci sequence, and characterized by the fact that, every number after the first two is the sum of the two preceding ones. Start the series at the number 1. 6 | 7 | Example: 8 | 9 | ```text 10 | 1, 1, 2, 3, 5, 8, ... 11 | ``` 12 | 13 | Once finished extend the application by letting the user decide at the start of your application how many numbers to generate. 14 | -------------------------------------------------------------------------------- /05-processing-data/ex_rectangle_properties/README.md: -------------------------------------------------------------------------------- 1 | # Rectangle Properties 2 | 3 | This application was build to determine the `area` and `circumference` of a rectangle. However the previous student programming this app forgot the formulas for both. 4 | 5 | Both calculations need to be implemented in the methods `CalculateArea` and `CalculateCircumference` in the file `RectangleProperties\Rectangle.cs`. 6 | 7 | Expected output: 8 | 9 | ```text 10 | Rectangle: 3cm by 8cm 11 | The rectangle has an area of 24sq centimeters. 12 | The rectangle has an circumference of 22 centimeters. 13 | ``` 14 | 15 | ## Unit Tests 16 | 17 | This project has accompanying unit tests. See [xUnit Tests](/README.md#xunit-tests) on how to run them. 18 | -------------------------------------------------------------------------------- /05-processing-data/ex_calculate_vat/README.md: -------------------------------------------------------------------------------- 1 | # Calculate VAT 2 | 3 | When buying a product in the store you always need to pay VAT (taxes). Take for example a pair of shoes that costs 100eur net, you actually pay 121eur. On top of your net price, comes 21% VAT. 4 | 5 | This application should allow you to calculate the VAT you need to pay. Implement the method `GetVAT` inside the file `CalculateVAT\Invoice.vs`. 6 | 7 | Example output: 8 | 9 | ```text 10 | For a net value of 250euro 11 | you need to pay 21% VAT. 12 | So the total price you pay is 13 | 250euro + 52.5euro = 302.5euro 14 | ``` 15 | 16 | ## Unit Tests 17 | 18 | This project has accompanying unit tests. See [xUnit Tests](/README.md#xunit-tests) on how to run them. 19 | -------------------------------------------------------------------------------- /05-processing-data/ex_pythagoras/Tests/UnitTestRightHandTriangle.cs: -------------------------------------------------------------------------------- 1 | using Pythagoras; 2 | using System; 3 | using Xunit; 4 | 5 | namespace Tests 6 | { 7 | public class UnitTestRightHandTriangle 8 | { 9 | RightHandTriangle uut = new RightHandTriangle(); 10 | 11 | [Fact] 12 | public void TestASide() 13 | { 14 | Assert.Equal(3, uut.DetermineA(4, 5), 2); 15 | } 16 | 17 | [Fact] 18 | public void TestBSide() 19 | { 20 | Assert.Equal(3, uut.DetermineB(4, 5), 2); 21 | } 22 | 23 | [Fact] 24 | public void TestCSide() 25 | { 26 | Assert.Equal(5, uut.DetermineC(3, 4), 2); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /08-making-decisions/drifting_years/Tests/UnitTestLeapYearChecker.cs: -------------------------------------------------------------------------------- 1 | using DriftingYears; 2 | using System; 3 | using Xunit; 4 | 5 | namespace Tests 6 | { 7 | public class UnitTestLeapYearChecker 8 | { 9 | LeapYearChecker uut = new LeapYearChecker(); 10 | 11 | [Fact] 12 | public void TestIsLeapYear() 13 | { 14 | Assert.True(uut.IsLeapYear(1600)); 15 | Assert.True(uut.IsLeapYear(2000)); 16 | Assert.True(uut.IsLeapYear(2004)); 17 | Assert.True(uut.IsLeapYear(1904)); 18 | 19 | Assert.False(uut.IsLeapYear(1700)); 20 | Assert.False(uut.IsLeapYear(1800)); 21 | Assert.False(uut.IsLeapYear(1900)); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /08-making-decisions/rectangle_area/Tests/UnitTestRectangle.cs: -------------------------------------------------------------------------------- 1 | using RectangleArea; 2 | using System; 3 | using Xunit; 4 | 5 | namespace Tests 6 | { 7 | public class UnitTestRectangle 8 | { 9 | Rectangle rectangle = new Rectangle(); 10 | 11 | [Fact] 12 | public void TestPositiveValues() 13 | { 14 | Assert.Equal(150, rectangle.CalculateArea(10, 15), 2); 15 | } 16 | 17 | [Fact] 18 | public void TestNegativeValues() 19 | { 20 | Assert.Equal(0, rectangle.CalculateArea(-10, 15), 2); 21 | Assert.Equal(0, rectangle.CalculateArea(10, -15), 2); 22 | Assert.Equal(0, rectangle.CalculateArea(-10, -15), 2); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /10-strings/binary_coding/BinaryCoding/BinaryConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace BinaryCoding 6 | { 7 | public class BinaryConverter 8 | { 9 | public int ToDecimal(string binary) 10 | { 11 | int decimalValue = 0; 12 | 13 | // TODO Convert the binary value in the variabel binary 14 | // to a decimal value 15 | // 16 | // Do note that it contain spaces, ignore these. 17 | // 18 | // It cal also start with a character 'b' which 19 | // should also be ignored. 20 | // Ex.: b1001 0101 21 | 22 | return decimalValue; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /10-strings/text_properties/README.md: -------------------------------------------------------------------------------- 1 | # String Properties 2 | 3 | String Properties is an application that can analyze a user inputted string and determine some properties about that string. 4 | 5 | It can determine: 6 | 7 | * the number of vowels (`a`, `e`, ...) 8 | * the number of consonants (`s`, `r`, ...) 9 | * the number of digits (`1`, `2`, ...) 10 | * the number of lowercase letters (`s`, `a`, ...) 11 | * the number of uppercase letters (`S`, `A`, ...) 12 | * the number of whitespace characters (` `, `n`, `\t`) 13 | 14 | Implement each of these analyses in the corresponding methods inside of the class `StringAnalyzer`. 15 | 16 | ## Unit Tests 17 | 18 | This project has accompanying unit tests. See [xUnit Tests](/README.md#xunit-tests) on how to run them. 19 | -------------------------------------------------------------------------------- /08-making-decisions/coordinate_plane/CoordinatePlane/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CoordinatePlane 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Welcome to the Coordinate Plane App"); 10 | 11 | // TODO Request point coordinates from user 12 | 13 | // Create point 14 | Point point = new Point(); 15 | point.X = 0; // Set user value 16 | point.Y = 0; // Set user value 17 | 18 | // TODO Output in which quadrant the point lies 19 | // Warning! Output different message if it lies in the origin 20 | string quadrant = point.Quadrant(); 21 | 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /07-methods/hello_mister_roboto/README.md: -------------------------------------------------------------------------------- 1 | # Hello Mister Roboto 2 | 3 | Hello Mister Roboto is the start of Bot in C#. It is a project created by a former student but it actually never really did anything. To encourage students to continue the project the application should at least output a welcome message to the user. 4 | 5 | First create a method `GreetTheUser()` that outputs the following message to the terminal: 6 | 7 | ```text 8 | Hello, I am Mister Roboto. 9 | I am the next-gen chat-bot created by VIVES students. 10 | ``` 11 | 12 | Call the method from the main application so the message is outputted if the application runs. 13 | 14 | Expected Output: 15 | 16 | ```text 17 | Hello, I am Mister Roboto. 18 | I am the next-gen chat-bot created by VIVES students. 19 | ``` 20 | -------------------------------------------------------------------------------- /11-arrays/turn_the_tables/TurnTheTables/ArrayMultiplier.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace TurnTheTables 6 | { 7 | public class ArrayMultiplier 8 | { 9 | public int[] Multiply(int[] left, int[] right) 10 | { 11 | // TODO Create an array of int 12 | // For its size take either the length of left or right (both should be the same size) 13 | int[] result = null; 14 | 15 | // TODO Multiply the elements in left with the elements in right. 16 | // Place the result in the result array. 17 | 18 | 19 | // Please don't change the code below (automatic unit tests) 20 | return result; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /09-loops/number_manipulator/NumberManipulator/Manipulator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace NumberManipulator 6 | { 7 | public class Manipulator 8 | { 9 | public static int Reverse(int value) 10 | { 11 | // TODO - Reverse the digits back to front 12 | return -1; 13 | } 14 | 15 | public static int Complement(int value) 16 | { 17 | // TODO - Calculate the complement by subtracting each digit from '9' 18 | return -1; 19 | } 20 | 21 | public static int DigitSum(int value) 22 | { 23 | // TODO - Determine the sum of the individual digits 24 | return -1; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /04-storing-data/ex_marco_polo/README.md: -------------------------------------------------------------------------------- 1 | # Marco Polo 2 | 3 | This application tries to display some personal information about a guy named "Marco Polo". However, some parts of the code are not finished yet. 4 | 5 | There are three methods in the file `MarcoPolo\PersonalInformation.cs` that need some extra work: 6 | 7 | * `FullName`: Concatenate `firstname` and `lastname` and assign the result to the variable `fullname` 8 | * `Age`: Initialize `age` to 19 9 | * `EyeColor`: Set the color of my eyes to blue 10 | 11 | Expected output: 12 | 13 | ```text 14 | Hello, I am Marco Polo 15 | I am 19 years of age. 16 | I have fancy blue colored eyes. 17 | ``` 18 | 19 | ## Unit Tests 20 | 21 | This project has accompanying unit tests. See [xUnit Tests](/README.md#xunit-tests) on how to run them. 22 | -------------------------------------------------------------------------------- /08-making-decisions/converternator/Converternator/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Converternator 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | // TODO Build an application that allows the user to convert units. 10 | // Request action from the user by showing him/her the following options 11 | // 1. Miles to kilometers 12 | // 2. Kilometers to miles 13 | // 3. Pounds to kilograms 14 | // 4. Kilograms to pounds 15 | // 5. Exit 16 | 17 | // Converter object 18 | Converter converter = new Converter(); 19 | 20 | // Example useage: 21 | // double miles = converter.KilometerToMile(34); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /10-strings/binary_nibble/BinaryNibble/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BinaryNibble 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Welcome to the Binary Nibble."); 10 | 11 | int value = 0; 12 | do 13 | { 14 | Console.Write("Please enter a positive value[0, 255]: "); 15 | value = Convert.ToInt32(Console.ReadLine()); 16 | } while (value < 0 || value > 255); 17 | 18 | NumberSystemConverter converter = new NumberSystemConverter(); 19 | string binary = converter.DecimalToBinary(value); 20 | 21 | Console.WriteLine($"The decimal value {value}, is represented in binary as: {binary}"); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /10-strings/holo_gram/Solution/PangramChecker.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Solution 6 | { 7 | public class PangramChecker 8 | { 9 | public bool IsPangram(string text) 10 | { 11 | bool isAPangram = true; 12 | 13 | // TODO Check if text is a pangram and thereby contains all the letters of the alphabet 14 | // TODO Convert text to lowercase first 15 | 16 | char ch = 'a'; 17 | while (isAPangram && ch <= 'z') 18 | { 19 | if (text.IndexOf(ch) < 0) 20 | { 21 | isAPangram = false; 22 | } 23 | ch++; 24 | } 25 | 26 | return isAPangram; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /10-strings/parentheses_checker/ParenthesesChecker/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ParenthesesChecker 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Welcome to the C# Parentheses Checker"); 10 | Console.WriteLine("Please enter a single line of code below to check:"); 11 | string code = Console.ReadLine(); 12 | 13 | CodeLinter linter = new CodeLinter(); 14 | if (linter.HasMatchingParentheses(code)) 15 | { 16 | Console.WriteLine($"\nThe code snippet is valid."); 17 | } 18 | else 19 | { 20 | Console.WriteLine($"\nThe code snippet contains unmatched parentheses."); 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /08-making-decisions/coordinate_plane/CoordinatePlane/Point.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace CoordinatePlane 6 | { 7 | public class Point 8 | { 9 | double x = 0; 10 | double y = 0; 11 | 12 | public string Quadrant() 13 | { 14 | // TODO Determine the quadrant of the coordinates 15 | // first, second, third, fourth or origin (if both 0) 16 | string quadrant = ""; 17 | 18 | // Please dont change the code below (automatic unit tests) 19 | return quadrant; 20 | } 21 | 22 | // Properties - Dont change code below 23 | public double X { get { return x; } set { x = value; } } 24 | public double Y { get { return y; } set { y = value; } } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /04-storing-data/ex_marco_polo/Tests/TestPersonalInformation.cs: -------------------------------------------------------------------------------- 1 | using MarcoPolo; 2 | using System; 3 | using Xunit; 4 | 5 | namespace Tests 6 | { 7 | public class UnitTestPersonalInformation 8 | { 9 | [Fact] 10 | public void TestName() 11 | { 12 | PersonalInformation info = new PersonalInformation(); 13 | Assert.Equal("Marco Polo", info.FullName()); 14 | } 15 | 16 | [Fact] 17 | public void TestAge() 18 | { 19 | PersonalInformation info = new PersonalInformation(); 20 | Assert.Equal(19, info.Age()); 21 | } 22 | 23 | [Fact] 24 | public void TestEyeColor() 25 | { 26 | PersonalInformation info = new PersonalInformation(); 27 | Assert.Equal("blue", info.EyeColor()); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /11-arrays/the_sum_of_all_numbers/README.md: -------------------------------------------------------------------------------- 1 | # The Sum of All Numbers 2 | 3 | The Sum of All Numbers is a small application that can determine the sum of an array of integers inputted by the user. 4 | 5 | Implement the method `int CalculateSum(int[] numbers)` in `SumOfIntegers` so it calculates the sum from the array of integers. Use a for-loop construct to do this. 6 | 7 | ## Expected Output 8 | 9 | ```text 10 | Welcome to The Sum of All Numbers ... 11 | This app can calculate the sum of an array of integers. 12 | 13 | Please enters numbers separated by spaces. 14 | Once finished, hit enter. 15 | 16 | Numbers: 9 -5 12 0 13 100 17 | 18 | The sum equals 129 19 | 20 | Thank you for using The Sum of All Numbers 21 | ``` 22 | 23 | ## Unit Tests 24 | 25 | This project has accompanying unit tests. See [xUnit Tests](/README.md#xunit-tests) on how to run them. 26 | -------------------------------------------------------------------------------- /10-strings/how_many_times/HowManyTimes/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace HowManyTimes 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Welcome to How Many Times ..."); 10 | Console.WriteLine("This app can determine the number of occurrences of a word inside a text."); 11 | Console.WriteLine("Please enter a text:"); 12 | string text = Console.ReadLine(); 13 | Console.Write("Please enter a word to search for: "); 14 | string word = Console.ReadLine(); 15 | 16 | StringFinder finder = new StringFinder(); 17 | 18 | int times = finder.SearchAndCount(text, word); 19 | Console.WriteLine($"\nThe word \"{word}\" was found {times} times inside the text"); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /10-strings/not_my_mail/Solution/EmailValidator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Solution 6 | { 7 | public class EmailValidator 8 | { 9 | public bool IsValidEmail(string email) 10 | { 11 | bool isValid = false; 12 | 13 | // TODO Check if email contains an @ 14 | // TODO Check if email contains a . after the @ with at least 1 letter in between 15 | // TODO Check if at least 1 letter proceeds the @ 16 | // TODO Check if at least 1 letter is present after the last . 17 | 18 | int at = email.IndexOf("@"); 19 | int dot = email.LastIndexOf("."); 20 | 21 | isValid = (at > 1 && dot > (at + 1) && dot < email.Length - 1); 22 | 23 | return isValid; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /04-storing-data/ex_programming_bugs/README.md: -------------------------------------------------------------------------------- 1 | # Programming Bugs 2 | 3 | This little application shows a funny message of the day. Or is was suppose to do this. 4 | 5 | The method `ShowMessage` in the file `ProgrammingBugs\MessageOfTheDay.s` need further implementation. The message and author are already there. But they are suppose to be concatenated in a bit of a special way. Don't change the original variables `message` and `author`. The author is prefixed with a tab-character to make it indented and also surrounded with double quotes. 6 | 7 | Expected output: 8 | 9 | ```text 10 | If debugging is the process of removing software bugs, then programming must be the process of putting them in. 11 | By "Edsger Dijkstra" 12 | ``` 13 | 14 | ## Unit Tests 15 | 16 | This project has accompanying unit tests. See [xUnit Tests](/README.md#xunit-tests) on how to run them. 17 | -------------------------------------------------------------------------------- /04-storing-data/ex_programming_bugs/ProgrammingBugs/MessageOfTheDay.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace ProgrammingBugs 6 | { 7 | public class MessageOfTheDay 8 | { 9 | public string ShowMessage() 10 | { 11 | string message = "If debugging is the process of removing software bugs, " + 12 | "then programming must be the process of putting them in."; 13 | 14 | string author = "Edsger Dijkstra"; 15 | 16 | // TODO: Add quoted author to the message (on a new line), also prefix author with tab 17 | string authoredMessage = ""; 18 | 19 | Console.WriteLine(authoredMessage); 20 | 21 | // Please dont change the code below (automatic unit tests) 22 | return authoredMessage; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /05-processing-data/ex_evaluation/README.md: -------------------------------------------------------------------------------- 1 | # Evaluation 2 | 3 | The evaluation app is a tool that calculates the average score and total score of a student for the course "Introduction to Programming". The total score is however not equal to the average but takes the following distribution into account: 4 | 5 | * The exam counts for `40%` of the total score 6 | * The lab counts for `60%` of the total score 7 | 8 | Both the average and total score should return a value based on a score of `/20`. You can find the methods inside of the file `Evaluation\Grader.cs`. 9 | 10 | Example: 11 | 12 | ```text 13 | Lenny Dermond: 14 | Exam Score: 13.5/20 15 | LAB Score: 16.2/20 16 | Average Score: 14.85 17 | Total Score: 15.12 18 | ``` 19 | 20 | ## Unit Tests 21 | 22 | This project has accompanying unit tests. See [xUnit Tests](/README.md#xunit-tests) on how to run them. 23 | -------------------------------------------------------------------------------- /11-arrays/absolute_sum/Tests/UnitTestSummator.cs: -------------------------------------------------------------------------------- 1 | using AbsoluteSum; 2 | using System; 3 | using Xunit; 4 | 5 | namespace Tests 6 | { 7 | public class UnitTest1 8 | { 9 | private Summator summator = new Summator(); 10 | 11 | [Fact] 12 | public void TestBasicSeries() 13 | { 14 | int[] values = { 1, 5, -3, 12, 0, 77, 8 }; 15 | Assert.Equal(106, summator.Sum(values)); 16 | } 17 | 18 | [Fact] 19 | public void TestAdvancedSeries() 20 | { 21 | int[] zeros = { 0, 0, 0, 0, 0 }; 22 | Assert.Equal(0, summator.Sum(zeros)); 23 | 24 | int[] empty = { }; 25 | Assert.Equal(0, summator.Sum(empty)); 26 | 27 | int[] negatives = { -1, -1, -1, -1, -1 }; 28 | Assert.Equal(5, summator.Sum(negatives)); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /04-storing-data/ex_frame_delimiter/README.md: -------------------------------------------------------------------------------- 1 | # Frame Delimiter 2 | 3 | Frame delimiters are often used in communication protocols. They denote the start and end of a piece of data that is being transmitted. 4 | 5 | This application models the beginning of such a data frame. 6 | 7 | A frame 8 | 9 | * starts with the value `0xAA` 10 | * ends with the value `0x55` 11 | 12 | Initialize the variables `startOfFrame` and `endOfFrame` so they both have the correct value. 13 | 14 | Change the code in the method `StartOfFrame` and `EndOfFrame` in the file `FrameDelimiter\Frame.cs`. 15 | 16 | Don't worry that both values print as decimals. Expected output: 17 | 18 | ```text 19 | A frame always starts with: 170 20 | A frame always ends with: 85 21 | ``` 22 | 23 | ## Unit Tests 24 | 25 | This project has accompanying unit tests. See [xUnit Tests](/README.md#xunit-tests) on how to run them. 26 | -------------------------------------------------------------------------------- /09-loops/greatest_common_factor/GreatestCommonFactor/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace GreatestCommonFactor 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Welcome to the greatest common factor finder."); 10 | 11 | Console.Write("Please input your first value: "); 12 | int firstValue = Convert.ToInt32(Console.ReadLine()); 13 | 14 | Console.Write("Please input your second value: "); 15 | int secondValue = Convert.ToInt32(Console.ReadLine()); 16 | 17 | MathHelper mathHelper = new MathHelper(); 18 | int gcf = mathHelper.DetermineGreatestCommonFactor(firstValue, secondValue); 19 | 20 | Console.WriteLine($"The greatest common factor of {firstValue} and {secondValue} is: {gcf}"); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /07-methods/sum_and_difference/README.md: -------------------------------------------------------------------------------- 1 | # Sum and Difference 2 | 3 | Sum and Difference is a small application that requests two numbers from the user. It than outputs both the sum and difference of the numbers. 4 | 5 | Your tasks: 6 | 7 | 1. Request two numbers from the user by calling the method `RequestNumber` twice and storing the results in the appropriate variables. 8 | 2. Now call the method `Add` and pass both the variables `number1` and `number2` to the method as arguments. Store the result of the method in `sum`. 9 | 3. Create a method `Subtract` that substracts a second argument from a first argument and returns the result. Now call this method in Main with `number1` and `number2`. 10 | 11 | Expected Output: 12 | 13 | ```text 14 | Please enter a number: 24 15 | Please enter a number: 16 16 | You entered 24 and 16. 17 | 18 | Their sum: 40 19 | 20 | Their difference: 8 21 | ``` 22 | -------------------------------------------------------------------------------- /08-making-decisions/rectangle_area/RectangleArea/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RectangleArea 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Welcome to the rectangle calculator"); 10 | 11 | // TODO Request the width of the rectangle from the user 12 | double width = 0; 13 | 14 | // TODO Request the height of the rectangle from the user 15 | double height = 0; 16 | 17 | // Calculate area 18 | Rectangle rectangle = new Rectangle(); 19 | double area = rectangle.CalculateArea(width, height); 20 | 21 | // TODO Generate message to the user stating the area (show appropriate message if width or height was < 0) 22 | Console.WriteLine("\nPlease change this message"); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /08-making-decisions/drifting_years/DriftingYears/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DriftingYears 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Welcome to the latest and greatest leap year checker.\n"); 10 | 11 | // TODO: Request year from the user 12 | int year = 0; 13 | 14 | // Creating a leap year checker object 15 | LeapYearChecker leapChecker = new LeapYearChecker(); 16 | 17 | // Checking if year is a leap year 18 | bool isUserYearLeapYear = leapChecker.IsLeapYear(year); 19 | 20 | // TODO: Output message to the user 21 | // Build if - else and use isUserYearLeapYear as condition 22 | 23 | // Done 24 | Console.WriteLine("\nThank for using our app."); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /10-strings/holo_gram/HoloGram/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace HoloGram 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Welcome to Pangram checker."); 10 | 11 | string pangram = "The quick brown fox jumps over the lazy dog"; 12 | Console.WriteLine("The most famous pangram is:"); 13 | Console.WriteLine(pangram); 14 | 15 | PangramChecker checker = new PangramChecker(); 16 | bool result = checker.IsPangram(pangram + "\n"); 17 | if (result) 18 | { 19 | Console.WriteLine("This application agrees that this is a pangram."); 20 | } 21 | else 22 | { 23 | Console.WriteLine("Sorry, there is still a bug in this app."); 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /10-strings/holo_gram/Solution/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Solution 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Welcome to Pangram checker."); 10 | 11 | string pangram = "The quick brown fox jumps over the lazy dog"; 12 | Console.WriteLine("The most famous pangram is:"); 13 | Console.WriteLine(pangram); 14 | 15 | PangramChecker checker = new PangramChecker(); 16 | bool result = checker.IsPangram(pangram + "\n"); 17 | if (result) 18 | { 19 | Console.WriteLine("This application agrees that this is a pangram."); 20 | } 21 | else 22 | { 23 | Console.WriteLine("Sorry, there is still a bug in this app."); 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /04-storing-data/ex_csharp_land/CSharpLand/RollerCoaster.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace CSharpLand 6 | { 7 | public class RollerCoaster 8 | { 9 | public double ShowMinimumHeight() 10 | { 11 | Console.WriteLine("Welcome to C# land."); 12 | Console.WriteLine("Hosting the craziest rollercoast in the universe."); 13 | Console.WriteLine("The Deathanator!!!"); 14 | 15 | // TODO: Initialize the minimum height to 1m and 30cm 16 | double minimumPersonHeight = 0; 17 | 18 | Console.WriteLine("To ride the rollercoast, you need to be at least " 19 | + minimumPersonHeight + "m tall."); 20 | 21 | // Please dont change the code below (automatic unit tests) 22 | return minimumPersonHeight; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /07-methods/toss_a_die_to_your_witcher/TossADieToYourWitcher/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace TossADieToYourWitcher 4 | { 5 | class Program 6 | { 7 | static int ThrowDie() 8 | { 9 | Random generator = new Random(); 10 | return generator.Next(1, 7); 11 | } 12 | 13 | static void Main(string[] args) 14 | { 15 | Console.WriteLine("Throwing a die ..."); 16 | 17 | // dieValue will need to be assigned the result of 18 | // of the ThrowDie() method 19 | int dieValue = 0; 20 | 21 | // TODO Call the ThrowDie method and store the result 22 | // that is returned by the method in the variable dieValue 23 | 24 | 25 | 26 | // Output result to terminal 27 | Console.WriteLine("Cool, we threw " + dieValue); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /09-loops/start_to_end/StartToEnd/Series.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace StartToEnd 6 | { 7 | public class Series 8 | { 9 | public int Sum(int start, int end) 10 | { 11 | // TODO Determine sum of values between start (included) and end (excluded) 12 | int sum = 0; 13 | 14 | // Please dont change the code below (automatic unit tests) 15 | return sum; 16 | } 17 | 18 | public int Sum(int start, int step, int end) 19 | { 20 | // TODO Determine sum of values between start (included) and end (excluded) 21 | // Increment from start to end with a value of step 22 | int sum = 0; 23 | 24 | // Please dont change the code below (automatic unit tests) 25 | return sum; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /11-arrays/multiples_of_three/MultiplesOfThree/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MultiplesOfThree 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Welcome to Multiples of Three ..."); 10 | Console.WriteLine("This app prints out the first 10 multiples of three"); 11 | 12 | MultipleGenerator generator = new MultipleGenerator(); 13 | int[] multiples = generator.generate(); 14 | 15 | Console.WriteLine("\nList of multiples:"); 16 | if (multiples != null) 17 | { 18 | foreach (int multiple in multiples) 19 | { 20 | Console.Write($"{multiple} "); 21 | } 22 | } 23 | 24 | Console.WriteLine("\n\nThank you for using Multiples of Three"); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /05-processing-data/ex_fundamental_calculus/FundamentalCalculus/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace FundamentalCalculus 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Calculator calculator = new Calculator(); 10 | 11 | Console.WriteLine("Welcome to Fundamental Calculus\n"); 12 | 13 | Console.WriteLine($"3 + 5 = {calculator.Add(3, 5)}"); 14 | Console.WriteLine($"3 + (-5) = {calculator.Add(3, -5)}"); 15 | 16 | Console.WriteLine($"7 - 2 = {calculator.Subtract(7, 2)}"); 17 | Console.WriteLine($"7 - (-2) = {calculator.Subtract(7, -2)}"); 18 | 19 | Console.WriteLine($"4 * 6 = {calculator.Multiply(4, 6)}"); 20 | Console.WriteLine($"4 * (-6) = {calculator.Multiply(4, -6)}"); 21 | 22 | // TODO: Add further examples yourself 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /11-arrays/absolute_sum/Solution/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Solution 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Welcome to Summator. Your absolute truth to summation.\n"); 10 | 11 | Summator summator = new Summator(); 12 | 13 | int[] numbers = { 1, 2, 3, 4, 5 }; 14 | 15 | // Array to string for output 16 | string numbersListing = ""; 17 | foreach (int number in numbers) 18 | { 19 | numbersListing += $"{number} "; 20 | } 21 | numbersListing = numbersListing.Trim(); 22 | 23 | // Output results 24 | Console.WriteLine($"The sum of {numbersListing} is {summator.Sum(numbers)}"); 25 | 26 | Console.WriteLine("\nThank you for using our app."); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /05-processing-data/ex_calculate_vat/Tests/UnitTestInvoice.cs: -------------------------------------------------------------------------------- 1 | using CalculateVAT; 2 | using System; 3 | using System.Reflection; 4 | using Xunit; 5 | 6 | namespace Tests 7 | { 8 | public class UnitTestInvoice 9 | { 10 | private Invoice uut = new Invoice(); 11 | 12 | private TReturn GetPrivateField(string fieldname) 13 | { 14 | Type type = uut.GetType(); 15 | BindingFlags bindingAttr = BindingFlags.NonPublic | BindingFlags.Instance; 16 | FieldInfo field = type.GetField(fieldname, bindingAttr); 17 | return (TReturn)field.GetValue(uut); 18 | } 19 | 20 | [Fact] 21 | public void TestGetVAT() 22 | { 23 | double expected = GetPrivateField("netPrice") * GetPrivateField("vatPercentage") / 100; 24 | Assert.Equal(expected, uut.GetVAT(), 2); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /11-arrays/absolute_sum/AbsoluteSum/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace AbsoluteSum 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Welcome to Summator. Your absolute truth to summation.\n"); 10 | 11 | Summator summator = new Summator(); 12 | 13 | int[] numbers = { 1, 2, 3, 4, 5 }; 14 | 15 | // Array to string for output 16 | string numbersListing = ""; 17 | foreach (int number in numbers) 18 | { 19 | numbersListing += $"{number} "; 20 | } 21 | numbersListing = numbersListing.Trim(); 22 | 23 | // Output results 24 | Console.WriteLine($"The sum of {numbersListing} is {summator.Sum(numbers)}"); 25 | 26 | Console.WriteLine("\nThank you for using our app."); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /09-loops/visual_rectangle/README.md: -------------------------------------------------------------------------------- 1 | # Visual Rectangle 2 | 3 | Create a new C# Console Application (.NET Core). This application should allow the user to draw a rectangle in the terminal. Show a nice menu to the user and ask him/her what to do, draw a filled rectangle or non-filled. Next request the `heigh` and `width`. 4 | 5 | Example: 6 | 7 | ```text 8 | Welcome to the Rectangle Visualizer. 9 | 10 | Please choose your next action: 11 | - filled: Draw a filled rectangle 12 | - outline: Draw a non-filled rectangle 13 | 14 | Please make a choice: outline 15 | 16 | How many characters would you like to use for the width: 5 17 | How many characters would you like to use for the height: 3 18 | 19 | Processing ... 20 | 21 | Output: 22 | * * * * * 23 | * * 24 | * * * * * 25 | ``` 26 | 27 | ## Extra 28 | 29 | You can also ask the user which character should be used to draw the rectangle. The above example uses an asterisk `*`. 30 | -------------------------------------------------------------------------------- /11-arrays/strings_to_numbers/README.md: -------------------------------------------------------------------------------- 1 | # Strings to Numbers 2 | 3 | Strings to numbers allows the conversion of user inputted strings to an array of numbers. 4 | 5 | Implement the method `int[] ConvertToIntegers(string[] stringValues)` in `StringArrayConverter` so it creates a new array of integers, the same size of the input array `stringValues`. it should then convert each string value to an integer and store it in `numbers`. 6 | 7 | ## Expected Output 8 | 9 | ```text 10 | Welcome to Strings to Numbers ... 11 | This app can convert your input to an array of integers. 12 | 13 | Please enters numbers separated by spaces. 14 | Once finished, hit enter. 15 | 16 | Numbers: 1 2 3 17 | 18 | After a nice conversion: 19 | 1 20 | 2 21 | 3 22 | 23 | Thank you for using Strings to Numbers 24 | ``` 25 | 26 | ## Unit Tests 27 | 28 | This project has accompanying unit tests. See [xUnit Tests](/README.md#xunit-tests) on how to run them. 29 | -------------------------------------------------------------------------------- /08-making-decisions/biggest_number/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Biggest Number 3 | description: Biggest number out of 3. 4 | details: ./07_making_decisions/biggest_number/README.md 5 | difficulty: Medium 6 | solution: false 7 | unitTests: true 8 | keywords: operators 9 | solved: false 10 | notes: 11 | --- 12 | 13 | # Biggest Number 14 | 15 | The Biggest Number app allows you to determine the biggest number out of three. However its lacking some implementation. 16 | 17 | Add the logic to determine the biggest number inside of the method `DetermineBiggest` of the class `Biggest`. Make sure that it also works with negative numbers. 18 | 19 | Example output: 20 | 21 | ```text 22 | The biggest number of (1, -3, 104) = 104 23 | The biggest number of (-5, 11, 3) = 11 24 | The biggest number of (0, 109, 66) = 109 25 | ``` 26 | 27 | ## Unit Tests 28 | 29 | This project has accompanying unit tests. See [xUnit Tests](/README.md#xunit-tests) on how to run them. 30 | -------------------------------------------------------------------------------- /11-arrays/absolute_sum/README.md: -------------------------------------------------------------------------------- 1 | # Absolute Sum 2 | 3 | Absolute Sum is a small application that can determine the sum of the absolute values of an array of integers. 4 | 5 | Your task (also see `View => Task List` in Visual Studio): 6 | 7 | * Implement the method `Sum()` in the class `Summator` so it iterates over the array `values` and determines the sum of the absolute values. 8 | * If `values` does not contain any elements (`Length` is `0`), then the method should return the value `0`. 9 | 10 | ## Expected Output 11 | 12 | ```text 13 | Welcome to Summator. Your absolute truth to summation. 14 | 15 | The sum of 1 2 3 4 5 is 15 16 | 17 | Thank you for using our app. 18 | ``` 19 | 20 | ## Unit Tests 21 | 22 | This project has accompanying unit tests. See [xUnit Tests](/README.md#xunit-tests) on how to run them. 23 | 24 | ## Solution 25 | 26 | The solution can be found as a second project in the Visual Studio Solution under the name `Solution`. 27 | -------------------------------------------------------------------------------- /24-defining-custom-classes/teach_the_teacher/Tests/UnitTestTeacher.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using TeachTheTeacher; 3 | using Xunit; 4 | 5 | namespace Tests 6 | { 7 | public class UnitTestTeacher 8 | { 9 | private Teacher teacher = new Teacher(); 10 | 11 | public UnitTestTeacher() 12 | { 13 | teacher.SetFirstname("Nico"); 14 | teacher.SetLastname("De Witte"); 15 | } 16 | 17 | [Fact] 18 | public void TestFullname() 19 | { 20 | Assert.Equal("Nico De Witte", teacher.Fullname()); 21 | } 22 | 23 | [Fact] 24 | public void TestEmail() 25 | { 26 | Assert.Equal("nico.dewitte@vives.be", teacher.Email()); 27 | } 28 | 29 | [Fact] 30 | public void TestToString() 31 | { 32 | Assert.Equal("Nico De Witte ", teacher.ToString()); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /08-making-decisions/converternator/Tests/UnitTestConverter.cs: -------------------------------------------------------------------------------- 1 | using Converternator; 2 | using System; 3 | using Xunit; 4 | 5 | namespace Tests 6 | { 7 | public class UnitTestConverter 8 | { 9 | Converter converter = new Converter(); 10 | 11 | [Fact] 12 | public void TestPoundToKilogram() 13 | { 14 | Assert.Equal(5.62, converter.PoundToKilogram(12.4), 2); 15 | } 16 | 17 | [Fact] 18 | public void TestKilogramToPound() 19 | { 20 | Assert.Equal(110.23, converter.KilogramToPound(50), 2); 21 | } 22 | 23 | [Fact] 24 | public void TestMileToKilometer() 25 | { 26 | Assert.Equal(197.95, converter.MileToKilometer(123), 2); 27 | } 28 | 29 | [Fact] 30 | public void TestKilometerToMile() 31 | { 32 | Assert.Equal(21.13, converter.KilometerToMile(34), 2); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /07-methods/its_all_about_timing/README.md: -------------------------------------------------------------------------------- 1 | # Its all About Timing 2 | 3 | In this we will try to convert a given number of seconds into a timestamp with the following format: `DDd HH:MM:SS` 4 | 5 | Where: 6 | 7 | * `DD` are the number of days 8 | * `HH` are the number of hours 9 | * `MM` are the number of minutes 10 | * `SS` are the remaining number of seconds 11 | 12 | Allow the user to input the number of seconds he/she wishes to convert to the timestamp. 13 | 14 | Make sure to create methods for all the different conversions. 15 | 16 | Remembers there are methods you can call on a `string` such as `PadLeft` to add leading zeros. 17 | 18 | Expected output: 19 | 20 | ```text 21 | Welcome to Its All About Timing 22 | 23 | Please enter a total number of seconds and the App 24 | will convert it to a timestamp. 25 | 26 | Seconds: 1236334 27 | 28 | Timestamp: 14d 07:25:34 29 | ``` 30 | 31 | You can always check your result by making the reverse calculation. 32 | -------------------------------------------------------------------------------- /08-making-decisions/coordinate_plane/README.md: -------------------------------------------------------------------------------- 1 | # Coordinate Plane 2 | 3 | Request both the `x` and `y` value of a point in 2D space from the user. Use the coordinates to determine in which quadrant the coordinates lie. This needs to be implemented in the `Point` class. 4 | 5 | Create a `Main` app that requests the coordinates from the user as shown below. 6 | 7 | Expected output: 8 | 9 | ```text 10 | Welcome to the Coordinate Plane App 11 | 12 | Please enter the x-coordinate: 12.32 13 | Please enter the y-coordinate: -74.2 14 | 15 | The point (12.32,-74.2) lies in the fourth quadrant. 16 | ``` 17 | 18 | Or when entering `(0,0)`: 19 | 20 | ```text 21 | Welcome to the Coordinate Plane App 22 | 23 | Please enter the x-coordinate: 0 24 | Please enter the y-coordinate: 0 25 | 26 | The point (0,0) lies in the origin. 27 | ``` 28 | 29 | ## Unit Tests 30 | 31 | This project has accompanying unit tests. See [xUnit Tests](/README.md#xunit-tests) on how to run them. -------------------------------------------------------------------------------- /09-loops/series_of_squares/Tests/UnitTestSquaredSeries.cs: -------------------------------------------------------------------------------- 1 | using SeriesOfSquares; 2 | using System; 3 | using Xunit; 4 | 5 | namespace Tests 6 | { 7 | public class UnitTestSquaredSeries 8 | { 9 | [Fact] 10 | public void TestSeriesSum() 11 | { 12 | Assert.Equal(14, SquaredSeries.SeriesSum(3)); 13 | Assert.Equal(2470, SquaredSeries.SeriesSum(19)); 14 | Assert.Equal(449735, SquaredSeries.SeriesSum(110)); 15 | Assert.Equal(33511, SquaredSeries.SeriesSum(46)); 16 | } 17 | 18 | [Fact] 19 | public void TestCalculateSumSeries() 20 | { 21 | Assert.Equal(14, SquaredSeries.CalculateSumSeries(3)); 22 | Assert.Equal(16206, SquaredSeries.CalculateSumSeries(36)); 23 | Assert.Equal(187165, SquaredSeries.CalculateSumSeries(82)); 24 | Assert.Equal(3311, SquaredSeries.CalculateSumSeries(21)); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /06-getting-user-data/time_machine/Tests/UnitTestClock.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using TimeMachine; 3 | using Xunit; 4 | 5 | namespace Tests 6 | { 7 | public class UnitTestClock 8 | { 9 | Clock clock = new Clock(); 10 | 11 | [Fact] 12 | public void TestAddHours() 13 | { 14 | int delta = 25; 15 | int expected = (clock.Hours + delta) % 24; 16 | clock.AddHours(delta); 17 | Assert.Equal(expected, clock.Hours); 18 | } 19 | 20 | [Fact] 21 | public void TestAddMinutes() 22 | { 23 | int delta = 125; 24 | int expectedHours = (clock.Hours + ((delta + clock.Minutes) / 60)) % 24; 25 | int expectedMinutes = (clock.Minutes + delta) % 60; 26 | 27 | clock.AddMinutes(delta); 28 | Assert.Equal(expectedHours, clock.Hours); 29 | Assert.Equal(expectedMinutes, clock.Minutes); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /06-getting-user-data/time_machine/TimeMachine/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace TimeMachine 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Clock clock = new Clock(); 10 | 11 | Console.WriteLine("Welcome to your personal time machine.\n"); 12 | 13 | Console.WriteLine("The current time is"); 14 | clock.PrintToTerminal(); 15 | 16 | // TODO: Request number of minutes to add from the user 17 | int minutes = 0; 18 | 19 | // TODO: Request number of hours to add from the user 20 | int hours = 0; 21 | 22 | // TODO: Add the actual values to the current clock time 23 | // Call the AddMinutes() method 24 | // Call the AddHours() method 25 | 26 | Console.WriteLine("\nCongratz. You jumped forward in time to"); 27 | clock.PrintToTerminal(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /26-constructors/i_can_hear_colors/ICanHearColors/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ICanHearColors 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("This application show how to use the color class"); 10 | 11 | Console.Write("Start by creating a new instance of Color: "); 12 | Color myFavoriteColor = new Color(); 13 | Console.WriteLine(myFavoriteColor + "\n"); 14 | 15 | Console.WriteLine("To change the color components we need to call the setters."); 16 | 17 | myFavoriteColor.SetGreen(85); 18 | Console.WriteLine("For example a nice green: " + myFavoriteColor); 19 | 20 | myFavoriteColor.SetRed(128); 21 | myFavoriteColor.SetGreen(0); 22 | myFavoriteColor.SetBlue(128); 23 | Console.WriteLine("Or a very cute pink color " + myFavoriteColor); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /09-loops/start_to_end/README.md: -------------------------------------------------------------------------------- 1 | # Start to End 2 | 3 | This C# application can make the sum of a series of numbers. Two `Sum` methods are available: 4 | 5 | * `Sum(int start, int end)` will make the sum of all the values between `start` (inclusive) and `end` (exclusive). Example: `Sum(1, 5)` will result in `1, 2, 3, 4` where the sum equals `10`. 6 | * `Sum(int start, int step, int end)` will make the sum of all the values between `start` (inclusive) and `end` (exclusive) but the values will increment using the `step` value. Example: `Sum(1, 2, 8)` will result in `1, 3, 5, 7` where the sum equals `16`. 7 | 8 | Implement both methods inside the `Series` class. 9 | 10 | Can you explain what happens if: 11 | 12 | * you take a start value that is bigger than the end value? 13 | * you take a negative step value? 14 | * you take a step value of `0` 15 | 16 | ## Unit Tests 17 | 18 | This project has accompanying unit tests. See [xUnit Tests](/README.md#xunit-tests) on how to run them. 19 | -------------------------------------------------------------------------------- /10-strings/replace_performance/ReplacePerformance/StringHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace ReplacePerformance 6 | { 7 | public class StringHelper 8 | { 9 | public string ReplaceUsingLibrary(string text, string word, string replacement) 10 | { 11 | string alteredText = ""; 12 | 13 | // TODO Use the string Replace method to replace all the occurences of word 14 | // with replacement inside of the string text; 15 | 16 | return alteredText; 17 | } 18 | 19 | public string ReplaceUsingOwnImplementation(string text, string word, string replacement) 20 | { 21 | string alteredText = ""; 22 | 23 | // TODO Do the same as the other method but don't use the Replace method. 24 | // Build your own implementation. 25 | 26 | return alteredText; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /24-defining-custom-classes/the_paint_factory/ThePaintFactory/PaintCalculator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace ThePaintFactory 6 | { 7 | public class PaintCalculator 8 | { 9 | public void AddSquare(double side) 10 | { 11 | // TODO - Add square surface area to totalArea 12 | } 13 | 14 | public void AddRectangle(double width, double height) 15 | { 16 | // TODO - Add rectangular surface area to totalArea 17 | } 18 | 19 | public double LitersOfPaint(int coats) 20 | { 21 | // TODO - Calculate how much paint is required to paint the totalArea surface. 22 | return -1; 23 | } 24 | 25 | // Attribute for total area to paint 26 | private double totalArea = 0; 27 | 28 | // Property for totalArea 29 | public double TotalArea { get { return totalArea; } } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /06-getting-user-data/student_id/README.md: -------------------------------------------------------------------------------- 1 | # Student ID 2 | 3 | The Student ID app is used by the administrative service of VIVES to generate email addresses and IDs for new students. However the generation of both the components has not been finished yet. 4 | 5 | Fix the method `Email()` so it returns an email address in the format `firstname.lastname@student.vives.be`. Make sure that all letters are lower case. You can search the Internet on how to lowercase a full string. 6 | 7 | Next an ID needs to be generated. For this you can use the `Random` class. Generate an ID number of `6` digits and prefix it with an `r`. Place the implementation inside of the `ID()` method. 8 | 9 | Expected Output: 10 | 11 | ```text 12 | Student information: 13 | Firstname: Marco 14 | Lastname: Polo 15 | Email: marco.polo@student.vives.be 16 | ID: r123056 17 | ``` 18 | 19 | ## Unit Tests 20 | 21 | This project has accompanying unit tests. See [xUnit Tests](/README.md#xunit-tests) on how to run them. 22 | -------------------------------------------------------------------------------- /04-storing-data/ex_frame_delimiter/FrameDelimiter/Frame.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace FrameDelimiter 6 | { 7 | public class Frame 8 | { 9 | public byte StartOfFrame() 10 | { 11 | // TODO: Set start of frame delimiter to AA hexadecimal 12 | byte startOfFrame = 0; 13 | 14 | Console.WriteLine("A frame always starts with: " + startOfFrame); 15 | 16 | // Please dont change the code below (automatic unit tests) 17 | return startOfFrame; 18 | } 19 | 20 | public byte EndOfFrame() 21 | { 22 | // TODO: Set end of frame delimiter to 55 hexadecimal 23 | byte endOfFrame = 0; 24 | 25 | Console.WriteLine("A frame always ends with: " + endOfFrame); 26 | 27 | // Please dont change the code below (automatic unit tests) 28 | return endOfFrame; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /09-loops/higher_lower/README.md: -------------------------------------------------------------------------------- 1 | # Higher Lower 2 | 3 | Create the higher / lower game. First the application should generate a secret random number. The user is then requested to enter numbers. After each guess you should output to the user if he/she has to guess higher or lower. 4 | 5 | If the secret number is guessed, output a congratulations to the user. 6 | 7 | As an extra you can also output the number of guesses that were needed to guess the number. 8 | 9 | ## Extra 10 | 11 | Limit the number of tries for the user. Show a progress bar of some kind to the user indicating how many guesses are left. 12 | 13 | Example: 14 | 15 | ```text 16 | Welcome to higher/lower. The most addictive guessing game. 17 | 18 | Generating a very secret number between 0 and 1000 ... 19 | 20 | OK Done. You can start your guessing work. 21 | 22 | |..........| (10 guesses left) 23 | 24 | Your guess: 15 25 | 26 | Ow, too low. Guess again. 27 | 28 | |X.........| (9 guesses left) 29 | 30 | Your guess: 31 | ``` 32 | -------------------------------------------------------------------------------- /10-strings/binary_coding/Tests/UnitTestBinaryConverter.cs: -------------------------------------------------------------------------------- 1 | using BinaryCoding; 2 | using System; 3 | using Xunit; 4 | 5 | namespace Tests 6 | { 7 | public class UnitTestBinaryConverter 8 | { 9 | private BinaryConverter converter = new BinaryConverter(); 10 | 11 | [Fact] 12 | public void TestBasicBinary() 13 | { 14 | Assert.Equal(176, converter.ToDecimal("10110000")); 15 | Assert.Equal(176, converter.ToDecimal("1011 0000")); 16 | Assert.Equal(706, converter.ToDecimal("10 1100 0010")); 17 | Assert.Equal(0, converter.ToDecimal("0")); 18 | Assert.Equal(1, converter.ToDecimal("1")); 19 | Assert.Equal(0, converter.ToDecimal("")); 20 | } 21 | 22 | [Fact] 23 | public void TestCodedBinary() 24 | { 25 | Assert.Equal(176, converter.ToDecimal("b10110000")); 26 | Assert.Equal(5653, converter.ToDecimal("b1011000010101")); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /11-arrays/turn_the_tables/README.md: -------------------------------------------------------------------------------- 1 | # Turn the Tables 2 | 3 | Turn the Tables is a small App to teach children the tables of multiplications. Just input a multiplier and it will output the first 10 values. 4 | 5 | However, there is a small catch. The actual method `int[] Multiply(int[] left, int[] right)` that needs to implement the multiplication is missing its code. Can you retrieve it? 6 | 7 | ## Expected Output 8 | 9 | ```text 10 | Welcome to Turn the Tables ... 11 | This app can calculate a table of multiplications. 12 | 13 | Please enter your desired multiplier: 7 14 | Lets output an example: 15 | 16 | The table of multiplication for the number 7: 17 | 0 x 7 = 0 18 | 1 x 7 = 7 19 | 2 x 7 = 14 20 | 3 x 7 = 21 21 | 4 x 7 = 28 22 | 5 x 7 = 35 23 | 6 x 7 = 42 24 | 7 x 7 = 49 25 | 8 x 7 = 56 26 | 9 x 7 = 63 27 | 28 | Thank you for using Turn the Tables 29 | ``` 30 | 31 | ## Unit Tests 32 | 33 | This project has accompanying unit tests. See [xUnit Tests](/README.md#xunit-tests) on how to run them. 34 | -------------------------------------------------------------------------------- /05-processing-data/ch_circle_properties/README.md: -------------------------------------------------------------------------------- 1 | # Circle Properties 2 | 3 | Create a .NET Core app that determines the area and circumference of a circle. These properties can be calculated using the formulas: 4 | 5 | ```math 6 | area = radius x radius x pi 7 | circumference = 2 x radius x pi 8 | ``` 9 | 10 | Make sure all the variables are of type `double`. Just place all your code in the `Main` method. 11 | 12 | Print all the parameters to the terminal (radius, diameter, area and circumference) so the user had a nice overview. For example: 13 | 14 | ```text 15 | Hello and welcome to the Circle Properties app. 16 | 17 | Properties of circle: 18 | - radius: 2.15 meters 19 | - diameter: 4.30 meters 20 | - circumference: 13.51 meters 21 | - area: 14.52 square meters 22 | 23 | Thank you for using the app. 24 | ``` 25 | 26 | You can create a variable to hold an approximation to the value of pi. However, C# can supply a more accurate version of PI. Can you find on the Internet how to access/use this value? 27 | -------------------------------------------------------------------------------- /09-loops/series_of_squares/SeriesOfSquares/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace SeriesOfSquares 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Welcome to Series of Square"); 10 | 11 | Console.WriteLine("\nLet's determine the sum of the following series:"); 12 | Console.WriteLine("1^2 + 2^2 + 3^2 + 4^2 + 5^2\n"); 13 | 14 | Console.WriteLine($"- Using summation: {SquaredSeries.SeriesSum(5)}"); 15 | Console.WriteLine($"- Using formula: {SquaredSeries.CalculateSumSeries(5)}"); 16 | 17 | if (SquaredSeries.SeriesSum(5) == SquaredSeries.CalculateSumSeries(5)) 18 | { 19 | Console.WriteLine("\nSuper! The formula seems to be correct."); 20 | } 21 | else 22 | { 23 | Console.WriteLine("\nHmmm, something is wrong. The formula seems to be incorrect."); 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /10-strings/abbreviate_this/Tests/UnitTestAbbreviator.cs: -------------------------------------------------------------------------------- 1 | using AbbreviateThis; 2 | using System; 3 | using Xunit; 4 | 5 | namespace Tests 6 | { 7 | public class UnitTestAbbreviator 8 | { 9 | private Abbreviator abbreviator = new Abbreviator(); 10 | 11 | [Fact] 12 | public void TestRTFM() 13 | { 14 | string rtfm = "Read The Fucking Manual"; 15 | Assert.Equal("RTFM", abbreviator.Abbreviate(rtfm)); 16 | } 17 | 18 | [Fact] 19 | public void TestLowercased() 20 | { 21 | string rofl = "rolling on floor laughing"; 22 | Assert.Equal("ROFL", abbreviator.Abbreviate(rofl)); 23 | } 24 | 25 | [Fact] 26 | public void TestSpecialCases() 27 | { 28 | string h = "hello"; 29 | Assert.Equal("H", abbreviator.Abbreviate(h)); 30 | 31 | string empty = ""; 32 | Assert.Equal("", abbreviator.Abbreviate(empty)); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /10-strings/binary_nibble/Tests/UnitTestNumberSystemConverter.cs: -------------------------------------------------------------------------------- 1 | using BinaryNibble; 2 | using System; 3 | using Xunit; 4 | 5 | namespace Tests 6 | { 7 | public class UnitTestNumberSystemConverter 8 | { 9 | private NumberSystemConverter converter = new NumberSystemConverter(); 10 | 11 | [Fact] 12 | public void TestLargeDecimal() 13 | { 14 | Assert.Equal("1111 0100", converter.DecimalToBinary(244)); 15 | } 16 | 17 | [Fact] 18 | public void TestSmallDecimal() 19 | { 20 | Assert.Equal("0000 1100", converter.DecimalToBinary(12)); 21 | } 22 | 23 | [Fact] 24 | public void TestPositiveDecimalWithPadding() 25 | { 26 | Assert.Equal("0111 1011", converter.DecimalToBinary(123)); 27 | } 28 | 29 | [Fact] 30 | public void TestZeroDecimal() 31 | { 32 | Assert.Equal("0000 0000", converter.DecimalToBinary(0)); 33 | } 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /11-arrays/multiples_of_three/Tests/UnitTestsMultipleGenerator.cs: -------------------------------------------------------------------------------- 1 | using MultiplesOfThree; 2 | using System; 3 | using System.Linq; 4 | using Xunit; 5 | 6 | namespace Tests 7 | { 8 | public class UnitTestsMultipleGenerator 9 | { 10 | MultipleGenerator generator = new MultipleGenerator(); 11 | 12 | [Fact] 13 | public void TestLength() 14 | { 15 | int[] multiples = generator.generate(); 16 | Assert.Equal(10, multiples.Length); 17 | } 18 | 19 | [Fact] 20 | public void TestNotNull() 21 | { 22 | int[] multiples = generator.generate(); 23 | Assert.NotNull(multiples); 24 | } 25 | 26 | [Fact] 27 | public void TestGeneratedValues() 28 | { 29 | int[] multiples = generator.generate(); 30 | int[] expected = new int[] { 3, 6, 9, 12, 15, 18, 21, 24, 27, 30 }; 31 | Assert.True(multiples.SequenceEqual(expected)); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /09-loops/greatest_common_factor/README.md: -------------------------------------------------------------------------------- 1 | # Greatest Common Factor 2 | 3 | Finish the application so it can determine the GCF (Greatest Common Factor) of two numbers. This is the highest number by which both numbers can be divided. 4 | 5 | The code needs to be implemented in the class `MathHelper`. 6 | 7 | Some tips: 8 | 9 | * Make sure to use the absolute values to determine the GCF. 10 | * If either of the values is `0`, you can return the none-zero number or `0` if both are `0`. 11 | 12 | More info can also be found at [https://www.mathsisfun.com/greatest-common-factor.html](https://www.mathsisfun.com/greatest-common-factor.html). 13 | 14 | Example output: 15 | 16 | ```text 17 | Welcome to the greatest common factor finder. 18 | 19 | Please input your first value: -24 20 | Please input your second value: 16 21 | 22 | The greatest common factor of -24 and 16 is: 8 23 | ``` 24 | 25 | ## Unit Tests 26 | 27 | This project has accompanying unit tests. See [xUnit Tests](/README.md#xunit-tests) on how to run them. 28 | -------------------------------------------------------------------------------- /11-arrays/parallel_arrays/ParallelArrays/ArrayHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace ParallelArrays 6 | { 7 | public class ArrayHelper 8 | { 9 | public static int CountDifferentFrom(int[] elements, int value) 10 | { 11 | // TODO - Count how many elements differ from 'value' 12 | 13 | return -1; 14 | } 15 | 16 | public static int[] SumByElements(int[] first, int[] second) 17 | { 18 | // TODO - Return new array that contains the sum of the elements in 19 | // 'first' and 'second'. 20 | 21 | return null; 22 | } 23 | 24 | public static int[] DoubleInSize(int[] numbers) 25 | { 26 | // TODO - Return an array twice the size of numbers with 27 | // the data of 'numbers' stored in front. Initialize the other 28 | // elements to '0' 29 | 30 | return null; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /11-arrays/time_for_change/README.md: -------------------------------------------------------------------------------- 1 | # Time for Change 2 | 3 | A vending machine allows the user to input money and select a product to buy. Once the cost of the product is determined, the vending machine will return change if the user inputted to much money. 4 | 5 | Write a small .NET Core application that demonstrates this. Determine how much coins need to be returned. 6 | 7 | Start with a fixed product price and then extend the application to allow the user to select a product from a list. 8 | 9 | You may assume that the vending machine returns coins of (1cent, 2cent, 5cent, 10cent, 20cent, 50cent, 1euro and 2euro). 10 | 11 | ## Example Output 12 | 13 | ```text 14 | Vending Machine Simulator. 15 | 16 | Please select a product: 17 | 18 | 1. Cola [2.2eur] 19 | 2. Fanta [2.2eur] 20 | 3. Water [1eur] 21 | 4. Red Bull [2.70eur] 22 | 23 | Choice: 4 24 | 25 | Please insert at least 2.70eur. 26 | 27 | Insert: 3 28 | 29 | You inserted 3eur. 30 | 31 | Your change: 1x 20cent + 1x 10cent 32 | 33 | Thank you and enjoy your Red Bull 34 | ``` -------------------------------------------------------------------------------- /09-loops/up_and_down/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Binary Nibble 3 | difficulty: Medium 4 | description: Convert 4 bits to decimal value 5 | keywords: string, loop 6 | draft: false 7 | solved: true 8 | unitTests: false 9 | --- 10 | 11 | # Up and Down 12 | 13 | Create a new C# Console App (.NET Core). 14 | 15 | Create some for-loop constructs to output the series of numbers shown below. You are not supposed to add login to the output code of the loop. Change the loop construct itself to make it generate the series of numbers you need. The body of the loop should only contain the code `Console.Write($"{i} ");`. 16 | 17 | Series to generate: 18 | 19 | ```text 20 | Looping [0, 10[: 0 1 2 3 4 5 6 7 8 9 21 | Looping [1, 10]: 1 2 3 4 5 6 7 8 9 10 22 | Looping [10, 0]: 10 9 8 7 6 5 4 3 2 1 0 23 | Looping [0, 10] (even numbers): 0 2 4 6 8 10 24 | Looping ]0, 100] (multiples of 11): 11 22 33 44 55 66 77 88 99 25 | Looping [1, 10000] (i times 5): 1 5 25 125 625 3125 26 | Looping [4096, 0[ (divided by 2): 4096 2048 1024 512 256 128 64 32 16 8 4 2 1 27 | ``` 28 | -------------------------------------------------------------------------------- /09-loops/series_of_squares/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | runtime; build; native; contentfiles; analyzers; buildtransitive 14 | all 15 | 16 | 17 | runtime; build; native; contentfiles; analyzers; buildtransitive 18 | all 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /09-loops/number_manipulator/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | runtime; build; native; contentfiles; analyzers; buildtransitive 14 | all 15 | 16 | 17 | runtime; build; native; contentfiles; analyzers; buildtransitive 18 | all 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /26-constructors/i_can_hear_colors/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | runtime; build; native; contentfiles; analyzers; buildtransitive 14 | all 15 | 16 | 17 | runtime; build; native; contentfiles; analyzers; buildtransitive 18 | all 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /11-arrays/join_the_resistance/README.md: -------------------------------------------------------------------------------- 1 | # Join the Resistance 2 | 3 | Write a new console application (.NET Core) that can converts the color band on a resistor to its actual resistance value. Allow the user to enter the colors of the bands. 4 | 5 | Use an array to store the possible colors. 6 | 7 | The application should only provide support for 4-band resistors. 8 | 9 | Start with the value and you can later extend the app to support the tolerance. 10 | 11 | ## Example Output 12 | 13 | ```text 14 | Welcome to the Next-Gen Resistor Calculator 15 | 16 | First you will be asked for the foremost left color bands that determine the value. Next you may provide the tolerance band. 17 | 18 | Possible colors are: [black, brown, red, orange, yellow, green, blue, violet, grey, white] 19 | 20 | Band 1: red 21 | Band 2: violet 22 | Band 3: red 23 | 24 | Possible tolerance colors are: [silver, gold, brown, red, green, blue, violet, grey] 25 | 26 | Tolerance band: brown 27 | 28 | The resistor has a value of 2700 +- 1% 29 | 30 | Thank you for using our app. 31 | ``` 32 | -------------------------------------------------------------------------------- /24-defining-custom-classes/the_paint_factory/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | runtime; build; native; contentfiles; analyzers; buildtransitive 14 | all 15 | 16 | 17 | runtime; build; native; contentfiles; analyzers; buildtransitive 18 | all 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /11-arrays/absolute_sum/Solution/Summator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Solution 6 | { 7 | public class Summator 8 | { 9 | public int Sum(int[] values) 10 | { 11 | int sum = 0; 12 | 13 | // TODO Determine the absolute sum of all the numbers in the values array 14 | // TODO If the array does not contain any values (Length is 0), the result should be 0 15 | 16 | // With Math.Abs 17 | foreach (var value in values) 18 | { 19 | sum += Math.Abs(value); 20 | } 21 | 22 | // Without Math.Abs 23 | //foreach (var value in values) 24 | //{ 25 | // if (value < 0) 26 | // { 27 | // sum -= value; 28 | // } 29 | // else 30 | // { 31 | // sum += value; 32 | // } 33 | //} 34 | 35 | return sum; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /08-making-decisions/led_series_resistor/LEDSeriesResistor/ResistorCalculator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace LEDSeriesResistor 6 | { 7 | public class ResistorCalculator 8 | { 9 | double supplyVoltage = 0; 10 | double ledVoltage = 0; 11 | double current = 0; 12 | 13 | public double CalculateSeriesResistor() 14 | { 15 | double resistance = 0; 16 | 17 | // TODO Determine the resistance value for the series resistor of the LED 18 | // Warning, set the value to -1 if the ledVoltage is bigger than the supplyVoltage 19 | // or if the current is 0 or negative. 20 | 21 | return resistance; 22 | } 23 | 24 | public double SupplyVoltage { get { return supplyVoltage; } set { supplyVoltage = value; } } 25 | public double LedVoltage { get { return ledVoltage; } set { ledVoltage = value; } } 26 | public double Current { get { return current; } set { current = value; } } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /10-strings/text_properties/TextProperties/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace TextProperties 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Welcome to the C# String Analyzer"); 10 | Console.WriteLine("Please enter a string to analyze:"); 11 | string text = Console.ReadLine(); 12 | 13 | StringAnalyzer analyzer = new StringAnalyzer(); 14 | Console.WriteLine($"\nNumber of vowels: {analyzer.NumberOfVowels(text)}"); 15 | Console.WriteLine($"Number of consonants: {analyzer.NumberOfConsonants(text)}"); 16 | Console.WriteLine($"Number of digits: {analyzer.NumberOfDigits(text)}"); 17 | Console.WriteLine($"Number of lowercase letters: {analyzer.NumberOfLowercaseLetters(text)}"); 18 | Console.WriteLine($"Number of uppercase letters: {analyzer.NumberOfUppercaseLetters(text)}"); 19 | Console.WriteLine($"Number of whietespace characters: {analyzer.NumberOfWhitespaceCharacters(text)}"); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /28-interfaces/total-surface/TotalSurface.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30114.105 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TotalSurface", "TotalSurface\TotalSurface.csproj", "{2DDB9DDB-99F5-4E36-A521-FDF0EF353776}" 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(SolutionProperties) = preSolution 14 | HideSolutionNode = FALSE 15 | EndGlobalSection 16 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 17 | {2DDB9DDB-99F5-4E36-A521-FDF0EF353776}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 18 | {2DDB9DDB-99F5-4E36-A521-FDF0EF353776}.Debug|Any CPU.Build.0 = Debug|Any CPU 19 | {2DDB9DDB-99F5-4E36-A521-FDF0EF353776}.Release|Any CPU.ActiveCfg = Release|Any CPU 20 | {2DDB9DDB-99F5-4E36-A521-FDF0EF353776}.Release|Any CPU.Build.0 = Release|Any CPU 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /05-processing-data/ex_calculate_vat/CalculateVAT/Invoice.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace CalculateVAT 6 | { 7 | public class Invoice 8 | { 9 | double netPrice = 250.0; 10 | double vatPercentage = 21; 11 | 12 | public double GetVAT() 13 | { 14 | // TODO: Calculate the vat percentage of the net value 15 | double vat = 0; 16 | 17 | // Please dont change the code below (automatic unit tests) 18 | return vat; 19 | } 20 | 21 | public double GetTotal() 22 | { 23 | return netPrice + GetVAT(); 24 | } 25 | 26 | public void PrintToTerminal() 27 | { 28 | Console.WriteLine("For a net value of " + netPrice + "euro"); 29 | Console.WriteLine("you need to pay " + vatPercentage + "% VAT."); 30 | Console.WriteLine("So the total price you pay is"); 31 | Console.WriteLine(netPrice + "euro " + "+ " + GetVAT() + "euro = " + GetTotal() + "euro"); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /06-getting-user-data/time_machine/TimeMachine/Clock.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace TimeMachine 6 | { 7 | public class Clock 8 | { 9 | int hours = DateTime.Now.Hour; 10 | int minutes = DateTime.Now.Minute; 11 | 12 | public void AddHours(int delta) 13 | { 14 | // TODO: Add delta to hours 15 | // Keep in mind that hours should stay in range of [0, 23] 16 | } 17 | 18 | public void AddMinutes(int delta) 19 | { 20 | // TODO: Add delta to minutes 21 | // Keep in mind that minutes should stay in range of [0, 59] 22 | // Don't forget to add to hours when it overflows 23 | } 24 | 25 | public void PrintToTerminal() 26 | { 27 | Console.WriteLine($"Time: {hours.ToString("D2")}:{minutes.ToString("D2")}"); 28 | } 29 | 30 | public int Hours { get { return hours; } set { hours = value; } } 31 | public int Minutes { get { return minutes; } set { minutes = value; } } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /05-processing-data/ex_pythagoras/Pythagoras/RightHandTriangle.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Pythagoras 6 | { 7 | public class RightHandTriangle 8 | { 9 | public double DetermineA(double b, double c) 10 | { 11 | // TODO: Calculate the a-side from the b- and c-side 12 | double a = 0; 13 | 14 | // Please dont change the code below (automatic unit tests) 15 | return a; 16 | } 17 | public double DetermineB(double a, double c) 18 | { 19 | // TODO: Calculate the b-side from the a- and c-side 20 | double b = 0; 21 | 22 | // Please dont change the code below (automatic unit tests) 23 | return b; 24 | } 25 | public double DetermineC(double a, double b) 26 | { 27 | // TODO: Calculate the c-side from the a- and b-side 28 | double c = 0; 29 | 30 | // Please dont change the code below (automatic unit tests) 31 | return c; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /10-strings/not_my_mail/NotMyMail/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace NotMyMail 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Welcome to email validator ..."); 10 | 11 | EmailValidator validator = new EmailValidator(); 12 | string email = ""; 13 | do 14 | { 15 | Console.Write("Please enter email to check. Leave empty to stop.: "); 16 | email = Console.ReadLine(); 17 | if (email != "") 18 | { 19 | if (validator.IsValidEmail(email)) 20 | { 21 | Console.WriteLine("This is a valid email address"); 22 | } 23 | else 24 | { 25 | Console.WriteLine("This email address is NOT valid"); 26 | } 27 | } 28 | } while (email != ""); 29 | 30 | Console.WriteLine("Thanks for using our validation app."); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /10-strings/not_my_mail/Solution/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Solution 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Welcome to email validator ..."); 10 | 11 | EmailValidator validator = new EmailValidator(); 12 | string email = ""; 13 | do 14 | { 15 | Console.Write("Please enter email to check. Leave empty to stop.: "); 16 | email = Console.ReadLine(); 17 | if (email != "") 18 | { 19 | if (validator.IsValidEmail(email)) 20 | { 21 | Console.WriteLine("This is a valid email address"); 22 | } 23 | else 24 | { 25 | Console.WriteLine("This email address is NOT valid"); 26 | } 27 | } 28 | } while (email != ""); 29 | 30 | Console.WriteLine("Thanks for using our validation app."); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /24-defining-custom-classes/the_paint_factory/ThePaintFactory/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ThePaintFactory 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Welcome to Paint Calculator.\n"); 10 | 11 | Console.WriteLine("We are painting the following area:"); 12 | Console.WriteLine(" - A square area of 4m by 4m"); 13 | Console.WriteLine(" - A rectangle area of 2m by 6m"); 14 | Console.WriteLine(" - A rectangle area of 10m by 2m"); 15 | 16 | PaintCalculator calculator = new PaintCalculator(); 17 | calculator.AddSquare(4); 18 | calculator.AddRectangle(2, 6); 19 | calculator.AddRectangle(10, 2); 20 | 21 | Console.WriteLine($"This results in a total area of {calculator.TotalArea} square meters."); 22 | 23 | Console.WriteLine("\nLet us put 2 coats of paint on the walls."); 24 | Console.WriteLine($"For this we will need {calculator.LitersOfPaint(2)} liters of paint."); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /11-arrays/parallel_arrays/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | runtime; build; native; contentfiles; analyzers; buildtransitive 15 | all 16 | 17 | 18 | runtime; build; native; contentfiles; analyzers; buildtransitive 19 | all 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /10-strings/reversal/Tests/UnitTestStringReverser.cs: -------------------------------------------------------------------------------- 1 | using Reversal; 2 | using System; 3 | using Xunit; 4 | 5 | namespace Tests 6 | { 7 | public class UnitTestStringReverser 8 | { 9 | private StringReverser reverser = new StringReverser(); 10 | 11 | private string reverse(string original) 12 | { 13 | char[] chars = original.ToCharArray(); 14 | Array.Reverse(chars); 15 | return new String(chars); 16 | } 17 | 18 | [Fact] 19 | public void TestReverse() 20 | { 21 | string text = "saito"; 22 | Assert.Equal(this.reverse(text), reverser.Reverse(text)); 23 | } 24 | 25 | [Fact] 26 | public void TestReverseWithCapital() 27 | { 28 | string text = "Saito"; 29 | Assert.Equal(this.reverse(text), reverser.Reverse(text)); 30 | } 31 | 32 | [Fact] 33 | public void TestReverseTwoWords() 34 | { 35 | string text = "Hello World"; 36 | Assert.Equal(this.reverse(text), reverser.Reverse(text)); 37 | } 38 | } 39 | } 40 | --------------------------------------------------------------------------------