Homework 1 CS
.pdf
keyboard_arrow_up
School
New York University *
*We aren’t endorsed by this school
Course
1114
Subject
Computer Science
Date
Jan 9, 2024
Type
Pages
3
Uploaded by JudgeElement13069
README.md
9/15/2022
1 / 3
.py
hw1_q1.py hw1_q2.py
"""
Author: [Your name here]
Assignment / Part: HW1 - Q1 (etc.)
Date due: 2022-09-22, 11:59pm
I pledge that I have completed this assignment without
collaborating with anyone else, in conformance with the
NYU School of Engineering Policies and Procedures on
Academic Misconduct.
"""
print()
input()
if elif else
for
while
main()
Please enter your name: Aika
Please enter your age: 29
Aika, 29, is taking CS-UY 1114
README.md
9/15/2022
2 / 3
2022
Please enter a year greater than 2022:
2064
The population in year 2064 will be 414730774
Please enter number of coins:
Number of quarters: 13
Number of dimes: 4
Number of nickels: 11
Number of pennies: 17
The total is 4 dollar(s) and 37 cent(s)
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
Please solve!
arrow_forward
Part 1:
CUSTOMER
CUST_NUM
CUST_LNAME
CUST_FNAME
CUST_BALANCE
1000
Billy
Jean
1050.11
1001
Amanda
John
840.92
INVOICE
INV DATE
23/3/2020
INV_NUM
CUST_NUM
INV_AMOUNT
8000
1000
235.89
8001
1001
23/3/2020
312.82
8002
1002
30/3/2020
528.10
8003
1003
12/4/2020
194.78
8004
1004
23/4/2020
619.44
1. Create both the CUSTOMER and INVOICE tables structure above. Details of both tables are:
a) The customer number should store integer values. The name attributes should support variable
length character data up to 30 characters each. The customer balance should support up to six digits on
the left of the decimal place and two digits to the right of the decimal place.
b) The invoice number should store integer values. The invoice date should store date values. The
invoice amount should support up to 8 digits to the left of the decimal place and two digits to the right
of the decimal place.
2. Write the SQL commands necessary to insert the data into the CUSTOMER table and the INVOICE
table created in…
arrow_forward
quetion 4
arrow_forward
osted.cuny.edu/webapps/assessment/take/launch.jsp?course_assessment_id%3D_1787700_1&course id3_1950256_1&content id%3_55349866 1&step%3Dnull
* Question Completion Status:
Given a truth table below with the first two columns of truth values provided:
b.
f(p,q)
1
2.
F
4
Which of the answers below contains the truth values for the third column when f(p,q) ?
Column 3
truth values:
Column3
truth values:
Column 3
truth values:
Column 3
truth values:
Column 3
truth values:
1 T
1 T
1F
1 T
1 F
None of the other
O 2 E
O2 T
O2 F
2 T
2 T
Oanswers provided is
correct.
3 T
3 T
3 T
3 F
3 T
4 F
4 T
4 F
4 T
4 T
Chck Save and Submit to save and subrmi.Chick SaueAllansuersto save all answers.
Save All Answers
o search
99+
T.
FT
F.
3.
arrow_forward
-center/sel-activity/11589?backpage=main&assignmentId=23921320
SI Scientific...
The Zombie Apocalypse has finally happened!
You have time to grab only five of the following
items to help you survive. After choosing your items,
get objective rankings from your teacher.
cell phone
grandfather's toolbox
• First aid kit
o box of matches
box of non-perishable food.
swiss army knife you got for your loth birthday
1
2
Dashboard
3
4
5
Your Top 5
Amazing!
0-5
Your objective
decision-making skills
will help you survive the
Zombie Apocalypse!
Add up the numbers in the last column to get your Survival Score
Solid
6-15
For the most part,
you showed objectivity
under pressure.
You've got a good
chance of survival.
MA
$200 in cash
4 gallons of water
quilt your grandma made
photo of your family
• LED flashlight
baseball bat you hit your first homerun with
Objective Ranking
CK
Fair
16-25
You may want to brush
up on your LOGIC
strategies in order
to survive a Zombie
Apocalypse.
DELL
Difference
Good Luck…
arrow_forward
Populate the CUST_NUM, INV_DATE, and INV_AMOUNT fields with the following customers:
CUST_NUM
INV_DATE
INV_AMOUNT
1000
2016-03-23
235.89
1001
2016-03-23
312.82
1001
2016-03-30
528.10
1000
2016-04-12
194.78
1000
2016-04-23
619.44
arrow_forward
8. Get Request 2
You have to send the following data to a server: a) a hat brand of Stetson and b) a style of Rancher and c) size of 7 1/4". The URL for the server is http://www.stetson.com/hats.php. What is a GET url for this query?
Hint: Don't forget you need to encode the special characters in the size.
Hurry please
arrow_forward
Downloads/
assum_sec X
+
English
localhost:8888/notebooks/Downloads/21201491_Nuzhat%20Tabassum_sec-17_CSE110_assignment-06.ipynb
C jupyter 21201491_Nuzhat Tabassum_sec-17_CSE110_assignment-06 Last Checkpoint: 8 hours ago (unsaved changes)
Logout
File
Edit
View
Insert
Cell
Kernel
Widgets
Help
Trusted
Python 3 O
+
> Run
Code
print(rem_duplicate(('Hi',1,2,3,3, 'Hi','a','a',[1,2])))
("Hi', 1, 2, 3, 'а', [1, 2])
Task 12
Write a python function that takes a list as an argument. Your task is to create a new list where each element can be present at max 2 times. Inside the
function, print the number of elements removed from the given list. Finally, return the new list and print the result.
========:
=======
Hint: You may use list_name.count(element) to count the total number of times an element is in a list. list_name is your new list for this problem.
Function Call:
function_name([1, 2, 3, 3, 3, 3, 4, 5, 8, 8])
Output:
Removed: 2
[1, 2, 3, 3, 4, 5, 8, 8]
Function Call:
function_name([10, 10,…
arrow_forward
Downloads/
assum_sec X
+
English
localhost:8888/notebooks/Downloads/21201491_Nuzhat%20Tabassum_sec-17_CSE110_assignment-06.ipynb
C jupyter 21201491_Nuzhat Tabassum_sec-17_CSE110_assignment-06 Last Checkpoint: 8 hours ago (unsaved changes)
Logout
File
Edit
View
Insert
Cell
Kernel
Widgets
Help
Trusted
Python 3 O
+
• Run
с
Markdown
Task 15
You have been hired as an app developer for the company. The company plans to make an app for a grocery store where the user can order groceries and
see the total amount to be paid in the cart section.
To build this feature, you have to write a function that takes 2 arguments. They are:
order_items (must be a list)
• location (default value should be set to "Dhanmondi")
Your first task is to take a list of items from the user. Pass the list into the function parameter along with the optional location (Use default argument technique).
(Also, no need to take location as input, pass this any value you want.)
Your second task is to implement the function.…
arrow_forward
None
arrow_forward
Apply the First Normal Form (1NF) and Second Normal Form (2NF) steps to the following two tables.
ST_ID
ST_Name
ST_Major
St_Phone
ST_Email
100
Marla jen
ACCT
(703) 111-2222
mjen@gmail.com
110
Jan Bok
MGMT
(703) 222-3333
jbok@verizon.net
115
Lee Chan
MIS
(703) 333-4444
(703) 444-5555
lchan@cox.net
Table 1
ID
Name
Courses
1
Ashely Key
MIS 302, MIS 303
2
Katy Pery
MIS 310
3
Mickey Zen
MIS 303, MIS 350
Table 2
arrow_forward
MYSQL
arrow_forward
Try to do it asap
8. Get Request 2
You have to send the following data to a server: a) a hat brand of Stetson and b) a style of Rancher and c) size of 7 1/4". The URL for the server is http://www.stetson.com/hats.php. What is a GET url for this query?
Hint: Don't forget you need to encode the special characters in the size.
arrow_forward
import pandas as pd
import numpy as np
URL = "https://bit.ly/38zhU5T"
df=pd.read_csv(URL)
note: I think the data should be cleaned before performing the tasks(please include the solution of cleaning the data as well)
arrow_forward
SLSREP_FNAME
SLSREP_INITIAL
SLSREP_EMAIL
CUSTOMER
PK CUST NUM
CUST_LNAME
CUST_FNAME
CUST_AREACODE
CUST_PHONE
CUST_E-MAIL
CUST_SHIP_ADDRESS
CUST_SHIP_CITY
CUST_SHIP_STATE
CUST_ZIP_CODE
PK,FK1
PK
FK2
HE
SALESREP
INVOICE
PK SLSREP NUM
PK
INV_NUM
SLSREP_LNAME-It writes OFK1 CUST_NUM
FK2 SLSREP_NUM
INV_DATE
INV_SUBTOTAL
I
generates
INV_TAX
INV_TOTAL
contains
INV_LINE
INV_NUM
INV_LINE_NUM
PROD_CODE
INV_LINE_PRICE
INV_LINE_QUANT
INV_LINE_TOTAL
VENDOR
PK VEND_CODE
VEND_NAME
VEND_CONTACT
VEND_EMAIL
I
supplies
PRODUCT
PK PROD_CODE
is written in +1-FK1 VEND_CODE
PROD_DESCRIPTION
PROD_PRICE
PROD_QOH
arrow_forward
create simple receipt page like photo below
arrow_forward
Please provide correct solution only wrong answer will be downvoted directly understood
arrow_forward
Set up a Google Cloud Platform account. Create a BigQuery dataset named “order_entry_dataset” in your GCP Project. Copy all of the tables from the `handy-bonbon-142723.order_entry_dataset` to your own order_entry_dataset dataset (see example code below).
Table names are:
products, customers, orders, order_items, promotions, salesreps, warehouses, and inventories.
To copy the tables, create an order_entry_dataset in your own GCP Project and then run queries like
this (for each table):
CREATE TABLE `order_entry_dataset.customers` AS
SELECT * FROM `handy-bonbon-142723.order_entry_dataset.customers`
Write a SQL statement to show the total dollar amount sold summarized by Customer marital status and Year along with RANK. The largest sales by marital status by year should be ranked #1.
arrow_forward
Determine the primary keys. This step is done normallywhile creating ER/EER.
arrow_forward
Assignment: Staywell Student Accomodation
I don't understand what I need to do here, its in mySQL. Help would be appreciated!
arrow_forward
Using MySQL, populate the CUST_LNAME, CUST_FNAME, and CUST_BALANCE fields with the following customers:
CUST_LNAME
CUST_FNAME
CUST_BALANCE
Smith
Jeanne
1050.11
Ortega
Juan
840.92
arrow_forward
Normalization Diagram. See the attached picture.
arrow_forward
how would you create this into an erd what would you change and how would you label in to come together
arrow_forward
DBS-145.
arrow_forward
Given the Employee, Class, and Training tables.
Employee
Emp_id (PK)
EM8765
Address
USA
Name
Phone
Email
Ali
ali@yahoo.com
nazire@gmail.com
katrina@gmail.com
lemi@hotmail.com
alican@yahoo.com
mustafa@hotmail.com
hasan@gmail.com
98733211
ЕМ3456
Nazire
Dubai
98764533
90857464
EM7658
Katrina
USA
EM1987
Lemi
USA
99663425
EM8009
Alican
UK
95583372
|EM7698
Mustafa
Dubai
Jordan
92234452
EM6666
Hasan
92123366
Class
Class_id (PK)
Class_name
Multimedia
Credit
СOM106
COM206
Database
сомз06
Public Speaking
9.
Training Table
Emp_id (FK)
EM8765
Date
Class_id (FK)
Result
05-May-2010
08-May-2011
08-Feb-2010
08-Feb-2010
соM106
Pass
EM3456
COM206
Pass
EM7658
сомз06
Fail
EM1987
сомзо6
Fail
28-Jan-2011
10-March-2012
EM8009
сомз06
Pass
EM7698
сом106
Fail
EM8765
08-May-2011
сOM206
Pass
Write the appropriate SQL queries
a) Get the address of employee whose name is Alican
b) Get the name and email of employees located in Dubai. Sort the results in
alphabetical order of name.
c) Show the count of employees…
arrow_forward
CUSTOMERColumns = 7, Rows = 10
CustomerID
LastName
FirstName
Address
ZIP
Phone
Email
1
Shire
Robert
6225 Evanston Ave N
98103
206-524-2433
Robert.Shire@somewhere.com
2
Goodyear
Katherine
7335 11th Ave NE
98105
206-524-3544
Katherine.Goodyear@somewhere.com
3
Bancroft
Chris
12605 NE 6th Street
98005
425-635-9788
Chris.Bancroft@somewhere.com
4
Griffith
John
335 Aloha Street
98109
206-524-4655
John.Griffith@somewhere.com
5
Tierney
Doris
14510 NE 4th Street
98005
425-635-8677
Doris.Tierney@somewhere.com
6
Anderson
Donna
1410 Hillcrest Parkway
98273
360-538-7566
Donna.Anderson@elsewhere.com
7
Svane
Jack
3211 42nd Street
98115
206-524-5766
Jack.Svane@somewhere.com
8
Walsh
Denesha
6712 24th Avenue NE
98053
425-635-7566
Denesha.Walsh@somewhere.com
9
Enquist
Craig
534 15th Street
98225
360-538-6455
Craig.Enquist@elsewhere.com
10
Anderson
Rose
6823 17th Ave NE
98105
206-524-6877
Rose.Anderson@elsewhere.com
EMPLOYEEColumns = 5, Rows = 5
EmployeeID
LastName
FirstName…
arrow_forward
CUSTOMERColumns = 7, Rows = 10
CustomerID
LastName
FirstName
Address
ZIP
Phone
Email
1
Shire
Robert
6225 Evanston Ave N
98103
206-524-2433
Robert.Shire@somewhere.com
2
Goodyear
Katherine
7335 11th Ave NE
98105
206-524-3544
Katherine.Goodyear@somewhere.com
3
Bancroft
Chris
12605 NE 6th Street
98005
425-635-9788
Chris.Bancroft@somewhere.com
4
Griffith
John
335 Aloha Street
98109
206-524-4655
John.Griffith@somewhere.com
5
Tierney
Doris
14510 NE 4th Street
98005
425-635-8677
Doris.Tierney@somewhere.com
6
Anderson
Donna
1410 Hillcrest Parkway
98273
360-538-7566
Donna.Anderson@elsewhere.com
7
Svane
Jack
3211 42nd Street
98115
206-524-5766
Jack.Svane@somewhere.com
8
Walsh
Denesha
6712 24th Avenue NE
98053
425-635-7566
Denesha.Walsh@somewhere.com
9
Enquist
Craig
534 15th Street
98225
360-538-6455
Craig.Enquist@elsewhere.com
10
Anderson
Rose
6823 17th Ave NE
98105
206-524-6877
Rose.Anderson@elsewhere.com
EMPLOYEEColumns = 5, Rows = 5
EmployeeID
LastName
FirstName…
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:9780357392676
Author:FREUND, Steven
Publisher:CENGAGE L
Related Questions
- Please solve!arrow_forwardPart 1: CUSTOMER CUST_NUM CUST_LNAME CUST_FNAME CUST_BALANCE 1000 Billy Jean 1050.11 1001 Amanda John 840.92 INVOICE INV DATE 23/3/2020 INV_NUM CUST_NUM INV_AMOUNT 8000 1000 235.89 8001 1001 23/3/2020 312.82 8002 1002 30/3/2020 528.10 8003 1003 12/4/2020 194.78 8004 1004 23/4/2020 619.44 1. Create both the CUSTOMER and INVOICE tables structure above. Details of both tables are: a) The customer number should store integer values. The name attributes should support variable length character data up to 30 characters each. The customer balance should support up to six digits on the left of the decimal place and two digits to the right of the decimal place. b) The invoice number should store integer values. The invoice date should store date values. The invoice amount should support up to 8 digits to the left of the decimal place and two digits to the right of the decimal place. 2. Write the SQL commands necessary to insert the data into the CUSTOMER table and the INVOICE table created in…arrow_forwardquetion 4arrow_forward
- osted.cuny.edu/webapps/assessment/take/launch.jsp?course_assessment_id%3D_1787700_1&course id3_1950256_1&content id%3_55349866 1&step%3Dnull * Question Completion Status: Given a truth table below with the first two columns of truth values provided: b. f(p,q) 1 2. F 4 Which of the answers below contains the truth values for the third column when f(p,q) ? Column 3 truth values: Column3 truth values: Column 3 truth values: Column 3 truth values: Column 3 truth values: 1 T 1 T 1F 1 T 1 F None of the other O 2 E O2 T O2 F 2 T 2 T Oanswers provided is correct. 3 T 3 T 3 T 3 F 3 T 4 F 4 T 4 F 4 T 4 T Chck Save and Submit to save and subrmi.Chick SaueAllansuersto save all answers. Save All Answers o search 99+ T. FT F. 3.arrow_forward-center/sel-activity/11589?backpage=main&assignmentId=23921320 SI Scientific... The Zombie Apocalypse has finally happened! You have time to grab only five of the following items to help you survive. After choosing your items, get objective rankings from your teacher. cell phone grandfather's toolbox • First aid kit o box of matches box of non-perishable food. swiss army knife you got for your loth birthday 1 2 Dashboard 3 4 5 Your Top 5 Amazing! 0-5 Your objective decision-making skills will help you survive the Zombie Apocalypse! Add up the numbers in the last column to get your Survival Score Solid 6-15 For the most part, you showed objectivity under pressure. You've got a good chance of survival. MA $200 in cash 4 gallons of water quilt your grandma made photo of your family • LED flashlight baseball bat you hit your first homerun with Objective Ranking CK Fair 16-25 You may want to brush up on your LOGIC strategies in order to survive a Zombie Apocalypse. DELL Difference Good Luck…arrow_forwardPopulate the CUST_NUM, INV_DATE, and INV_AMOUNT fields with the following customers: CUST_NUM INV_DATE INV_AMOUNT 1000 2016-03-23 235.89 1001 2016-03-23 312.82 1001 2016-03-30 528.10 1000 2016-04-12 194.78 1000 2016-04-23 619.44arrow_forward
- 8. Get Request 2 You have to send the following data to a server: a) a hat brand of Stetson and b) a style of Rancher and c) size of 7 1/4". The URL for the server is http://www.stetson.com/hats.php. What is a GET url for this query? Hint: Don't forget you need to encode the special characters in the size. Hurry pleasearrow_forwardDownloads/ assum_sec X + English localhost:8888/notebooks/Downloads/21201491_Nuzhat%20Tabassum_sec-17_CSE110_assignment-06.ipynb C jupyter 21201491_Nuzhat Tabassum_sec-17_CSE110_assignment-06 Last Checkpoint: 8 hours ago (unsaved changes) Logout File Edit View Insert Cell Kernel Widgets Help Trusted Python 3 O + > Run Code print(rem_duplicate(('Hi',1,2,3,3, 'Hi','a','a',[1,2]))) ("Hi', 1, 2, 3, 'а', [1, 2]) Task 12 Write a python function that takes a list as an argument. Your task is to create a new list where each element can be present at max 2 times. Inside the function, print the number of elements removed from the given list. Finally, return the new list and print the result. ========: ======= Hint: You may use list_name.count(element) to count the total number of times an element is in a list. list_name is your new list for this problem. Function Call: function_name([1, 2, 3, 3, 3, 3, 4, 5, 8, 8]) Output: Removed: 2 [1, 2, 3, 3, 4, 5, 8, 8] Function Call: function_name([10, 10,…arrow_forwardDownloads/ assum_sec X + English localhost:8888/notebooks/Downloads/21201491_Nuzhat%20Tabassum_sec-17_CSE110_assignment-06.ipynb C jupyter 21201491_Nuzhat Tabassum_sec-17_CSE110_assignment-06 Last Checkpoint: 8 hours ago (unsaved changes) Logout File Edit View Insert Cell Kernel Widgets Help Trusted Python 3 O + • Run с Markdown Task 15 You have been hired as an app developer for the company. The company plans to make an app for a grocery store where the user can order groceries and see the total amount to be paid in the cart section. To build this feature, you have to write a function that takes 2 arguments. They are: order_items (must be a list) • location (default value should be set to "Dhanmondi") Your first task is to take a list of items from the user. Pass the list into the function parameter along with the optional location (Use default argument technique). (Also, no need to take location as input, pass this any value you want.) Your second task is to implement the function.…arrow_forward
- Nonearrow_forwardApply the First Normal Form (1NF) and Second Normal Form (2NF) steps to the following two tables. ST_ID ST_Name ST_Major St_Phone ST_Email 100 Marla jen ACCT (703) 111-2222 mjen@gmail.com 110 Jan Bok MGMT (703) 222-3333 jbok@verizon.net 115 Lee Chan MIS (703) 333-4444 (703) 444-5555 lchan@cox.net Table 1 ID Name Courses 1 Ashely Key MIS 302, MIS 303 2 Katy Pery MIS 310 3 Mickey Zen MIS 303, MIS 350 Table 2arrow_forwardMYSQLarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- COMPREHENSIVE MICROSOFT OFFICE 365 EXCEComputer ScienceISBN:9780357392676Author:FREUND, StevenPublisher:CENGAGE L
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:9780357392676
Author:FREUND, Steven
Publisher:CENGAGE L