SlideShare a Scribd company logo
1 of 10
Literary Genre Matrix
Part 1: Matrix
Fiction
Non-fiction
Definition:
1.
2.
1.
2.
Examples:
K-2
1.
2.
3-5
1.
2.
6-8
1.
2.
K-2
1.
2.
3-5
1.
2.
6-8
1.
2.
Text Integration Strategies:
1.
2.
1.
2.
Technology Application Strategies:
1.
2.
1.
2.
Technology Tools:
Part 2: Reflection
© 2018. Grand Canyon University. All Rights Reserved.
Mylib.py
#class for doing simple arithmetic,
#and calculating expressions.
class Calculator():
#constructor
#input are the numbers to be operated on
def __init__(self, n1, n2):
self.n1 = n1
self.n2 = n2
#return a dictionary of all arithmetic operations
def allInOne(self):
return {"add":self.plus(),
"sub":self.subtract(),
"mult":self.multiply(),
"div": self.divide()}
#check a value is within the given range lr..hr
#helper procedure
@staticmethod
def IsInRange(lr, hr, n):
return lr < n and n < hr
#add 2 numbers
def plus(self):
add = self.n1 + self.n2
return add
#subtract 2 numbers
def subtract(self):
sub = self.n1 - self.n2
return sub
#multiply 2 numbers
def multiply(self):
mult = self.n1 * self.n2
return mult
#division, n2 should not be zero
def divide(self):
try:
div = self.n1/(self.n2 + 0.0)
return div
except ZeroDivisionError as e:
print("The result of %s/%s = %s" % 
(self.n1, self.n2,"You cannot divide by Zero"))
except Exception :
print("Invalid input" , self.n1, self.n2)
#expression calculator
#will create the calculator object
@staticmethod
def scalc(val):
try:
#the epression is assumed to be comma separated
ns = val.split(",")
#split it into 3 parts
#remove whitespaces in the components
n1 = int(ns[0].strip())
n2 = int(ns[1].strip())
op = ns[2].strip()
calc = Calculator(n1, n2)
#create a calculator for doing arithmetic
#better option than mutating self.
#check if operator is one of the supported
if op == "*":
return calc.multiply()
elif op == "/":
return calc.divide()
elif op == "+":
return calc.plus()
elif op == "-":
return calc.subtract()
else:
print("Unknown operator", op)
#in case of invalid input catch the error
except Exception :
print("Invalid input:" , val)
W7_first_last.py
# Program name :
# Student Name :
# Course : ENTD220
# Instructor :
# Date : 02/20/2020
# Description : Expression & Arithmetic Calculator using
classes
# Copy Wrong : This is my work
from Mylib import Calculator
def doScalc():
print("---------Expression calculator------------------")
print("Enter the expression with format N1,N2,operator:")
print("Supported operator * , /, -, +")
print("E.g 5, 4, *)")
val = input()
res = Calculator.scalc(val)
print('The result of "' + val + '" is', res)
def showList():
print("1) Add two numbers")
print("2) Multiply two numbers")
print("3) Subtract two numbers")
print("4) Divide two numbers")
print("5) Scalc")
print("6) All in one")
print("7) Exit")
def getUserInput():
low = int(input("Enter Lower range:"))
high = int(input("Enter Higher range:"))
n1 = int(input("Enter first number:"))
n2 = int(input("Enter second number:"))
return [low, high, n1 , n2]
def doCalculation(op):
user = getUserInput()
low = user[0]
high = user[1]
n1 = user[2]
n2 = user[3]
if Calculator.IsInRange(low , high, n1) and 
Calculator.IsInRange(low , high, n2):
calc = Calculator(n1, n2)
if op == "+":
res = calc.plus()
elif op == "*":
res = calc.multiply()
elif op == "-":
res = calc.subtract()
elif op == "/":
res = calc.divide()
print("%d %s %d = %d" % (n1, op, n2, res))
else:
print("Error: input out of range")
def doAllInOne():
user = getUserInput()
low = user[0]
high = user[1]
n1 = user[2]
n2 = user[3]
if Calculator.IsInRange(low , high, n1) and 
Calculator.IsInRange(low , high, n2):
calc = Calculator(n1, n2)
mydict = calc.allInOne()
print("%d + %d = %d" % (n1, n2, mydict["add"]))
print("%d - %d = %d" % (n1, n2, mydict["sub"]))
print("%d * %d = %d" % (n1, n2, mydict["mult"]))
print("%d / %d = %d" % (n1, n2, mydict["div"]))
def main():
while True:
showList()
action = int(input("What do you want to do?"))
if action == 7:
break;
if action == 1:
user = getUserInput
doCalculation("+")
elif action == 2:
doCalculation("*")
elif action == 3:
doCalculation("-")
elif action == 4:
doCalculation("/")
elif action == 5:
doScalc()
elif action == 6:
doAllInOne()
print()
main()
print("Thanks for using our calculator!")
Literary Genre MatrixPart 1 Matrix FictionNon-fiction.docx

More Related Content

Similar to Literary Genre MatrixPart 1 Matrix FictionNon-fiction.docx

PYTHON_PROGRAM(1-34).pdf
PYTHON_PROGRAM(1-34).pdfPYTHON_PROGRAM(1-34).pdf
PYTHON_PROGRAM(1-34).pdfNeeraj381934
 
sonam Kumari python.ppt
sonam Kumari python.pptsonam Kumari python.ppt
sonam Kumari python.pptssuserd64918
 
Idea for ineractive programming language
Idea for ineractive programming languageIdea for ineractive programming language
Idea for ineractive programming languageLincoln Hannah
 
Digital signal Processing all matlab code with Lab report
Digital signal Processing all matlab code with Lab report Digital signal Processing all matlab code with Lab report
Digital signal Processing all matlab code with Lab report Alamgir Hossain
 
halstead software science measures
halstead software science measureshalstead software science measures
halstead software science measuresDeepti Pillai
 
Chapter 7 functions (c)
Chapter 7 functions (c)Chapter 7 functions (c)
Chapter 7 functions (c)hhliu
 
Bti1022 lab sheet 9 10
Bti1022 lab sheet 9 10Bti1022 lab sheet 9 10
Bti1022 lab sheet 9 10alish sha
 
Introduction to Data Science With R Lab Record
Introduction to Data Science With R Lab RecordIntroduction to Data Science With R Lab Record
Introduction to Data Science With R Lab RecordLakshmi Sarvani Videla
 
Lecture 5: Functional Programming
Lecture 5: Functional ProgrammingLecture 5: Functional Programming
Lecture 5: Functional ProgrammingEelco Visser
 
Raspberry Pi - Lecture 5 Python for Raspberry Pi
Raspberry Pi - Lecture 5 Python for Raspberry PiRaspberry Pi - Lecture 5 Python for Raspberry Pi
Raspberry Pi - Lecture 5 Python for Raspberry PiMohamed Abdallah
 
Lec04-CS110 Computational Engineering
Lec04-CS110 Computational EngineeringLec04-CS110 Computational Engineering
Lec04-CS110 Computational EngineeringSri Harsha Pamu
 
Python program For O level Practical
Python program For O level Practical Python program For O level Practical
Python program For O level Practical pavitrakumar18
 
Arrays and function basic c programming notes
Arrays and function basic c programming notesArrays and function basic c programming notes
Arrays and function basic c programming notesGOKULKANNANMMECLECTC
 
Programming Fundamentals Functions in C and types
Programming Fundamentals  Functions in C  and typesProgramming Fundamentals  Functions in C  and types
Programming Fundamentals Functions in C and typesimtiazalijoono
 
Introducción a Elixir
Introducción a ElixirIntroducción a Elixir
Introducción a ElixirSvet Ivantchev
 
please sir i want to comments of every code what i do in eachline . in this w...
please sir i want to comments of every code what i do in eachline . in this w...please sir i want to comments of every code what i do in eachline . in this w...
please sir i want to comments of every code what i do in eachline . in this w...hwbloom27
 

Similar to Literary Genre MatrixPart 1 Matrix FictionNon-fiction.docx (20)

PYTHON_PROGRAM(1-34).pdf
PYTHON_PROGRAM(1-34).pdfPYTHON_PROGRAM(1-34).pdf
PYTHON_PROGRAM(1-34).pdf
 
sonam Kumari python.ppt
sonam Kumari python.pptsonam Kumari python.ppt
sonam Kumari python.ppt
 
Idea for ineractive programming language
Idea for ineractive programming languageIdea for ineractive programming language
Idea for ineractive programming language
 
Digital signal Processing all matlab code with Lab report
Digital signal Processing all matlab code with Lab report Digital signal Processing all matlab code with Lab report
Digital signal Processing all matlab code with Lab report
 
halstead software science measures
halstead software science measureshalstead software science measures
halstead software science measures
 
Chapter 7 functions (c)
Chapter 7 functions (c)Chapter 7 functions (c)
Chapter 7 functions (c)
 
TeraSort
TeraSortTeraSort
TeraSort
 
Bti1022 lab sheet 9 10
Bti1022 lab sheet 9 10Bti1022 lab sheet 9 10
Bti1022 lab sheet 9 10
 
Functions
FunctionsFunctions
Functions
 
Introduction to Data Science With R Lab Record
Introduction to Data Science With R Lab RecordIntroduction to Data Science With R Lab Record
Introduction to Data Science With R Lab Record
 
Lecture 5: Functional Programming
Lecture 5: Functional ProgrammingLecture 5: Functional Programming
Lecture 5: Functional Programming
 
ECE-PYTHON.docx
ECE-PYTHON.docxECE-PYTHON.docx
ECE-PYTHON.docx
 
Raspberry Pi - Lecture 5 Python for Raspberry Pi
Raspberry Pi - Lecture 5 Python for Raspberry PiRaspberry Pi - Lecture 5 Python for Raspberry Pi
Raspberry Pi - Lecture 5 Python for Raspberry Pi
 
Lec04-CS110 Computational Engineering
Lec04-CS110 Computational EngineeringLec04-CS110 Computational Engineering
Lec04-CS110 Computational Engineering
 
Python program For O level Practical
Python program For O level Practical Python program For O level Practical
Python program For O level Practical
 
Arrays and function basic c programming notes
Arrays and function basic c programming notesArrays and function basic c programming notes
Arrays and function basic c programming notes
 
python.ppt
python.pptpython.ppt
python.ppt
 
Programming Fundamentals Functions in C and types
Programming Fundamentals  Functions in C  and typesProgramming Fundamentals  Functions in C  and types
Programming Fundamentals Functions in C and types
 
Introducción a Elixir
Introducción a ElixirIntroducción a Elixir
Introducción a Elixir
 
please sir i want to comments of every code what i do in eachline . in this w...
please sir i want to comments of every code what i do in eachline . in this w...please sir i want to comments of every code what i do in eachline . in this w...
please sir i want to comments of every code what i do in eachline . in this w...
 

More from jeremylockett77

M3 ch12 discussionConnecting Eligible Immigrant Families to Heal.docx
M3 ch12 discussionConnecting Eligible Immigrant Families to Heal.docxM3 ch12 discussionConnecting Eligible Immigrant Families to Heal.docx
M3 ch12 discussionConnecting Eligible Immigrant Families to Heal.docxjeremylockett77
 
Loudres eats powdered doughnuts for breakfast  and chocolate that sh.docx
Loudres eats powdered doughnuts for breakfast  and chocolate that sh.docxLoudres eats powdered doughnuts for breakfast  and chocolate that sh.docx
Loudres eats powdered doughnuts for breakfast  and chocolate that sh.docxjeremylockett77
 
