From af71acd9746cba2df7b2c33993fa9a5f586af3e5 Mon Sep 17 00:00:00 2001 From: TiagoRG <35657250+TiagoRG@users.noreply.github.com> Date: Wed, 18 Jan 2023 10:56:53 +0000 Subject: [PATCH] FP: Aula01 finished --- 1ano/fp/aula01/ex08.py | 11 +++++++++++ 1ano/fp/aula01/ex09.py | 16 ++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 1ano/fp/aula01/ex08.py create mode 100644 1ano/fp/aula01/ex09.py diff --git a/1ano/fp/aula01/ex08.py b/1ano/fp/aula01/ex08.py new file mode 100644 index 0000000..689cdc7 --- /dev/null +++ b/1ano/fp/aula01/ex08.py @@ -0,0 +1,11 @@ +PF = 20 +PC = 24.95 +IMP = 0.23 +SPA = 0.20 + +profit_per_book = ((PC - SPA) / (1 + IMP)) - PF +imp_per_book = IMP * PC + +books_n = int(input('Number of sold books: ')) +print(f"Lucro total: {profit_per_book * books_n:.2f}") +print(f"Total de impostos: {imp_per_book * books_n:.2f}") diff --git a/1ano/fp/aula01/ex09.py b/1ano/fp/aula01/ex09.py new file mode 100644 index 0000000..7b0bb82 --- /dev/null +++ b/1ano/fp/aula01/ex09.py @@ -0,0 +1,16 @@ +start_time = 6 * 60 + 52 + +walk_distance = 1 +walk_pace = 10 +walk_time = walk_pace * walk_distance + +sprint_distance = 3 +sprint_pace = 6 +sprint_time = sprint_pace * sprint_distance + +back_distance = walk_distance + sprint_distance +back_time = walk_pace * back_distance + +final_time = start_time + walk_time + sprint_time + back_time + +print(f'Chegou a casa às {final_time // 60}:{final_time % 60:02d}')