代写Computer Science 120 M3-4 OOP CODING代做留学生Python程序

- 首页 >> C/C++编程

M3-4 OOP CODING

Computer Science 120—Summative Assignment

Instructions:

Create a Python class and a test script. for the problem. Make sure your test script. exercises all aspects of the class.

Checklist:

• Use pseudocode to plan your program before coding.

• Use proper indentation and whitespace to enhance readability.

• Run and test your program to ensure it works.

• At the end of the program, include:

o Any changes made to your original pseudocode plan.

o A comment describing where and how you used generative AI, including screenshots of your prompts and responses.

Save your Python file with an appropriate name.

You may use AI to help:

• Compare your solution to an AI-generated one.

• Ask AI to troubleshoot errors only after attempting it yourself.

If your work relies too heavily on AI, it may be treated like plagiarism and receive a zero.

Here are some options for how you may use generative AI to assist you with this assignment:

After you have done your own work, compare it to an AI generated solution by asking it to break down the same problem using computational thinking.

o Evaluate the work of the AI for its approach, style, efficiency, and effectiveness. What did it do differently and what advantages/disadvantages are there to solving the problem in this way?

If you are getting errors you cannot troubleshoot on your own, ask an AI to identify these issues for you.

Always cite where and how you used generative AI as a comment at the end of your program. Only use AI generated code that you fully understand and can confidently modify for your own needs.

Complete BOTH of the following problems

Class 1: Product Class

Write a class called Product designed to model a product.

• It contains private instance variables name, price, and quantity.

• It has an initializer/constructor to initialize all these variables, with quantity having a default value of 0.

• It also has getter/setter methods for accessing and modifying all the variables.

• You will also create a str method.

Test all of the constructors and methods with a test class.

Class 2: BankAccount Class

Write a class called BankAccount designed to model a bank account.

• It contains private instance variables account_number, balance, and account_holder_name.

• It has an initializer/constructor to initialize these variables, with balance having a default value of 0.

• It also has getter/setter methods for accessing and modifying all the variables.

• You will also create a str method.

Test all of the constructors and methods with a test class.





站长地图