Skip to content

Commit 3870398

Browse files
committed
add
1 parent 8a4d311 commit 3870398

File tree

73 files changed

+1760
-414
lines changed

Some content is hidden

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

73 files changed

+1760
-414
lines changed

02.CSharpConditionalStatementsAndLoops/CSharpConditionalStatementsAndLoops

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System;
2+
3+
public class ChooseADrink
4+
{
5+
public static void Main()
6+
{
7+
string profession = Console.ReadLine().ToLower();
8+
9+
switch (profession)
10+
{
11+
case "athlete":
12+
Console.WriteLine("Water");
13+
break;
14+
case "businessman":
15+
case "businesswoman":
16+
Console.WriteLine("Coffee");
17+
break;
18+
case "softuni student":
19+
Console.WriteLine("Beer");
20+
break;
21+
default:
22+
Console.WriteLine("Tea");
23+
break;
24+
}
25+
}
26+
}

02.CSharpConditionalStatementsAndLoops/EXERCISES/01.ChooseADrink/Program.cs

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using System;
2+
3+
public class ChooseADrinkSecond
4+
{
5+
public static void Main()
6+
{
7+
string profession = Console.ReadLine();
8+
int quantity = int.Parse(Console.ReadLine());
9+
10+
double price = 0;
11+
double total = 0;
12+
13+
switch (profession)
14+
{
15+
case "Athlete":
16+
price = 0.70;
17+
break;
18+
case "Businessman":
19+
case "Businesswoman":
20+
price = 1.00;
21+
break;
22+
case "SoftUni Student":
23+
price = 1.70;
24+
break;
25+
default:
26+
price = 1.20;
27+
break;
28+
}
29+
total = price * quantity;
30+
31+
Console.WriteLine($"The {profession} has to pay {total:f2}.");
32+
}
33+
}

02.CSharpConditionalStatementsAndLoops/EXERCISES/02.ChooseADrink2/Program.cs

Lines changed: 0 additions & 33 deletions
This file was deleted.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
using System;
2+
3+
public class Restaurant
4+
{
5+
public static void Main()
6+
{
7+
int groupSize = int.Parse(Console.ReadLine());
8+
string package = Console.ReadLine();
9+
10+
double price = 0;
11+
string hall = null;
12+
13+
if (groupSize <= 50)
14+
{
15+
hall = "Small Hall";
16+
price = 2500;
17+
}
18+
else if (groupSize <= 100)
19+
{
20+
hall = "Terrace";
21+
price = 5000;
22+
}
23+
else if (groupSize <= 120)
24+
{
25+
hall = "Great Hall";
26+
price = 7500;
27+
}
28+
else
29+
{
30+
Console.WriteLine("We do not have an appropriate hall.");
31+
return;
32+
}
33+
34+
if (package == "Normal")
35+
{
36+
price += 500;
37+
price *= 0.95;
38+
}
39+
else if (package == "Gold")
40+
{
41+
price += 750;
42+
price *= 0.90;
43+
}
44+
else if (package == "Platinum")
45+
{
46+
price += 1000;
47+
price *= 0.85;
48+
}
49+
50+
Console.WriteLine($"We can offer you the {hall}");
51+
Console.WriteLine($"The price per person is {price / groupSize:f2}$");
52+
}
53+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{F1145E59-5E3E-4810-B27E-AD8789BEFF38}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<RootNamespace>_04.Hotel</RootNamespace>
10+
<AssemblyName>04.Hotel</AssemblyName>
11+
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16+
<PlatformTarget>AnyCPU</PlatformTarget>
17+
<DebugSymbols>true</DebugSymbols>
18+
<DebugType>full</DebugType>
19+
<Optimize>false</Optimize>
20+
<OutputPath>bin\Debug\</OutputPath>
21+
<DefineConstants>DEBUG;TRACE</DefineConstants>
22+
<ErrorReport>prompt</ErrorReport>
23+
<WarningLevel>4</WarningLevel>
24+
</PropertyGroup>
25+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26+
<PlatformTarget>AnyCPU</PlatformTarget>
27+
<DebugType>pdbonly</DebugType>
28+
<Optimize>true</Optimize>
29+
<OutputPath>bin\Release\</OutputPath>
30+
<DefineConstants>TRACE</DefineConstants>
31+
<ErrorReport>prompt</ErrorReport>
32+
<WarningLevel>4</WarningLevel>
33+
</PropertyGroup>
34+
<ItemGroup>
35+
<Reference Include="System" />
36+
<Reference Include="System.Core" />
37+
<Reference Include="System.Xml.Linq" />
38+
<Reference Include="System.Data.DataSetExtensions" />
39+
<Reference Include="Microsoft.CSharp" />
40+
<Reference Include="System.Data" />
41+
<Reference Include="System.Net.Http" />
42+
<Reference Include="System.Xml" />
43+
</ItemGroup>
44+
<ItemGroup>
45+
<Compile Include="Program.cs" />
46+
<Compile Include="Properties\AssemblyInfo.cs" />
47+
</ItemGroup>
48+
<ItemGroup>
49+
<None Include="App.config" />
50+
</ItemGroup>
51+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
52+
</Project>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
5+
</startup>
6+
</configuration>
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
using System;
2+
3+
public class Hotel
4+
{
5+
public static void Main()
6+
{
7+
string month = Console.ReadLine().ToLower();
8+
int nightsCount = int.Parse(Console.ReadLine());
9+
10+
double studio = 0;
11+
double doubleRoom = 0;
12+
double suite = 0;
13+
14+
if (month == "may" || month == "october")
15+
{
16+
studio = 50 * nightsCount;
17+
doubleRoom = 65 * nightsCount;
18+
suite = 75 * nightsCount;
19+
20+
if (month == "october" && nightsCount > 7)
21+
{
22+
studio -= 50;
23+
}
24+
else if (nightsCount > 7)
25+
{
26+
studio *= 0.95;
27+
}
28+
}
29+
else if (month == "june" || month == "september")
30+
{
31+
studio = 60 * nightsCount;
32+
doubleRoom = 72 * nightsCount;
33+
suite = 82 * nightsCount;
34+
35+
if (month == "september" && nightsCount > 7)
36+
{
37+
studio -= 60;
38+
}
39+
else if (nightsCount > 14)
40+
{
41+
doubleRoom *= 0.90;
42+
}
43+
44+
}
45+
else if (month == "july" || month == "august" || month == "december")
46+
{
47+
studio = 68 * nightsCount;
48+
doubleRoom = 77 * nightsCount;
49+
suite = 89 * nightsCount;
50+
51+
if (nightsCount > 14)
52+
{
53+
suite *= 0.85;
54+
}
55+
}
56+
57+
Console.WriteLine($"Studio: {studio:f2} lv.");
58+
Console.WriteLine($"Double: {doubleRoom:f2} lv.");
59+
Console.WriteLine($"Suite: {suite:f2} lv.");
60+
}
61+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("04.Hotel")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("04.Hotel")]
13+
[assembly: AssemblyCopyright("Copyright © 2018")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("f1145e59-5e3e-4810-b27e-ad8789beff38")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{B786D217-3B91-4EEC-9C55-35CC8714D5DD}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<RootNamespace>_05.IntervalOfNumber</RootNamespace>
10+
<AssemblyName>05.IntervalOfNumber</AssemblyName>
11+
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16+
<PlatformTarget>AnyCPU</PlatformTarget>
17+
<DebugSymbols>true</DebugSymbols>
18+
<DebugType>full</DebugType>
19+
<Optimize>false</Optimize>
20+
<OutputPath>bin\Debug\</OutputPath>
21+
<DefineConstants>DEBUG;TRACE</DefineConstants>
22+
<ErrorReport>prompt</ErrorReport>
23+
<WarningLevel>4</WarningLevel>
24+
</PropertyGroup>
25+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26+
<PlatformTarget>AnyCPU</PlatformTarget>
27+
<DebugType>pdbonly</DebugType>
28+
<Optimize>true</Optimize>
29+
<OutputPath>bin\Release\</OutputPath>
30+
<DefineConstants>TRACE</DefineConstants>
31+
<ErrorReport>prompt</ErrorReport>
32+
<WarningLevel>4</WarningLevel>
33+
</PropertyGroup>
34+
<ItemGroup>
35+
<Reference Include="System" />
36+
<Reference Include="System.Core" />
37+
<Reference Include="System.Xml.Linq" />
38+
<Reference Include="System.Data.DataSetExtensions" />
39+
<Reference Include="Microsoft.CSharp" />
40+
<Reference Include="System.Data" />
41+
<Reference Include="System.Net.Http" />
42+
<Reference Include="System.Xml" />
43+
</ItemGroup>
44+
<ItemGroup>
45+
<Compile Include="Program.cs" />
46+
<Compile Include="Properties\AssemblyInfo.cs" />
47+
</ItemGroup>
48+
<ItemGroup>
49+
<None Include="App.config" />
50+
</ItemGroup>
51+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
52+
</Project>

0 commit comments

Comments
 (0)