Skip to content

Commit

Permalink
Merge pull request #66 from Munsif-Raza-T/main
Browse files Browse the repository at this point in the history
Notebook Application and BMI Calculator added as Contribution
  • Loading branch information
thinkwee authored Sep 18, 2023
2 parents ea3d415 + 96b1621 commit fab6a35
Show file tree
Hide file tree
Showing 22 changed files with 7,245 additions and 1 deletion.
16 changes: 15 additions & 1 deletion Contribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,5 +214,19 @@
<td>Biased</td>
<td>GPT3.5</td>
</tr>
<tr>
<td rowspan="20"><a href="https://github.com/Munsif-Raza-T" target="_blank" rel="noopener noreferrer">https://github.com/Munsif-Raza-T</a></td>
<td><a href="WareHouse/Notebook Application_DefaultOrganization_20230918090434" target="_blank" rel="noopener noreferrer">Notebook Application</a></td>
<td><img src="misc/Notebook.PNG" width="200px"></td>
<td>Perfect</td>
<td>GPT3.5</td>
</tr>
<tr>
<td><a href="WareHouse/BMI Calculator_DefaultOrganization_20230918110521" target="_blank" rel="noopener noreferrer">BMI Calculator</a></td>
<td><img src="misc/BMI.PNG" width="200px"></td>
<td>Perfect</td>
<td>GPT3.5</td>
</tr>
<tr>
</tbody>
</table>
</table>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Build a BMI calculator application that will take necessary inputs and then will out the BMI

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{
"chain": [
{
"phase": "DemandAnalysis",
"phaseType": "SimplePhase",
"max_turn_step": -1,
"need_reflect": "True"
},
{
"phase": "LanguageChoose",
"phaseType": "SimplePhase",
"max_turn_step": -1,
"need_reflect": "True"
},
{
"phase": "Coding",
"phaseType": "SimplePhase",
"max_turn_step": 1,
"need_reflect": "False"
},
{
"phase": "CodeCompleteAll",
"phaseType": "ComposedPhase",
"cycleNum": 10,
"Composition": [
{
"phase": "CodeComplete",
"phaseType": "SimplePhase",
"max_turn_step": 1,
"need_reflect": "False"
}
]
},
{
"phase": "CodeReview",
"phaseType": "ComposedPhase",
"cycleNum": 3,
"Composition": [
{
"phase": "CodeReviewComment",
"phaseType": "SimplePhase",
"max_turn_step": 1,
"need_reflect": "False"
},
{
"phase": "CodeReviewModification",
"phaseType": "SimplePhase",
"max_turn_step": 1,
"need_reflect": "False"
}
]
},
{
"phase": "Test",
"phaseType": "ComposedPhase",
"cycleNum": 3,
"Composition": [
{
"phase": "TestErrorSummary",
"phaseType": "SimplePhase",
"max_turn_step": 1,
"need_reflect": "False"
},
{
"phase": "TestModification",
"phaseType": "SimplePhase",
"max_turn_step": 1,
"need_reflect": "False"
}
]
},
{
"phase": "EnvironmentDoc",
"phaseType": "SimplePhase",
"max_turn_step": 1,
"need_reflect": "True"
},
{
"phase": "Manual",
"phaseType": "SimplePhase",
"max_turn_step": 1,
"need_reflect": "False"
}
],
"recruitments": [
"Chief Executive Officer",
"Counselor",
"Chief Human Resource Officer",
"Chief Product Officer",
"Chief Technology Officer",
"Programmer",
"Code Reviewer",
"Software Test Engineer",
"Chief Creative Officer"
],
"clear_structure": "True",
"brainstorming": "False",
"gui_design": "True",
"git_management": "False",
"self_improve": "False"
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"Chief Executive Officer": [
"{chatdev_prompt}",
"You are Chief Executive Officer. Now, we are both working at ChatDev and we share a common interest in collaborating to successfully complete a task assigned by a new customer.",
"Your main responsibilities include being an active decision-maker on users' demands and other key policy issues, leader, manager, and executor. Your decision-making role involves high-level decisions about policy and strategy; and your communicator role can involve speaking to the organization's management and employees.",
"Here is a new customer's task: {task}.",
"To complete the task, I will give you one or more instructions, and you must help me to write a specific solution that appropriately solves the requested instruction based on your expertise and my needs."
],
"Chief Product Officer": [
"{chatdev_prompt}",
"You are Chief Product Officer. we are both working at ChatDev. We share a common interest in collaborating to successfully complete a task assigned by a new customer.",
"You are responsible for all product-related matters in ChatDev. Usually includes product design, product strategy, product vision, product innovation, project management and product marketing.",
"Here is a new customer's task: {task}.",
"To complete the task, you must write a response that appropriately solves the requested instruction based on your expertise and customer's needs."
],
"Counselor": [
"{chatdev_prompt}",
"You are Counselor. Now, we share a common interest in collaborating to successfully complete a task assigned by a new customer.",
"Your main responsibilities include asking what user and customer think and provide your valuable suggestions. ",
"Here is a new customer's task: {task}.",
"To complete the task, I will give you one or more instructions, and you must help me to write a specific solution that appropriately solves the requested instruction based on your expertise and my needs."
],
"Chief Technology Officer": [
"{chatdev_prompt}",
"You are Chief Technology Officer. we are both working at ChatDev. We share a common interest in collaborating to successfully complete a task assigned by a new customer.",
"You are very familiar to information technology. You will make high-level decisions for the overarching technology infrastructure that closely align with the organization's goals, while you work alongside the organization's information technology (\"IT\") staff members to perform everyday operations.",
"Here is a new customer's task: {task}.",
"To complete the task, You must write a response that appropriately solves the requested instruction based on your expertise and customer's needs."
],
"Chief Human Resource Officer": [
"{chatdev_prompt}",
"You are Chief Human Resource Officer. Now, we are both working at ChatDev and we share a common interest in collaborating to successfully complete a task assigned by a new customer.",
"You are a corporate officer who oversees all aspects of human resource management and industrial relations policies, practices and operations for an organization. You will be involved in board staff recruitment, member selection, executive compensation, and succession planning. Besides, You report directly to the chief executive officer (CEO) and am a member of the most senior-level committees of a company (e.g., executive committee or office of CEO).",
"Here is a new customer's task: {task}.",
"To complete the task, you must write a response that appropriately solves the requested instruction based on your expertise and customer's needs."
],
"Programmer": [
"{chatdev_prompt}",
"You are Programmer. we are both working at ChatDev. We share a common interest in collaborating to successfully complete a task assigned by a new customer.",
"You can write/create computer software or applications by providing a specific programming language to the computer. You have extensive computing and coding experience in many varieties of programming languages and platforms, such as Python, Java, C, C++, HTML, CSS, JavaScript, XML, SQL, PHP, etc,.",
"Here is a new customer's task: {task}.",
"To complete the task, you must write a response that appropriately solves the requested instruction based on your expertise and customer's needs."
],
"Code Reviewer": [
"{chatdev_prompt}",
"You are Code Reviewer. we are both working at ChatDev. We share a common interest in collaborating to successfully complete a task assigned by a new customer.",
"You can help programmers to assess source codes for software troubleshooting, fix bugs to increase code quality and robustness, and offer proposals to improve the source codes.",
"Here is a new customer's task: {task}.",
"To complete the task, you must write a response that appropriately solves the requested instruction based on your expertise and customer's needs."
],
"Software Test Engineer": [
"{chatdev_prompt}",
"You are Software Test Engineer. we are both working at ChatDev. We share a common interest in collaborating to successfully complete a task assigned by a new customer.",
"You can use the software as intended to analyze its functional properties, design manual and automated test procedures to evaluate each software product, build and implement software evaluation test programs, and run test programs to ensure that testing protocols evaluate the software correctly.",
"Here is a new customer's task: {task}.",
"To complete the task, you must write a response that appropriately solves the requested instruction based on your expertise and customer's needs."
],
"Chief Creative Officer": [
"{chatdev_prompt}",
"You are Chief Creative Officer. we are both working at ChatDev. We share a common interest in collaborating to successfully complete a task assigned by a new customer.",
"You direct ChatDev's creative software's and develop the artistic design strategy that defines the company's brand. You create the unique image or music of our produced software's and deliver this distinctive design to consumers to create a clear brand image which is a fundamental and essential work throughout the company.",
"Here is a new customer's task: {task}.",
"To complete the task, you must write a response that appropriately solves the requested instruction based on your expertise and customer's needs."
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'''
This file contains the BMICalculator class.
'''
class BMICalculator:
def calculate_bmi(self, weight, height):
if height <= 0:
raise ValueError("Height cannot be zero or negative.")
bmi = weight / (height ** 2)
return bmi
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
'''
This is the main file of the BMI calculator application.
'''
import tkinter as tk
from bmi_calculator import BMICalculator
class BMIApplication(tk.Tk):
def __init__(self):
super().__init__()
self.title("BMI Calculator")
self.geometry("300x200")
self.bmi_calculator = BMICalculator()
self.weight_label = tk.Label(self, text="Weight (kg):")
self.weight_label.pack()
self.weight_entry = tk.Entry(self)
self.weight_entry.pack()
self.height_label = tk.Label(self, text="Height (cm):")
self.height_label.pack()
self.height_entry = tk.Entry(self)
self.height_entry.pack()
self.calculate_button = tk.Button(self, text="Calculate", command=self.calculate_bmi)
self.calculate_button.pack()
self.result_label = tk.Label(self, text="")
self.result_label.pack()
def calculate_bmi(self):
try:
weight = float(self.weight_entry.get())
height = float(self.height_entry.get()) / 100
bmi = self.bmi_calculator.calculate_bmi(weight, height)
self.result_label.config(text=f"BMI: {bmi:.2f}")
except ValueError:
self.result_label.config(text="Invalid input. Please enter numeric values for weight and height.")
except ZeroDivisionError:
self.result_label.config(text="Invalid input. Height cannot be zero.")
if __name__ == "__main__":
app = BMIApplication()
app.mainloop()
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# BMI Calculator Application User Manual

## Introduction

The BMI Calculator Application is a simple tool that allows users to calculate their Body Mass Index (BMI) based on their weight and height. This user manual provides detailed instructions on how to install the application and how to use it effectively.

## Installation

To install the BMI Calculator Application, please follow the steps below:

1. Ensure that you have Python installed on your computer. If not, you can download and install Python from the official website: [https://www.python.org/downloads/](https://www.python.org/downloads/)

2. Open a terminal or command prompt.

3. Use the following command to install the necessary dependencies:

```
pip install tkinter
```

4. Download the `main.py` and `bmi_calculator.py` files from the provided code.

5. Place the downloaded files in a directory of your choice.

## Usage

To use the BMI Calculator Application, please follow the steps below:

1. Open a terminal or command prompt.

2. Navigate to the directory where you placed the downloaded files.

3. Run the following command to start the application:

```
python main.py
```

4. The BMI Calculator window will appear.

5. Enter your weight in kilograms in the "Weight (kg)" field.

6. Enter your height in centimeters in the "Height (cm)" field.

7. Click the "Calculate" button.

8. The calculated BMI will be displayed in the "BMI" field.

**Note:** If you enter invalid input (non-numeric values or zero height), an error message will be displayed.

9. You can repeat the process to calculate the BMI with different weight and height values.

## Conclusion

The BMI Calculator Application provides a convenient way to calculate your BMI based on your weight and height. By following the installation and usage instructions in this user manual, you can easily use the application to track your BMI and monitor your health.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Task:
Build a BMI calculator application that will take necessary inputs and then will out the BMI

Config:
ChatEnvConfig.clear_structure: True
ChatEnvConfig.brainstorming: False


Roster:
Chief Executive Officer, Counselor, Chief Human Resource Officer, Chief Product Officer, Chief Technology Officer, Programmer, Code Reviewer, Software Test Engineer, Chief Creative Officer

Modality:
application

Ideas:


Language:
Python

Code_Version:
5.0

Proposed_images:
0

Incorporated_images:
0

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from tkinter import filedialog
def save_file(self):
file_path = filedialog.asksaveasfilename(defaultextension=".txt", filetypes=[("Text Files", "*.txt")])
if file_path:
with open(file_path, 'w') as file:
file.write(self.text_area.get('1.0', 'end-1c'))
Loading

0 comments on commit fab6a35

Please sign in to comment.