Programming Logic Portfolio
Programming Logic Portfolio
Week: 10
Student name:
Carlos Rivera
Programmation logic
Study location:
UNITEC, Tegucigalpa
Teacher:
Arleth Moncada
Section:
284
Date of delivery:
March 27, 2022
Index
Task 2 Truth Tables
Task 3 Methods
Task 4 Assignments
Task 1 Propositions
Task 5 Conditions
Conversions Presentation
Conversions Exercises
Task 1 Python
python 4
Python 5
Task 1 Python
Python 6
python 7
Python 8
Python 9
Python 10
Python 11
Python 12
Python 13
Final Project Statement
Preview 1
Final project
Task 1 Propositions
Task 2 Truth Tables
Task 3 Methods
Task 4 Assignments
Task 5 Conditions
Conversion Presentation
cblackboard
QUALIFY
INTENT
2.00
MEMBERS
Bin tatao with the aMgnación
-• Introduction
G0e•d• v272022 e
Conversions Exercises
Task1 Python
# -*- coding: utf-8 -*-"""Created on Mon Feb 21 22:36:07 2022@author: Carlos Andres
Riveraccount: 11941225"""UCost= float(input("Unit Cost of a product: ") )Units=
float(input("Number of Units of a product: "))PriceV=
CostU+CostU*0.40TotalP= PriceV*Unitsprint("Sales Price of the product is: ",
round(PriceV,2))print("Total to pay for the requested units is: ", round(TotalP,2)
Task4 Python
# -*- coding: utf-8 -*-"""Created on Wed Feb 23 09:39:28 2022The name and 5 grades of a
student are given as data, the name, average and the word “PASS” must be printed if the
student has an average greater than or equal to 60 and the expression “NOT APPROVED”
otherwise.@author: Carlos Rivera account: 11941225"""name = input("student name: ")c1
= float(input("first student's grade: "))c2 = float(input("student's second grade: "))c3 =
float(input("student's third grade: "))c4 = float(input("student's fourth grade: ")) ))c5 =
float(input("student's fifth grade: "))average = (c1+c2+c3+c4+c5)/5if average>=60:
expression = "passed"else: expression = "not approved"
print("###########")print("student name: ", name)print("student's average is:
",round(average,2))print(expression)print( "###########
Task5 Python
# -*- coding: utf-8 -*-"""Created on Thu Feb 24 09:08:18 2022determine and print if a
number is positive, negative or zero@author: Carlos Andres Riveraccount:
11941225"""number = int (input("enter an integer: "))if number < 0: message = "is
negative"elif number == 0: message = "is zero"else: message = "is positive"print("the
number", message)
Task 1 - Python
# -*- coding: utf-8 -*-"""Created on Sun Feb 27 21:37:15 2022@author: Carlos Andres
Riveraaccount: 11941225An accountant needs a program to calculate the annual
depreciation expense of certain equipment according to the following depreciation
tableTYPE OF EQUIPMENT DEPRECIATION1 4 Years2 5 Years3 7 Years4 10 YearsThe
annual depreciation would be calculated by dividing the value of the equipment by the
years in which it depreciates according to the previous table. The computer will be
provided with the value of the equipment, calculate the annual depreciation."""Value=
float(input("Enter the value of the equipment: "))Type= int(input("Enter the type of
equipment: "))if Type == 1: DepA=Value/4elif Type==2: DepA=Value/5elif Type==3:
DepA=Value/7else: DepA=Value/10print()print("The annual depreciation is:
",round( DepA,2)
Python 6
# -*- coding: utf-8 -*-"""Created on Mon Feb 28 09:11:27 2022@author: Carlos Andres
Riveraaccount: 11941225A group of people dedicated to the car washing business needs
a program to determine How much does each client have to pay according to the following
table of services: TYPE OF SERVICE PRICE 1. – EXTERIOR WASHING Lps. 225.00 2. -
INTERIOR WASH Lps. 130.00 3. - EXTERIOR AND INTERIOR WASHING Lps. 335.00 4.
- ENGINE WASH Lps. 240.00 In addition to services, a 7% discount is offered if you bring
two or more cars. The Type of service and No. will be provided to the computer. of
automobiles, calculate the total to be paid by the customer."""print("############")print("
TYPE OF SERVICE PRICE")print(" 1. EXTERIOR WASHING Lps. 225.00")print(" 2.
INTERIOR WASHING Lps. 130.00")print(" 3. EXTERIOR AND INTERIOR WASHING Lps.
335.00")print(" 4. ENGINE WASH Lps. 240.00")print("############")type=
int(input("Enter service type(1,2,3,4):"))qty= int(input ("Enter the number of cars: "))if type
== 1: description = "Exterior Wash" subtotal = 225 * cantelif type == 2: description =
"Interior Wash" subtotal = 130 * cantelif type == 3: description = "Exterior and Interior
Washing" subtotal = 335 * cantelif type == 4: description = "Motorcycle Wash" subtotal =
240 * cantelse: description = "Incorrect Type does not exist!!" subtotal = 0if qty >= 2:
discount = subtotal * 0.07else: discount = 0 total = subtotal -
discountprint("##############")print(" type of service requested:", description)print("
Subtotal per service: ",round(subtotal,2))print(" discount for services:",(discount,2))print("
total to pay: ",(total,2))print("######## ######")
Python 7
# -*- coding: utf-8 -*-"""Created on Mon Feb 28 22:38:15 2022@author: Carlos Andres
Rivera account:11941225In a cafeteria, basically three types of food are sold: 1 -
breakfast, 2 - lunch , 3 - dinner with prices of L. 220.00, L 300.00 and L. 200.00 per person
respectively. In addition, a free jug of soft drink is offered if the group is more than three
people. If the meal code (1, 2 or 3) and the number of people in the group are provided,
determine the total to be paid by the group, and print the message "Free Pitcher" when
necessary."""code= int(input("Enter the food code: "))people=int(input("Enter the number of
people in the group: "))if code==1: price=220elif code==2: price= 300elif code==3:
price=200else: message="Error! combo not available" price=0totalp=people*priceif
people>3: jugs="Free Jugs"else: jugs="Does not apply to
combo"print("#########")print("Total a pay is: ",round(totalp,2))print("Promotion!:
",jars)print("#########"
The discount can be granted to all customers and the subtotal will be subtracted.
The customer's name, product code and the quantity of the product they are
carrying are read. The name, product description, subtotal, discount and the total to
be paid must be printed. The owner of the cafeteria wants the following data: Total
number of customers who were served. Total number of customers with 500
products or more. Total number of customers who purchased 600mlQuantity of
600ml soldQuantity of 400ml sold
Preview
1
# -*- coding: utf-8 -*-"""Created on Tue Mar 15 09:06:46 2022@author: Carlos Andres
Riveraccount: 11941225In a recognizable cafeteria they have the following products
available:Code Description Price1 Cappuccino 400ml 702 Cappuccino 600ml 903
Cappuccino 1L 110In order to motivate customers in a healthy way, the owner of the
cafeteria decided to give a discount depending on the amount of products they
consume.Code Description Discount1 If they carry between 500-1500 4%2 If they carry
more than 1500 7 %3 Less than 500 0%'The discount may be granted to all customers and
the subtotal will be subtracted. The customer's name, product code and the quantity of the
product they are carrying are read. The name, product description, subtotal, discount and
the total to be paid must be printed. The owner of the cafeteria wants the following data:
Total number of customers who were served. Total number of customers with 500 products
or more. Total number of customers who purchased 600mlQuantity of 600ml soldQuantity
of 400ml soldTotal income"""response = int(input("you want to enter the program: 1. Yes 2.
no: "))while response == 1: ## program inputs name = input(" enter customer name: ") code
= int(input(" enter product code: ")) quantity = int(input ("enter product quantity:"))
Final project