Skip to content

Commit 0f67ef9

Browse files
committed
Exam
1 parent 1b50cf1 commit 0f67ef9

File tree

56 files changed

+1440
-95
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1440
-95
lines changed

Basic Syntax Conditional Statements and Loops - Exercise/.idea/.idea.Basic Syntax Conditional Statements and Loops - Exercise/.idea/contentModel.xml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Basic Syntax Conditional Statements and Loops - Exercise/.idea/.idea.Basic Syntax Conditional Statements and Loops - Exercise/.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Basic Syntax Conditional Statements and Loops - Exercise/.idea/.idea.Basic Syntax Conditional Statements and Loops - Exercise/.idea/workspace.xml

Lines changed: 134 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Basic Syntax Conditional Statements and Loops - Exercise/Basic Syntax Conditional Statements and Loops - Exercise.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TriangleOfNumbers", "Triang
1818
EndProject
1919
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PadawanEquipment", "PadawanEquipment\PadawanEquipment.csproj", "{63650A1B-BC75-40B6-9535-BE4F80618933}"
2020
EndProject
21+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RageExpenses", "RageExpenses\RageExpenses.csproj", "{020B4842-FC61-42B2-957F-9A5FDDAF1DBF}"
22+
EndProject
2123
Global
2224
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2325
Debug|Any CPU = Debug|Any CPU
@@ -60,5 +62,9 @@ Global
6062
{63650A1B-BC75-40B6-9535-BE4F80618933}.Debug|Any CPU.Build.0 = Debug|Any CPU
6163
{63650A1B-BC75-40B6-9535-BE4F80618933}.Release|Any CPU.ActiveCfg = Release|Any CPU
6264
{63650A1B-BC75-40B6-9535-BE4F80618933}.Release|Any CPU.Build.0 = Release|Any CPU
65+
{020B4842-FC61-42B2-957F-9A5FDDAF1DBF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
66+
{020B4842-FC61-42B2-957F-9A5FDDAF1DBF}.Debug|Any CPU.Build.0 = Debug|Any CPU
67+
{020B4842-FC61-42B2-957F-9A5FDDAF1DBF}.Release|Any CPU.ActiveCfg = Release|Any CPU
68+
{020B4842-FC61-42B2-957F-9A5FDDAF1DBF}.Release|Any CPU.Build.0 = Release|Any CPU
6369
EndGlobalSection
6470
EndGlobal
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
using System;
2+
using System.Collections.Generic;
3+
4+
namespace RageExpenses
5+
{
6+
class Program
7+
{
8+
static void Main(string[] args)
9+
{
10+
int lostGamesCount = int.Parse(Console.ReadLine());
11+
float headsetPrice = float.Parse(Console.ReadLine());
12+
float mousePrice = float.Parse(Console.ReadLine());
13+
float keyboardPrice = float.Parse(Console.ReadLine());
14+
float displayPrice = float.Parse(Console.ReadLine());
15+
16+
int trashedHeadset = 0;
17+
int trashedMouses = 0;
18+
int trashedKeyboards = 0;
19+
int trashedDisplays = 0;
20+
float expenses = 0;
21+
bool headsetWasTrashed = false;
22+
23+
for (int i = 1; i <= lostGamesCount; i++)
24+
{
25+
if (i % 2 == 0)
26+
{
27+
trashedHeadset++;
28+
headsetWasTrashed = true;
29+
}
30+
31+
if (i % 3 == 0)
32+
{
33+
trashedMouses++;
34+
35+
if (headsetWasTrashed)
36+
{
37+
trashedKeyboards++;
38+
39+
if (trashedKeyboards % 2 == 0)
40+
{
41+
trashedDisplays = trashedKeyboards / 2;
42+
}
43+
}
44+
}
45+
46+
headsetWasTrashed = false;
47+
}
48+
49+
// Dictionary<string, int> trashedEquipmentCounts = new Dictionary<string, int>()
50+
// {
51+
// {"headset", trashedHeadset},
52+
// {"mouses", trashedMouses},
53+
// {"keyboards", trashedKeyboards},
54+
// {"displays", trashedDisplays}
55+
// };
56+
expenses = headsetPrice * trashedHeadset + mousePrice * trashedMouses + keyboardPrice * trashedKeyboards +
57+
displayPrice * trashedDisplays;
58+
59+
Console.WriteLine($"Rage expenses: {expenses:F} lv.");
60+
61+
// foreach (KeyValuePair<string,int> item in trashedEquipmentCounts)
62+
// {
63+
// Console.WriteLine(item);
64+
// }
65+
66+
67+
68+
}
69+
}
70+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>netcoreapp2.2</TargetFramework>
6+
</PropertyGroup>
7+
8+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"runtimeTarget": {
3+
"name": ".NETCoreApp,Version=v2.2",
4+
"signature": ""
5+
},
6+
"compilationOptions": {},
7+
"targets": {
8+
".NETCoreApp,Version=v2.2": {
9+
"RageExpenses/1.0.0": {
10+
"runtime": {
11+
"RageExpenses.dll": {}
12+
}
13+
}
14+
}
15+
},
16+
"libraries": {
17+
"RageExpenses/1.0.0": {
18+
"type": "project",
19+
"serviceable": false,
20+
"sha512": ""
21+
}
22+
}
23+
}

0 commit comments

Comments
 (0)