0% found this document useful (0 votes)
18 views8 pages

Practical Case - Phase2

Uploaded by

Daniite 0610
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views8 pages

Practical Case - Phase2

Uploaded by

Daniite 0610
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Programming

Bachelor’s degree in mechanical/Electrical Power Engineering

Programming
Course 2023/2024

Practical Case

Security systems sales management.


Phase 2

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.

PhaseGrade = JNgrade * workDefence

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

1.4 Extra Requirements (changes)

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.

2.2 Tasks to implement in Phase 2

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.

2.2.1 TASK 1: Menu improvements.

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.

In task 1 of phase 2 it is requested that in all menus:

● 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:

Figure 1. Invalid option in a menu


Programming
Bachelor’s degree in mechanical/Electrical Power Engineering

2.2.2 TASK 2: Navigation to previous menu

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.

Figure 2. Back option in Customer Management Menu

Figure 3. Back option in Sensor Management Menu

Figure 4. Back option in Security System Management Menu

Figure 5. Back option in Sale Management Menu


Programming
Bachelor’s degree in mechanical/Electrical Power Engineering

• 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.

Figure 6. Navigation to previous menu

• 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

2.2.3 TASK 3: Create functions for menus

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).

2.2.4 TASK 4: Data verification

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

Figure 8. Example of data checking

You might also like