关键词 > FC308

FC308 Practical Programming Assignment – Part1

发布时间:2024-05-28

Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

FC308 Practical Programming Assignment - Part1

Module Title  :    Information Technology

Module Code :    FC308

CONTENTS:

No:

Topic

Pg. No

1

1.1

1.2

Algorithm

Task1- (fill in the name of tasks)

Task2-

 

2

2.1

2.2

Technical Overview

Task1-

Task2-

 

3

3.1

3.2

Python Code with Comments

Task1-

Task2-

 

4

4.1

4.2

Testing

Task1-

Task2-

 

5

Evaluation and Summary

 

6

References

 

1.ALGORITHM

Task 1: Simple Interest calculator

Algorithm:

Provide a comprehensive algorithm of the program , you also provide a pseudocode demonstrating the working of your code

Example of algorithm/ pseudocode for the python program

 

Students have to provide a fully functional algorithm

Flowchart

Consider a following example of a flow chart

 

Similarly, for task 2 , provide the above details

Note: Flow chart and Algorithms are mandatory

Task 2: High score manager

Algorithm

Flowchart

2.TECHNICAL OVERVIEW

Consider the following technical overview for the game developed in Python:

Users may design and play their own interactive stories using the "Create Your Own Adventure" program, which is a Python-based text adventure game. The application is  broken  up  into  three  sections:   user   registration  and   login,  part  one  of  the story involves creating an inventory, and part two involves playing the adventure.

To achieve its functionality, the software makes use of a number of programming methods. Iterative loops, which repeatedly carry out a set of instructions, are one important approach. The software use for loops to repeatedly run over several game components, including the scenarios in parts one and two of the adventure and the inventory items available to the player.

The software also makes use of selection statements, such as if-else statements, to assess circumstances and carryout certain instructions in accordance with the results. This method is heavily utilized throughout the software to manage user input, verify user credentials, and control the result of various game events.

The usage of sub-functions, which are tiny functions that are called by the main program to carryout particular duties, is another significant programming method. The program has three sub-functions that are called by the main program based on user input: login, register, and difficulty.

The  application   manipulates  and  stores  data   using  a  variety  of  different  data structures. For instance, the application utilizes a list called "Player inventory" to store the user's chosen products and a "User data" dictionary to record user credentials. Lists are also used by the application to hold the many options and scenarios that the user can select from.

The data structures used by the application are carefully selected to provide effective data storage and retrieval. For instance, dictionaries are used to store user data as they make data retrieval based on keys quick and easy. Since lists make it simple to manipulate and index data, they are frequently used to store inventory items and game scenarios.

Function

Specification

Data Structure

 

 

 

 

 

register():

Runs a while loop to request the user for a username and check to see whether it

already exists in the User data dictionary. Requests a password from the user and

adds the new user's credentials to the

User data dictionary. The json module is

used to dump the User data dictionary into the filename given. Returns True when the registration was successful.

 

Uses a while loop to check

user’s input. The usernames   and passwords of registered   users are stored in User data. The json module is used to

read and write data to a file.

 

Uses a for loop with 5 iterations to process over the login attempts. The user is asked

 

 

 

 

login():

to provide their username and password

that was previously created. Checks to see if the given username and password match those of an existing user. If the credentials  are correct, the function produces

a message indicating a successful

login and returns True. If the credentials do

not match, an error message is printed along with the amount of attempts

remaining. If the limit number of tries is reached, the program prints an error

message and quits.

Uses a for loop to limit the

login attempts. The usernames and passwords of registered

users are stored in a dictionary called User data. Conditions

are used to validate user input  and regulate program flow. To  quit the program, use the exit() function.

 

 

difficulty():

Uses a while loop to be repeated until the user inputs a valid input. The user is

prompted to choose a difficulty level: 1 for easy, 2 for medium, or 3 for hard. Checks for valid input from the user and returns

the time limit for the specified level. If an

invalid choice is entered, an error message is printed and the cycle is continued.

Uses a while loop to check user input. Conditional

statements are used to

regulate program flow. The input() function is used to

obtain user input, and the int() function is used to transform

the input to an integer

number.

 

 

 

 

menu():

Displays a greeting message to the user. A while loop is used to repeatedly remind the user to select an option until they decide to exit the game. Displays the user's

available choices. Uses if-elf statements to carry out the selected choice. Print

statements are used to deliver useful

messages regarding the story to the user.

Uses if-elif statements to run various programs dependent on the user's selection. To

execute certain actions, the functions login(), register(),  Play_Story1(), and

Play_Story2() are used. The

dictionary User data is used to hold registered users'

usernames and passwords.

In the example above, the user has explained the many functions used in the program, as well as loops and if else statements. Students can take a different approach to creating the technical overview by providing images of important fragments of code and explaining how the while loop, if else, for loop, or function works in that segment of the code.

Students have to provide technical overview for task 1 and task 2 separately

Task 1

Write technical overview

Task 2

Write technical overview

3.PYTHON CODE

In section of the report copy paste your code

No Screenshots  Only copy paste!!!

Task 1 Code:

Task 2 Code:

4.TESTING

Task 1:

Testing for Development

Describe the development process for your code.  Give several screenshots of your code starting from a simple code with no difficult functions, followed by different versions or upgrades of your code and how you built it into a final version, such ashow you added   functions and while loops to make the code better.

Testing for Evaluation

In this area, you must provide various screenshots of output, such as one demonstrating a correctly running program, as well as different output examples, such as when you give a negative input,the software should display invalid input and ask you to enter the amount  again.

Similarly give screenshots of different variations of the output.

Follow the same for Task2

Task 2:

Testing for Development

Testing for Evaluation

5.EVALUATION AND SUMMARY

a short (no more than one page) and accurate reflection of how well you think the

solution works and what improvements are needed or could be made. The evaluation

should use the testing that was carried out to evaluate the functionality of the programs created.

Task 1:

Task 2: