-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
47 lines (35 loc) · 1.25 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
namespace PracticeClass
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Digite o número da conta:");
int numConta = int.Parse(Console.ReadLine());
Console.WriteLine("Escolha um método de pagamento: 1 - PIX | 2 - BOLETO (FATURAMENTO EM ATÉ 48H)");
int opcao = int.Parse(Console.ReadLine());
IBankAccount pagamento;
switch (opcao)
{
case 1:
pagamento = new PagamentoPix();
Console.WriteLine("Pagamento via PIX selecionado.");
break;
case 2:
pagamento = new PagamentoBoleto();
Console.WriteLine("Pagamento via BOLETO selecionado.");
break;
default:
Console.WriteLine("ERROR");
return;
};
pagamento.numConta = numConta;
pagamento.ExibirSaldoCompleto();
Console.WriteLine("Valor do pagamento:");
decimal valor = decimal.Parse(Console.ReadLine());
pagamento.ProcessarPagamento(valor);
pagamento.ExibirSaldo();
}
}
}