-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathslides13-parte2-ex2--programa-principal.py
More file actions
53 lines (37 loc) · 1.5 KB
/
Copy pathslides13-parte2-ex2--programa-principal.py
File metadata and controls
53 lines (37 loc) · 1.5 KB
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
45
46
47
48
49
50
51
52
53
from slides13parte2ex2 import *
#importou as classes Biblioteca e Livro
def imprimeMenu():
print()
print("----------------------------------------------")
print(":: Bem vindo 'a biblioteca da U F R P E ::")
print(":: Por favor, selecione a opcao desejada: ::")
print(":: 1. Cadastrar um livro ::")
print(":: 2. Alugar um livro ::")
print(":: 3. Devolver um livro ::")
print(":: 4. Exibir o livro mais alugado ::")
print(":: 5. Sair do sistema ::")
print("--------------------------------------------::")
print(":::::: Digite a sua opcao: ")
return input()
#programa principal:
bib = Biblioteca()
sair = False
while sair == False:
op = imprimeMenu()
if op == "5":
sair = True
elif op == "1": #inserir um livro
tit = input("Digite o titulo do livro: ")
aut = input("Digite os autores do livro: ")
l = Livro(tit, aut)
bib.inserirLivro(l)
elif op == "2": #alugar
cod = int(input("Digite o codigo do livro que deseja ALUGAR: "))
bib.alugarLivro(cod)
elif op == "3": #devolver
cod = int(input("Digite o codigo do livro que deseja DEVOLVER: "))
bib.devolverLivro(cod)
elif op == "4": #livro mais alugado
bib.livroMaisAlugado()
else:
print("Erro! Opcao invalida! Voce deve escolher uma opcao entre 1 e 5")