mirror of
https://github.com/markjprice/cs11dotnet7.git
synced 2025-12-06 05:32:03 +01:00
Initial commit
This commit is contained in:
parent
34c95f7739
commit
fca52abf35
|
|
@ -1,21 +1,19 @@
|
||||||
using static System.Console;
|
int numberOfApples = 12;
|
||||||
|
|
||||||
int numberOfApples = 12;
|
|
||||||
decimal pricePerApple = 0.35M;
|
decimal pricePerApple = 0.35M;
|
||||||
|
|
||||||
WriteLine(
|
WriteLine(
|
||||||
format: "{0} apples costs {1:C}",
|
format: "{0} apples cost {1:C}",
|
||||||
arg0: numberOfApples,
|
arg0: numberOfApples,
|
||||||
arg1: pricePerApple * numberOfApples);
|
arg1: pricePerApple * numberOfApples);
|
||||||
|
|
||||||
string formatted = string.Format(
|
string formatted = string.Format(
|
||||||
format: "{0} apples costs {1:C}",
|
format: "{0} apples cost {1:C}",
|
||||||
arg0: numberOfApples,
|
arg0: numberOfApples,
|
||||||
arg1: pricePerApple * numberOfApples);
|
arg1: pricePerApple * numberOfApples);
|
||||||
|
|
||||||
//WriteToFile(formatted); // writes the string into a file
|
//WriteToFile(formatted); // writes the string into a file
|
||||||
|
|
||||||
WriteLine($"{numberOfApples} apples costs {pricePerApple * numberOfApples:C}");
|
WriteLine($"{numberOfApples} apples cost {pricePerApple * numberOfApples:C}");
|
||||||
|
|
||||||
Write("Type your first name and press ENTER: ");
|
Write("Type your first name and press ENTER: ");
|
||||||
string? firstName = ReadLine(); // nulls are expected
|
string? firstName = ReadLine(); // nulls are expected
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,19 @@
|
||||||
using static System.Console;
|
int numberOfApples = 12;
|
||||||
|
|
||||||
int numberOfApples = 12;
|
|
||||||
decimal pricePerApple = 0.35M;
|
decimal pricePerApple = 0.35M;
|
||||||
|
|
||||||
WriteLine(
|
WriteLine(
|
||||||
format: "{0} apples costs {1:C}",
|
format: "{0} apples cost {1:C}",
|
||||||
arg0: numberOfApples,
|
arg0: numberOfApples,
|
||||||
arg1: pricePerApple * numberOfApples);
|
arg1: pricePerApple * numberOfApples);
|
||||||
|
|
||||||
string formatted = string.Format(
|
string formatted = string.Format(
|
||||||
format: "{0} apples costs {1:C}",
|
format: "{0} apples cost {1:C}",
|
||||||
arg0: numberOfApples,
|
arg0: numberOfApples,
|
||||||
arg1: pricePerApple * numberOfApples);
|
arg1: pricePerApple * numberOfApples);
|
||||||
|
|
||||||
//WriteToFile(formatted); // writes the string into a file
|
//WriteToFile(formatted); // writes the string into a file
|
||||||
|
|
||||||
WriteLine($"{numberOfApples} apples costs {pricePerApple * numberOfApples:C}");
|
WriteLine($"{numberOfApples} apples cost {pricePerApple * numberOfApples:C}");
|
||||||
|
|
||||||
Write("Type your first name and press ENTER: ");
|
Write("Type your first name and press ENTER: ");
|
||||||
string? firstName = ReadLine(); // nulls are expected
|
string? firstName = ReadLine(); // nulls are expected
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue