Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The objectives of this project are to: Create a daily project using Python Implement Python programs Use data structures

The objectives of this project are to:  

• Create a daily project using Python  

• Implement Python programs  

• Use data structures in Python  

• Work with wrapper functions  

• Practice the Shell script  

• Manage file permissions  

• Work with data structures and its properties

 

Use the instructions below to plan and implement your project. It is recommended that you perform  the tasks in the order provided below. You want to keep track of your expenses in a very light‐weight  fashion. You'll never track them if you have to wait for a spreadsheet program to open and navigate to  a particular cell. Also, you have a shortcut for opening the terminal on your computer, so a simple  command‐line interface is exactly what's needed for your expenses.  

 

How Do I Use Expenses?  Expenses are contained in a single executable. Put them in your PATH somewhere.      

 

It does have the following dependencies:  

‐ Python 3.9+      

 

Develop the following features into the project:      

Menu Selections:  

• Add an Expense.  

• Remove an Expense.  

• Add Revenue.  

• Remove Revenue.  

• Check Budget Balance.  

• Exit      

 

 

1. Add an Expense:  Write the function that will add an expense for a particular user. This will subtract the actual amount  per month. Let's say the user added $100 expense as an expense and he/she has a monthly balance of  $5000. The add function will minus the amount entered. Check the result using check budget function,  which will show the actual result i.e. $4900.      

 

 

2. Remove an Expense:  Write the function that will remove an expense for a particular user. This will add the actual amount per  month. Let's say the user removed an expense of $100. If he/she has a monthly balance of $5000 then  the remove function will add the amount entered. See the result using check budget function, which  will show the actual result i.e. $5100.    

 

 3. Add Revenue:  CA‐LNXOS / Linux OS and Environment  3  Write the function which will add the revenue for particular user which will add the actual amount per  month. Let's say user have added revenue $100 and he/she have monthly balance of $5000 then this  add revenue function will add the amount entered. See the result using check budget function which  will show you actual result i.e. $5100.      

 

4. Remove Revenue:  Write the function which will remove the revenue for a particular user. This will subtract the actual  amount per month. Let's say the user removed revenue worth $100 and he/she has monthly balance  of $5000. This remove revenue function will subtract the amount entered. See the result using check  budget function, which will show you actual result i.e. $4900.

 

 5. Check Budget Balance:   When the user selects this option, the system simply checks the data for the user and displays the  current balance. Checking the account balance does not alter the balance itself.  

 

6. Exit  This will exit the program.      

 

Task 2  Your recently acquired Linux, File permission, and Bash Shell skills have provided you with the skills and  confidence to take on a leadership role as the brains of this operation. Use the instructions below to  plan and implement your task. It is recommended that you perform each step in the same order as they  appear in the instructions below.      

• How can we figure out the number of lines or number of words in a file?  

• The easiest way to count the number of lines, words, and characters in a text file is to use the  Linux command "wc" in terminal.  

• To count the number of lines, use "wc" with "l" as wc ‐l yourTextFile  

• To count the number of words, use "wc" with "w" option as wc ‐w yourTextFile      

 

Write a shell script to read the number of lines and print their count in file. (You need to create a  sample file and read it into the program)  

 

Create new text file, read, and show the count using shell script. Provide appropriate file permission  while running the shell script.      

 

Task 3:  Develop the classic game "Hangman". First, it will ask you to enter a username. After entering the  name, the game will begin. You need to create the game in such a way that the user has to guess each  character in the word. The word you try to guess is represented by a row of dashes. If the player  guesses a letter which is in the word, the script adds the letter in spaces where they are supposed to  appear. The player has 10 turns to complete the word. You can easily customize the game by changing  the variables.      

 

Following output, it should display:  

What is your name? Usama   Hello, Usama. Time to play hangman! Start guessing...  

_ _ _ _ _ _  

Guess a character: a  

Wrong  

You have 9 more guesses  

_ _ _ _ _ _

guess a character: s

s _ _ _  _ _

guess a character: e

 s e _ _ e _  

guess a character: c

s e c _ e _

guess a  character: r

s e c r e _

guess a  character: e

s e c r e _

guess a  character: t

s e c r e t

You won

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Accounting Principles

Authors: Jerry Weygandt, Paul Kimmel, Donald Kieso

12th edition

1119132223, 978-1-119-0944, 1118875052, 978-1119132226, 978-1118875056

More Books

Students also viewed these Programming questions

Question

16. What is the difference between a lesion and an ablationpg109

Answered: 1 week ago