Lostinnocenceyoucouldexploreachildsoldierwhohasbeen.docx
Lostinnocenceyoucouldexploreachildsoldierwhohasbeen.docxLostinnocenceyoucouldexploreachildsoldierwhohasbeen.docx
Lostinnocenceyoucouldexploreachildsoldierwhohasbeen.docxjeremylockett77
 
Lori Goler is the head of People at Facebook. Janelle Gal.docx
Lori Goler is the head  of People at Facebook. Janelle Gal.docxLori Goler is the head  of People at Facebook. Janelle Gal.docx
Lori Goler is the head of People at Facebook. Janelle Gal.docxjeremylockett77
 
Looking for someone to take these two documents- annotated bibliogra.docx
Looking for someone to take these two documents- annotated bibliogra.docxLooking for someone to take these two documents- annotated bibliogra.docx
Looking for someone to take these two documents- annotated bibliogra.docxjeremylockett77
 
Lorryn Tardy – critique to my persuasive essayFor this assignm.docx
Lorryn Tardy – critique to my persuasive essayFor this assignm.docxLorryn Tardy – critique to my persuasive essayFor this assignm.docx
Lorryn Tardy – critique to my persuasive essayFor this assignm.docxjeremylockett77
 
M450 Mission Command SystemGeneral forum instructions Answ.docx
M450 Mission Command SystemGeneral forum instructions Answ.docxM450 Mission Command SystemGeneral forum instructions Answ.docx
M450 Mission Command SystemGeneral forum instructions Answ.docxjeremylockett77
 
Lymphedema following breast cancer The importance of surgic.docx
Lymphedema following breast cancer The importance of surgic.docxLymphedema following breast cancer The importance of surgic.docx
Lymphedema following breast cancer The importance of surgic.docxjeremylockett77
 
Love Beyond Wallshttpswww.lovebeyondwalls.orgProvid.docx
Love Beyond Wallshttpswww.lovebeyondwalls.orgProvid.docxLove Beyond Wallshttpswww.lovebeyondwalls.orgProvid.docx
Love Beyond Wallshttpswww.lovebeyondwalls.orgProvid.docxjeremylockett77
 
Longevity PresentationThe purpose of this assignment is to exami.docx
Longevity PresentationThe purpose of this assignment is to exami.docxLongevity PresentationThe purpose of this assignment is to exami.docx
Longevity PresentationThe purpose of this assignment is to exami.docxjeremylockett77
 
Look again at the CDCs Web page about ADHD.In 150-200 w.docx
Look again at the CDCs Web page about ADHD.In 150-200 w.docxLook again at the CDCs Web page about ADHD.In 150-200 w.docx
Look again at the CDCs Web page about ADHD.In 150-200 w.docxjeremylockett77
 
M8-22 ANALYTICS o TEAMS • ORGANIZATIONS • SKILLS .fÿy.docx
M8-22   ANALYTICS o TEAMS • ORGANIZATIONS • SKILLS        .fÿy.docxM8-22   ANALYTICS o TEAMS • ORGANIZATIONS • SKILLS        .fÿy.docx
M8-22 ANALYTICS o TEAMS • ORGANIZATIONS • SKILLS .fÿy.docxjeremylockett77
 
Lombosoro theory.In week 4, you learned about the importance.docx
Lombosoro theory.In week 4, you learned about the importance.docxLombosoro theory.In week 4, you learned about the importance.docx
Lombosoro theory.In week 4, you learned about the importance.docxjeremylockett77
 
Looking over the initial material on the definitions of philosophy i.docx
Looking over the initial material on the definitions of philosophy i.docxLooking over the initial material on the definitions of philosophy i.docx
Looking over the initial material on the definitions of philosophy i.docxjeremylockett77
 
Lucky Iron FishBy Ashley SnookPro.docx
Lucky Iron FishBy Ashley SnookPro.docxLucky Iron FishBy Ashley SnookPro.docx
Lucky Iron FishBy Ashley SnookPro.docxjeremylockett77
 
