Final - HW1
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
# File: hw1a.py
|
||||
# Author: PEASE, NICHOLAS
|
||||
# Date: 12 SEP 2022
|
||||
# Section: 1002-LAB
|
||||
# E-mail: nicholas.pease@maine.edu
|
||||
# Description:
|
||||
# Getting to know someone in my major programatically
|
||||
# Collaboration:
|
||||
# N/A
|
||||
|
||||
name = input("Hi friend, What's your name? ")
|
||||
print("Hi, " + name + " I'm happy to meet you\nLet's go get ice cream")
|
||||
@@ -0,0 +1,18 @@
|
||||
# File: hw1b.py
|
||||
# Author: PEASE, NICHOLAS
|
||||
# Date: 12 SEP 2022
|
||||
# Section: 1002-LAB
|
||||
# E-mail: nicholas.pease@maine.edu
|
||||
# Description:
|
||||
# Code for purchasing ice cream for myself and two friends.
|
||||
# Collaboration:
|
||||
# N/A
|
||||
|
||||
price = float(input("How much is this ice cream bar? "))
|
||||
total_cost = 3*price*1.055
|
||||
print("I would like three bars. Here is $"+str(total_cost)+".\nThank you.")
|
||||
|
||||
|
||||
# I tried golfing it but realized it would not match the required variable parameters
|
||||
#
|
||||
#print("I would like three bars. Here is $"+str((3*float(input("How much is this ice cream bar?")))*1.055)+".\nThank You.")
|
||||
@@ -0,0 +1,11 @@
|
||||
# File: hw1c.py
|
||||
# Author: PEASE, NICHOLAS
|
||||
# Date: 12 SEP 2022
|
||||
# Section: 1002-LAB
|
||||
# E-mail: nicholas.pease@maine.edu
|
||||
# Description:
|
||||
# Program to ask user for number and give square and cube
|
||||
# Collaboration:
|
||||
# N/A
|
||||
|
||||
a = float(input("Enter a value:"));print("The square is:",a**2,"\nThe cube is:", a**3)
|
||||
@@ -0,0 +1,11 @@
|
||||
# File: hw1d.py
|
||||
# Author: PEASE, NICHOLAS
|
||||
# Date: 12 SEP 2022
|
||||
# Section: 1002-LAB
|
||||
# E-mail: nicholas.pease@maine.edu
|
||||
# Description:
|
||||
# Prompt user for number 7 times
|
||||
# Collaboration:
|
||||
# N/A
|
||||
|
||||
a=input("Enter a value:");b=input("Enter a value:");c=input("Enter a value:");d=input("Enter a value:");e=input("Enter a value:");f=input("Enter a value:");g=input("Enter a value:");print("The last number was:", g)
|
||||
+36
-11
@@ -2,36 +2,61 @@
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 11,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# File: FILENAME.py \n",
|
||||
"# Author: YOUR NAME \n",
|
||||
"# Date: THE DATE \n",
|
||||
"# Section: YOUR LAB SECTION NUMBER \n",
|
||||
"# E-mail: YOUR_EMAIL@maine.edu \n",
|
||||
"# File: hw1d.py \n",
|
||||
"# Author: PEASE, NICHOLAS \n",
|
||||
"# Date: 12 SEP 2022\n",
|
||||
"# Section: 1002-LAB\n",
|
||||
"# E-mail: nicholas.pease@maine.edu \n",
|
||||
"# Description: \n",
|
||||
"# DESCRIPTION OF WHAT THE PROGRAM DOES \n",
|
||||
"# Prompt user for number 7 times\n",
|
||||
"# Collaboration: \n",
|
||||
"# COLLABORATION STATEMENT GOES HERE"
|
||||
"# N/A"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 47,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"The last number was: 7\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"a=input(\"Enter a value:\");b=input(\"Enter a value:\");c=input(\"Enter a value:\");d=input(\"Enter a value:\");e=input(\"Enter a value:\");f=input(\"Enter a value:\");g=input(\"Enter a value:\");print(\"The last number was:\", g)"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3.10.7 64-bit (microsoft store)",
|
||||
"display_name": "Python 3.10.5 64-bit",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"version": "3.10.7"
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.10.5"
|
||||
},
|
||||
"orig_nbformat": 4,
|
||||
"vscode": {
|
||||
"interpreter": {
|
||||
"hash": "eeaf7f71cfb1164fc8e69b726debd88f20a81f20293568f08578705547e29b5e"
|
||||
"hash": "369f2c481f4da34e4445cda3fffd2e751bd1c4d706f27375911949ba6bb62e1c"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Your grade is:3250.0\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"asstWeight = examWeight = 0.45\n",
|
||||
"labWeight = 0.1\n",
|
||||
"\n",
|
||||
"print(\"Your grade is: \" + str((int(input(\"Assignment Grade: \"))*asstWeight+int(input(\"Exam Grade: \"))*examWeight+int(input(\"Lab Grade: \"))*labWeight)*100))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3.10.5 64-bit",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.10.5"
|
||||
},
|
||||
"orig_nbformat": 4,
|
||||
"vscode": {
|
||||
"interpreter": {
|
||||
"hash": "369f2c481f4da34e4445cda3fffd2e751bd1c4d706f27375911949ba6bb62e1c"
|
||||
}
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 2
|
||||
}
|
||||
Reference in New Issue
Block a user