Practical Case - Phase2
Practical Case - Phase2
Programming
Course 2023/2024
Practical Case
Contents
1 Introduction ................................................................................................................2
1.1 Evaluation ...........................................................................................................2
1.2 Delivery...............................................................................................................2
1.3 Defence...............................................................................................................2
1.4 Extra Requirements (changes)..............................................................................3
2 Statement of Phase 2 ...................................................................................................4
2.1 Introduction ........................................................................................................4
2.2 Tasks to implement in Phase 2 .............................................................................4
2.2.1 TASK 1: Menu improvements. .............................................................................................. 4
2.2.2 TASK 2: Navigation to previous menu .................................................................................. 5
2.2.3 TASK 3: Create functions for menus ..................................................................................... 7
2.2.4 TASK 4: Data verification ...................................................................................................... 7
Programming
Bachelor’s degree in mechanical/Electrical Power Engineering
1 Introduction
This document describes the statement of the second phase of the practical case that will put
into practice what you have learned in class regarding repetitive statements (loops) and
functions. Keep in mind, the requirements highlighted in phase 1 need to be considered when
working on this phase of the practical case as well.
1.1 Evaluation
This phase scores 15% of the total grade for the course. The teachers of the course will evaluate
the submission and will publish the grades at the end of the term on Aula Global. Grade reviews
can be requested after that. The final grade of the practical case is calculated as follow:
• Python Jupyter Notebook grade (JNgrade), this grade is the same for all team members.
• Work defence (workdDefence): it is the individual grade of each student's knowledge of
the practice delivered (a grade between 0 and 1). More information on this could be
found in section 1.4.
1.2 Delivery
The delivery will be made through Aula Global by Thursday, 10th of November at 9am.
The deliverable should be submitted as a single Python Jupyter Notebook file (.ipynb), and will
be evaluated as follow:
• (0.5%) Cover page: shows practical case submission number (PHASE 1), name of
authors, course 2023-24, group and grade.
• (0.5%) Introduction: a brief introduction to the practical case, including comments to
des-ambiguate/clarify or complete the statement if necessary.
• (10%) Code: just ONE cell is required/allowed for the code so the program can be
executed all together.
o IMPORTANT: The code should include execution examples to confirm validation
tests, mainly edge cases.
• (3%) Validation: for each task some test cases must be performed to verify/test if your
code is functioning properly, with special attention to the edge cases (for instance,
division by zero. In loops, testing the first and last item, etc.).
• (1%) Conclusions: conclusions on the completeness/effectiveness of the solution
provided. Moreover, personal opinions on the difficulty of the practical case and how
useful it is for you to better understand the contents of the course are also welcomed.
1.3 Defence
The defence of the work will take place in the classroom on 16th of November at 9:00 for group
(19) and 17th of November at 9:00 for group (59), where the team will present their project
and each team member will be asked to explain design and implementation decisions. After the
defence, each student, individually, will obtain a grade between 0 and 1 that modulates the final
grade of this phase of the practical case.
Programming
Bachelor’s degree in mechanical/Electrical Power Engineering
Unlike phase 1, the use of loops and functions is mandatory in this phase. However, it is not yet
allowed to use lists or vectors or any other complex storage system. Please remember that it is
not allowed to use the in operator to check if a character is within a text string or functions.
You can use the following functions seen in class when needed:
• print( ): Display texts or variables on the screen.
• len( ): Get the length of a text string or list.
• input( ): Obtain user input via keyboard.
• range( ): Generation of an arithmetic sequence.
• enumerate( ): Converting a list into an enumerable object that can be traversed with a
for loop. Being able to access the index and value.
• zip( ): Combination of two or more lists to loop through them with a for loop.
• Functions created by you (students) in practice.
Programming
Bachelor’s degree in mechanical/Electrical Power Engineering
2 Statement of Phase 2
2.1 Introduction
We are going to continue with the development of a system for a company that is dedicated to
selling security systems to its clients.
The current document shows the specifications to be developed in PHASE 2 of the project. More
specifically, in this phase will improve the development of menu navigation, incorporate input
data checking, and encapsulate code snippets into functions.
In the previous phase, if a user entered an invalid option in a menu, the program displays an
error message “Error: Invalid option in menu Y”, Y is the name of the menu where the incorrect
selection was made and then ends.
● If user indicates an incorrect option, an error message must be displayed (as explained
previously), however the program must now show the menu options and request an
option from the user again (repetitively). An example of how the program should
perform in this case is shown in Figure 1:
In this delivery, users must be given the possibility of returning to the main menu from any of
the sub menus (customer management menu, sensor management menu, systems
management menu, sales management menu). For this, it is requested to:
• Include an additional option in each sub menu: “B. Back.” to return to the main menu.
The following figures show these additional return options.
• Selecting the B. back option, B (uppercase) or b (lowercase), in any of the sub menus
should display the main menu again as shows in Figure 6.
• If the user selects E (uppercase) or e (lowercase) in a sub menu, the program should end
directly, without displaying anything to the user but the “End” message.
• Figure 7 shows the navigation flow between the menus.
B B
B
B
B
B
B
Figure 7. Schema menu navigation
Programming
Bachelor’s degree in mechanical/Electrical Power Engineering
At the code level, students must implement /encapsulate menus in functions. Students must
implement 5 functions (one function for each menu) that can show the menu header, menu
options, and prompt the user for an entry. The function will return the corresponding content
to what the user has entered (whether correct or not, since the validation will be carried out
afterwards). These functions must be used for displaying the menus.
NOTE: The similarities in some of these menus can help the students reducing the 5 functions to
3: (one function for the main menu; one function for the sensor management menu and the
system management menu; and one last function for the customer management menu and the
sales management menu).
As implemented in the previous phase, the user can enter a customer's data in option 1 (new
customer) of the customer management menu. In this phase, students are requested to carry
out checks on these data that are entered by the user. If the system detects that some data has
been entered incorrectly, using the following checks/requirements, it should ask the user to fill
the incorrect data again:
• Name: It must not contain any digits, the name must not contain any digits such as “0”,
“ ”, “ ”, “ ”, “ ”, “5”, “6”, “7”, “8”, “9”.
• Last name: It must not contain any digits, the name must not contain any digits such as
“0”, “ ”, “ ”, “ ”, “ ”, “5”, “6”, “7”, “8”, “9”.
• DNI: It must end with the letter “A”.
• Direction: minimum length must be 3 (or greater).
• Population: minimum length must be 3 (or greater).
• Telephone: It must be exactly 9 digits/characters.
Please see Figure 8 that shows the execution of the user's data entry when making errors.
Programming
Bachelor’s degree in mechanical/Electrical Power Engineering