Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Assessment Type Assessment Number Assessment Weighting Alignment with Unit and Course Due Date/Time Assessment Description ISY1003 Foundations of Programming Practical 2 Programming Assessment 30%...

1 answer below »

Assessment Type Assessment Number Assessment Weighting

Alignment with Unit and Course

Due Date/Time

Assessment Description

ISY1003 Foundations of Programming

Practical 2

Programming Assessment 30%

Unit Learning Outcome

ULO 3: Describe and discuss the elements of effective programming style ULO 4: Demonstrate an understanding of the software development life cycle and apply sound programming analysis techniques (design, coding, debugging, testing and documentation) to justify simple programming problems

Graduate Attributes Assessed

GA 1: Communication GA 2: Collaboration GA 4: Critical Thinking

Week 10
4 October2019 via Moodle Turnitin 5:00pm (AEST)

In this project, you will work individually to write programs which demonstrate your understanding of IPO and usage of simple functions in Python programs.

Content and Structure:
You will have to write a modular program to:

1. Perform a series of transactions

2. This will be a project which students will choose and discuss with the lecturer prior to commencing.

3. Examples could be a scientific calculator, expense management system, online shopping system, banking system etc

Program expectation:

  • ï‚· The student must be able to explain the working of the program and its logic.

  • ï‚· Program should be indented, proper comments should be given, modification

    history should be present, variable names and data types should be chosen

    appropriately.

  • ï‚· The program should compile and execute to display the result.

  • ï‚· The student must use programming constructs available in Python and follow

    coding standards.

Detailed Submission Requirements

Misconduct

  • ï‚· Multiple program files may be uploaded.

  • ï‚· Student will also need to demonstrate the working of the program along with a full

    explanation of the underlying code.

  • ï‚· Follow coding standards, naming conventions for variables and functions.

  • ï‚· Students will be asked to explain the working of their program and the logic they’ve

    used.

  • ï‚· Coding should be modular and program should use all the programming constructs

    learnt in the course.

Answered Same Day Sep 20, 2021

Solution

Neha answered on Oct 01 2021
156 Votes
44821/cacl.py
from tkinter import *
import math
#calculator class
class Calc():
def __init__(self):
self.total = 0
self.cu
ent = ""
self.new_num = True
self.op_pending = False
self.op = ""
self.eq = False
# this method will allow the user to enter the number by pressing it
def num_press(self, num):
self.eq = False
temp = text_box.get()
temp2 = str(num)
if self.new_num:
self.cu
ent = temp2
self.new_num = False
else:
if temp2 == '.':
if temp2 in temp:
return
self.cu
ent = temp + temp2
self.display(self.cu
ent)
#to calculate the total
def calc_total(self):
self.eq = True
self.cu
ent = float(self.cu
ent)
if self.op_pending == True:
self.do_sum()
else:
self.total = float(text_box.get())
#display the textboxes
def display(self, value):
text_box.delete(0, END)
text_box.insert(0, value)
#this function will perform the scientific calculations
def do_sum(self):
if self.op == "add":
self.total += self.cu
ent
if self.op == "minus":
self.total -= self.cu
ent
if self.op == "times":
self.total *= self.cu
ent
if self.op == "divide":
self.total /= self.cu
ent
if self.op == "raise":
self.total = self.total ** self.cu
ent
if self.op == "rootof":
self.total = self.total ** (1/self.cu
ent)
if self.op == "fact":
self.total=int(text_box.get())
self.total=math.factorial(self.total)
if self.op == "ln":
self.total = log(self.total)
if self.op == "log":
self.total=log(self.total,10)
if self.op == "sine":
self.total=math.sin(self.total)
if self.op == "cosine":
self.total = math.cos(self.total)
if self.op == "tangent":
self.total = math.tan(self.total)
if self.op == "exp":
self.total = math.exp(self.total)
if self.op == "inv":
self.total = 1/self.total
self.new_num = True
self.op_pending = False
self.display(self.total)
def operation(self, op):
self.cu
ent = float(self.cu
ent)
if self.op_pending:
self.do_sum()
elif not self.eq:
self.total = self.cu
ent
self.new_num = True
self.op_pending = True
self.op = op
self.eq = False
#this fucntion is defined to clear the numbers for selection
def clear(self):
self.eq = False
self.cu
ent = "0"
self.display(0)
self.new_num = True
def all_clear(self):
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here