Categories
Python homework help

“Number Analysis and Total Sales Calculator”

 Instructions:
Q1. Design a program that asks the user to enter a series of 20 numbers. The program should store the numbers in a list then display the following data:
The lowest number in the list
The highest number in the list
The total of the numbers in the list
The average of the numbers in the list
Q2. Total Sales
Design a program that asks the user to enter a store’s sales for each day of the week. The amounts should be stored in a list. Use a loop to calculate the total sales for the week and display the result.

Categories
Python homework help

“List Operations and Total Sales Calculation Program”

 Instructions:
Q1. Design a program that asks the user to enter a series of 20 numbers. The program should store the numbers in a list then display the following data:
The lowest number in the list
The highest number in the list
The total of the numbers in the list
The average of the numbers in the list
Q2. Total Sales
Design a program that asks the user to enter a store’s sales for each day of the week. The amounts should be stored in a list. Use a loop to calculate the total sales for the week and display the result.

Categories
Python homework help

“Bank Account Program”

 
Q2. Write the following codes and submit the files in the “Submission.” Note. You first need to write the code related to Q1(a), then write the code related to part Q1(b).  Both files need to be saved in the same place.
Submission:
1. A summary of the program, what does the program do
2. Screenshot of the Running program
Q1.
a). Note , that you must save the following code Q1(a) with the name “bankaccount.py” 
# The BankAccount class simulates a bank account.
class BankAccount:
    # The __init__ method accepts an argument for
    # the account’s balance. It is assigned to
    # the __balance attribute.
    def __init__(self, bal):
        self.__balance = bal
    # The deposit method makes a deposit into the
    # account.
    def deposit(self, amount):
        self.__balance += amount
    # The withdraw method withdraws an amount
    # from the account.
    def withdraw(self, amount):
        if self.__balance >= amount:
            self.__balance -= amount
        else:
            print(‘Error: Insufficient funds’)
    # The get_balance method returns the
    # account balance.
    def get_balance(self):
        return self.__balance
 ========================== 
b): You can save the following code with any name, but the Q1(a) must be saved as bankaccount.py because you are import this file as shown in the following code.
# This program demonstrates the BankAccount class.
import bankaccount
def main():
    # Get the starting balance.
    start_bal = float(input(‘Enter your starting balance: ‘))
    # Create a BankAccount object.
    savings = bankaccount.BankAccount(start_bal)
    # Deposit the user’s paycheck.
    pay = float(input(‘How much were you paid this week? ‘))
    print(‘I will deposit that into your account.’)
    savings.deposit(pay)
    # Display the balance.
    print(f’Your account balance is ${savings.get_balance():,.2f}.’)
    # Get the amount to withdraw.
    cash = float(input(‘How much would you like to withdraw? ‘))
    print(‘I will withdraw that from your account.’)
    savings.withdraw(cash)
    # Display the balance.
    print(f’Your account balance is ${savings.get_balance():,.2f}.’)
# Call the main function.
main()

Categories
Python homework help

“Python Business Application: Utilizing Fundamental Concepts for Practical Solutions”

 
For your final project in the Business Applications course, you will be tasked with creating a Python program that demonstrates your understanding of various fundamental concepts covered throughout the semester. Your project should showcase your ability to utilize if statements, for loops, while loops, file input/output operations, functions, and lists in the context of developing a practical business application.
Project Requirements:
1. Choose a Business Scenario: Select a specific business scenario or problem that your program will address. This could be anything from inventory management to sales analysis, customer database management, or financial forecasting.
2. Implement If Statements: Utilize if statements to implement decision-making logic within your program. For example, you may use if statements to check conditions such as inventory levels, customer preferences, or sales targets.
3. Incorporate For Loops: Use for loops to iterate over sequences of data or perform repetitive tasks efficiently. This could involve processing lists of products, analyzing sales data over a period of time, or generating reports for multiple customers.
4. Utilize While Loops: Employ while loops where appropriate, especially for scenarios where you need to repeatedly perform a task until a certain condition is met. This could include tasks like continuously updating inventory levels, processing customer orders, or iterating through a dataset until a specific criteria is satisfied.
5. Read and Write to a Text File: Implement file input/output operations to read data from external sources (such as a text file) and write output back to a file. This could involve reading customer information from a text file, logging sales transactions, or storing inventory data for future reference.
6. Define Functions: Organize your code into functions to encapsulate specific tasks or operations. This promotes code reusability and maintainability. Functions could be used for tasks such as calculating total sales, updating inventory levels, or generating reports.
7. Utilize Lists: Use lists to store and manipulate collections of data within your program. This could include maintaining lists of products, customer information, sales transactions, or any other relevant data for your chosen business scenario.
Project Deliverables:
1. Project Proposal: Provide a brief overview of your chosen business scenario and outline the specific features and functionality you plan to implement in your Python program (one page, single space).
2. Python Code: Submit your Python code files containing the implementation of your business application. Make sure your code is well-structured, well-commented, and follows best practices for readability and maintainability.
Evaluation Criteria:
Your final project will be evaluated based on the following criteria:
1. Completeness: Does the project meet all the specified requirements, including the use of if statements, for loops, while loops, file input/output operations, functions, and lists?
 
2. Functionality: Does the project effectively address the chosen business scenario? Does it perform the intended tasks accurately and efficiently?
3. Code Quality: Is the code well-structured, well-commented, and easy to understand? Does it follow best practices for Python development?
4. Creativity: Does the project demonstrate creativity and innovation in its approach to solving the business problem?