Lucky Iron FishBy Ashley SnookMGMT 350Spring 2018ht.docx
Lucky Iron FishBy Ashley SnookMGMT 350Spring 2018ht.docxLucky Iron FishBy Ashley SnookMGMT 350Spring 2018ht.docx
Lucky Iron FishBy Ashley SnookMGMT 350Spring 2018ht.docxjeremylockett77
 
look for a article that talks about some type of police activity a.docx
look for a article that talks about some type of police activity a.docxlook for a article that talks about some type of police activity a.docx
look for a article that talks about some type of police activity a.docxjeremylockett77
 
Look at the Code of Ethics for at least two professional agencies,  .docx
Look at the Code of Ethics for at least two professional agencies,  .docxLook at the Code of Ethics for at least two professional agencies,  .docx
Look at the Code of Ethics for at least two professional agencies,  .docxjeremylockett77
 
Locate an example for 5 of the 12 following types of communica.docx
Locate an example for 5 of the 12 following types of communica.docxLocate an example for 5 of the 12 following types of communica.docx
Locate an example for 5 of the 12 following types of communica.docxjeremylockett77
 
Locate and read the other teams’ group project reports (located .docx
Locate and read the other teams’ group project reports (located .docxLocate and read the other teams’ group project reports (located .docx
Locate and read the other teams’ group project reports (located .docxjeremylockett77
 

More from jeremylockett77 (20)

M3 ch12 discussionConnecting Eligible Immigrant Families to Heal.docx
M3 ch12 discussionConnecting Eligible Immigrant Families to Heal.docxM3 ch12 discussionConnecting Eligible Immigrant Families to Heal.docx
M3 ch12 discussionConnecting Eligible Immigrant Families to Heal.docx
 
Loudres eats powdered doughnuts for breakfast  and chocolate that sh.docx
Loudres eats powdered doughnuts for breakfast  and chocolate that sh.docxLoudres eats powdered doughnuts for breakfast  and chocolate that sh.docx
Loudres eats powdered doughnuts for breakfast  and chocolate that sh.docx
 
Lostinnocenceyoucouldexploreachildsoldierwhohasbeen.docx
Lostinnocenceyoucouldexploreachildsoldierwhohasbeen.docxLostinnocenceyoucouldexploreachildsoldierwhohasbeen.docx
Lostinnocenceyoucouldexploreachildsoldierwhohasbeen.docx
 
Lori Goler is the head of People at Facebook. Janelle Gal.docx
Lori Goler is the head  of People at Facebook. Janelle Gal.docxLori Goler is the head  of People at Facebook. Janelle Gal.docx
Lori Goler is the head of People at Facebook. Janelle Gal.docx
 
Looking for someone to take these two documents- annotated bibliogra.docx
Looking for someone to take these two documents- annotated bibliogra.docxLooking for someone to take these two documents- annotated bibliogra.docx
Looking for someone to take these two documents- annotated bibliogra.docx
 
Lorryn Tardy – critique to my persuasive essayFor this assignm.docx
Lorryn Tardy – critique to my persuasive essayFor this assignm.docxLorryn Tardy – critique to my persuasive essayFor this assignm.docx
Lorryn Tardy – critique to my persuasive essayFor this assignm.docx
 
M450 Mission Command SystemGeneral forum instructions Answ.docx
M450 Mission Command SystemGeneral forum instructions Answ.docxM450 Mission Command SystemGeneral forum instructions Answ.docx
M450 Mission Command SystemGeneral forum instructions Answ.docx
 
Lymphedema following breast cancer The importance of surgic.docx
Lymphedema following breast cancer The importance of surgic.docxLymphedema following breast cancer The importance of surgic.docx
Lymphedema following breast cancer The importance of surgic.docx
 
Love Beyond Wallshttpswww.lovebeyondwalls.orgProvid.docx
Love Beyond Wallshttpswww.lovebeyondwalls.orgProvid.docxLove Beyond Wallshttpswww.lovebeyondwalls.orgProvid.docx
Love Beyond Wallshttpswww.lovebeyondwalls.orgProvid.docx
 
Longevity PresentationThe purpose of this assignment is to exami.docx
Longevity PresentationThe purpose of this assignment is to exami.docxLongevity PresentationThe purpose of this assignment is to exami.docx
Longevity PresentationThe purpose of this assignment is to exami.docx
 
Look again at the CDCs Web page about ADHD.In 150-200 w.docx
Look again at the CDCs Web page about ADHD.In 150-200 w.docxLook again at the CDCs Web page about ADHD.In 150-200 w.docx
Look again at the CDCs Web page about ADHD.In 150-200 w.docx
 
M8-22 ANALYTICS o TEAMS • ORGANIZATIONS • SKILLS .fÿy.docx
M8-22   ANALYTICS o TEAMS • ORGANIZATIONS • SKILLS        .fÿy.docxM8-22   ANALYTICS o TEAMS • ORGANIZATIONS • SKILLS        .fÿy.docx
M8-22 ANALYTICS o TEAMS • ORGANIZATIONS • SKILLS .fÿy.docx
 
Lombosoro theory.In week 4, you learned about the importance.docx
Lombosoro theory.In week 4, you learned about the importance.docxLombosoro theory.In week 4, you learned about the importance.docx
Lombosoro theory.In week 4, you learned about the importance.docx
 
Looking over the initial material on the definitions of philosophy i.docx
Looking over the initial material on the definitions of philosophy i.docxLooking over the initial material on the definitions of philosophy i.docx
Looking over the initial material on the definitions of philosophy i.docx
 
Lucky Iron FishBy Ashley SnookPro.docx
Lucky Iron FishBy Ashley SnookPro.docxLucky Iron FishBy Ashley SnookPro.docx
Lucky Iron FishBy Ashley SnookPro.docx
 
Lucky Iron FishBy Ashley SnookMGMT 350Spring 2018ht.docx
Lucky Iron FishBy Ashley SnookMGMT 350Spring 2018ht.docxLucky Iron FishBy Ashley SnookMGMT 350Spring 2018ht.docx
Lucky Iron FishBy Ashley SnookMGMT 350Spring 2018ht.docx
 
look for a article that talks about some type of police activity a.docx
look for a article that talks about some type of police activity a.docxlook for a article that talks about some type of police activity a.docx
look for a article that talks about some type of police activity a.docx
 
Look at the Code of Ethics for at least two professional agencies,  .docx
Look at the Code of Ethics for at least two professional agencies,  .docxLook at the Code of Ethics for at least two professional agencies,  .docx
Look at the Code of Ethics for at least two professional agencies,  .docx
 
Locate an example for 5 of the 12 following types of communica.docx
Locate an example for 5 of the 12 following types of communica.docxLocate an example for 5 of the 12 following types of communica.docx
Locate an example for 5 of the 12 following types of communica.docx
 
Locate and read the other teams’ group project reports (located .docx
Locate and read the other teams’ group project reports (located .docxLocate and read the other teams’ group project reports (located .docx
Locate and read the other teams’ group project reports (located .docx
 

Recently uploaded

भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 

Recently uploaded (20)

भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 

Literary Genre MatrixPart 1 Matrix FictionNon-fiction.docx

  • 1. Literary Genre Matrix Part 1: Matrix Fiction Non-fiction Definition: 1. 2. 1. 2. Examples: K-2 1. 2. 3-5 1. 2. 6-8 1. 2. K-2 1. 2. 3-5 1. 2. 6-8 1. 2.
  • 2. Text Integration Strategies: 1. 2. 1. 2. Technology Application Strategies: 1. 2. 1. 2. Technology Tools: Part 2: Reflection © 2018. Grand Canyon University. All Rights Reserved. Mylib.py #class for doing simple arithmetic, #and calculating expressions. class Calculator(): #constructor #input are the numbers to be operated on
  • 3. def __init__(self, n1, n2): self.n1 = n1 self.n2 = n2 #return a dictionary of all arithmetic operations def allInOne(self): return {"add":self.plus(), "sub":self.subtract(), "mult":self.multiply(), "div": self.divide()} #check a value is within the given range lr..hr #helper procedure @staticmethod def IsInRange(lr, hr, n): return lr < n and n < hr #add 2 numbers
  • 4. def plus(self): add = self.n1 + self.n2 return add #subtract 2 numbers def subtract(self): sub = self.n1 - self.n2 return sub #multiply 2 numbers def multiply(self): mult = self.n1 * self.n2 return mult #division, n2 should not be zero def divide(self): try: div = self.n1/(self.n2 + 0.0)
  • 5. return div except ZeroDivisionError as e: print("The result of %s/%s = %s" % (self.n1, self.n2,"You cannot divide by Zero")) except Exception : print("Invalid input" , self.n1, self.n2) #expression calculator #will create the calculator object @staticmethod def scalc(val): try: #the epression is assumed to be comma separated ns = val.split(",") #split it into 3 parts #remove whitespaces in the components n1 = int(ns[0].strip()) n2 = int(ns[1].strip())
  • 6. op = ns[2].strip() calc = Calculator(n1, n2) #create a calculator for doing arithmetic #better option than mutating self. #check if operator is one of the supported if op == "*": return calc.multiply() elif op == "/": return calc.divide() elif op == "+": return calc.plus() elif op == "-": return calc.subtract() else: print("Unknown operator", op) #in case of invalid input catch the error
  • 7. except Exception : print("Invalid input:" , val) W7_first_last.py # Program name : # Student Name : # Course : ENTD220 # Instructor : # Date : 02/20/2020 # Description : Expression & Arithmetic Calculator using classes # Copy Wrong : This is my work from Mylib import Calculator def doScalc(): print("---------Expression calculator------------------") print("Enter the expression with format N1,N2,operator:") print("Supported operator * , /, -, +") print("E.g 5, 4, *)") val = input() res = Calculator.scalc(val) print('The result of "' + val + '" is', res) def showList(): print("1) Add two numbers") print("2) Multiply two numbers") print("3) Subtract two numbers") print("4) Divide two numbers") print("5) Scalc") print("6) All in one")
  • 8. print("7) Exit") def getUserInput(): low = int(input("Enter Lower range:")) high = int(input("Enter Higher range:")) n1 = int(input("Enter first number:")) n2 = int(input("Enter second number:")) return [low, high, n1 , n2] def doCalculation(op): user = getUserInput() low = user[0] high = user[1] n1 = user[2] n2 = user[3] if Calculator.IsInRange(low , high, n1) and Calculator.IsInRange(low , high, n2): calc = Calculator(n1, n2) if op == "+": res = calc.plus() elif op == "*": res = calc.multiply() elif op == "-": res = calc.subtract() elif op == "/": res = calc.divide() print("%d %s %d = %d" % (n1, op, n2, res)) else: print("Error: input out of range") def doAllInOne(): user = getUserInput() low = user[0] high = user[1] n1 = user[2]
  • 9. n2 = user[3] if Calculator.IsInRange(low , high, n1) and Calculator.IsInRange(low , high, n2): calc = Calculator(n1, n2) mydict = calc.allInOne() print("%d + %d = %d" % (n1, n2, mydict["add"])) print("%d - %d = %d" % (n1, n2, mydict["sub"])) print("%d * %d = %d" % (n1, n2, mydict["mult"])) print("%d / %d = %d" % (n1, n2, mydict["div"])) def main(): while True: showList() action = int(input("What do you want to do?")) if action == 7: break; if action == 1: user = getUserInput doCalculation("+") elif action == 2: doCalculation("*") elif action == 3: doCalculation("-") elif action == 4: doCalculation("/") elif action == 5: doScalc() elif action == 6: doAllInOne() print() main() print("Thanks for using our calculator!")