ps4_tonyzhang
.pdf
keyboard_arrow_up
School
Pennsylvania State University *
*We aren’t endorsed by this school
Course
184
Subject
Computer Science
Date
Apr 3, 2024
Type
Pages
8
Uploaded by MajorMaskMule13
Assignment Title
Your Name Here
Date
Use Headers
Use headers to organize your document. The first level heading is denoted by a single pound sign/hash tag,
#
. Each new
problem/exercise should get a Level 1 Heading. For subparts, increase the heading level by increasing the number of hash
tags.
For example, if Problem 1 has Parts A (with parts i-ii) and B, your R Markdown file would have the following:
# Problem 1
[text]
## Part A
[text]
### Part i
[text]
### Part ii
[text]
## Part B
[text]
Code
There are two ways to include code in your document: inline and chunks.
Inline Code
To add inline code, you’ll need to type a grave mark ‘ (the key to the left of the numeral 1 key), followed by a lower case r,
a space, then the
R
commands you wish to r and a final grave. For example ‘
r nrow(dataFrame)
‘ would return the number
of rows in the data frame named “dataFrame”.
Inline code is good for calling values you have stored and doing quick calculations on those values. Inline code will not be
added to the Code Appendix.
Code Chunks
For more complicated code such as data manipulation and cleaning, creating graphs or tables, model building and testing,
you’ll want to use code chunks. You can do this in two ways:
•
You can click the Insert button found just above the RStudio’s editor page (has an icon of a white circle with a green
plus sign and a green square with a white C) and selecting R from the drop down list.
•
You can create your own code chunk by typing three graves in a row, returning twice and typing three more graves.
You should see the editor become shaded gray for those three lines. You will want to write your code starting in the
middle blank line. In the first line, right after the third grave, you’ll want to set options including coding language and
chunk name as well as other options (e.g., figure caption and dimensions).
1
Mathematics
To type mathematical formulas, you will need to use LaTeX commands. For inline mathematics you’ll need to enclose your
mathematical expression in \( and \). For display math (on it’s own line and centered), enclose the expression in \[ and \].
The following code will automatically create your Code Appendix by grabbing all of your code chunks and writing that code
here. Take a moment to look through the appendix and make sure that your code is fully readable. Use comments in your
code to help create markers for what code does what.
2
Code Appendix
# This template file is based off of a template created by Alex Hayes
# https://github.com/alexpghayes/rmarkdown_homework_template
# Setting Document Options
knitr
::
opts_chunk
$
set
(
echo =
TRUE
,
warning =
FALSE
,
message =
FALSE
,
fig.align =
"center"
)
install.packages
(
"mdsr"
,
repos =
"http://cran.us.r-project.org"
)
install.packages
(
"dplyr"
,
repos =
"http://cran.us.r-project.org"
)
library
(mdsr)
library
(dplyr)
data
(
"Minneapolis2013"
)
same_first_second
<-
Minneapolis2013
%>%
filter
(First
==
Second)
num_same_first_second
<-
nrow
(same_first_second)
head
(same_first_second)
top_3_choices
<-
same_first_second
%>%
count
(First)
%>%
arrange
(
desc
(n))
%>%
head
(
3
)
top_3_choices
ole_savior_first
<-
Minneapolis2013
%>%
filter
(First
==
"Ole Savior"
)
top_3_second_choices
<-
ole_savior_first
%>%
count
(Second)
%>%
arrange
(
desc
(n))
%>%
head
(
3
)
print
(top_3_second_choices)
install.packages
(
"ggplot2"
,
repos =
"http://cran.us.r-project.org"
)
library
(ggplot2)
data
(diamonds)
diamonds
%>%
group_by
(color)
%>%
summarise
(
avg_carat =
mean
(carat))
%>%
arrange
(
desc
(avg_carat))
%>%
head
(
1
)
diamonds
%>%
group_by
(clarity)
%>%
summarise
(
avg_table_per_carat =
mean
(table
/
carat))
%>%
arrange
(
desc
(avg_table_per_carat))
%>%
head
(
1
)
Minneapolis2013
<-
Minneapolis2013
%>%
group_by
(First)
%>%
mutate
(
name_count =
n
())
%>%
mutate
(
First =
if_else
(name_count
<
5000
,
"minor"
, First))
%>%
select
(
-
name_count)
head
(Minneapolis2013)
3
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
1. The timeclock.txt file contains the hours worked data for every employee as well as the shift they worked. The layout for the file is as follows:
EMPLOYEE NUMBER, HOURS WORKED, SHIFT
2. The personnel.txt file contains the names of all employees and their hourly pay rates. The layout for the file is as
follows:
EMPLOYEE NUMBER, EMPLOYEE NAME, PAY RATE Note: Both the timeclock.txt and payroll.txt files are pre-sorted by EMPLOYEE NUMBER in ascending order.
Business Rules
1. For hours <= 40, the employee gross pay is: HOURS WORKED PAY RATE 2. For hours> 40, the employee gross pay is: HOURS WORKED PAY RATE 1.5
3. For shift 3, add $1 per hour to the employee pay rate
The program should:
1. Download both input files in the same folder that you will create your .py program.
2. Read both input files together.
3. Match the input files by the EMPLOYEE NUMBER.
4. For each record in the timesheet.txt file, write a record in a new output file named payroll,txt based on the business rules…
arrow_forward
PYTHON CODE
Using Artists.csv (link below), write a query that returns all lines that are female artists only, with begin date greater than 1950 but no greater than 2000
Write a query that will return all lines of British Male artists, who's first names starts with the letter ‘A’ and has an end date earlier than 1990
Write a query that will write to a file all lines that have Japanese Artists who’s difference of end date and begin date exceeds 100 years. I.e. if artist begins in 1900 and ends in 2005, then they would be included in the output (2005-1900 = 105 years)
Write a query that will write and find to a file the artist who’s been at the Museum the longest (the widest gap between Begin Date and End Date)
Artists.csv: https://media.githubusercontent.com/media/MuseumofModernArt/collection/master/Artists.csv
arrow_forward
#Data is given in the order: Serial Number | Item Name | Quantity | Priceprice_list = [["01","Keyboard",4,200.0],["02","Mouse",4,150.0],["03","Printer",2,300.0]]
#Write Code to increase the price of all the items by 50 taka
#Code1
#Write code to add a new item to the list using user input
#Code2
print()#Print the list using nested loops
#Code3
#Sample output given below:
Enter Serial: 05Enter Item Name: MonitorEnter Quantity: 200Enter Price: 50
01Keyboard4250.0-----------------02Mouse4200.0-----------------03Printer2350.0-----------------05Monitor20050-----------------
arrow_forward
return_dict() that takes the name of a CSV file as the input parameter and returns a dictionary, where each key is the Reporting_PHU_ID and the value is a list containing the following data.
name of CSV file is "data23.csv"
arrow_forward
Part B - reading CSV files
You will need a Python repl to solve part B.
Define a Python function named cheapest_rent_per_state that has one parameter. The parameter is a string representing the name of a CSV file. The CSV file will be portion of a dataset published by the US
government showing the median (middle) rent in every county in the US. Each row in the CSV file has the same format
Area Name, Efficiency, 1-Bedroom, 2-Bedroom, 3-Bedroom, 4-Bedroom, State Code
The data in the Area Name and State Code columns are text. The data in all of the other columns are decimal numbers.
Your function will need to use the accumulator pattern to return a dictionary. The keys of that dictionary will be the state codes read in from the file (state codes are at index 6). For each key in the dictionary, it's
value should be the smallest median rent for an efficiency in that state (median rents for an efficiency are at index 1).
Important Hints:
* You will really, really want to use the built-in csv…
arrow_forward
JAVA Script
Create a form that has a last name, a first name, an email address, a drop-down listing of 10 cities in Massachusetts. The list is to be sorted (hint: think array), an email address, and a zip code field. Each field is to be process through a validation function. You may use one function for each but if you are creative you should be able to use just one function. The drop-down listing will not require validation because they will be choosing from a list that you are providing.
This input from must be styled and show an effect to the user as to which field that are currently providing input.
arrow_forward
LINKS :
https://youtu.be/rR_mmsfIzzs
Input for games - UWP applications | Microsoft Learn
arrow_forward
Code
arrow_forward
Assignment Submission Instructions:This is an individual assignment – no group submissions are allowed. Submit a script file that contains the SELECT statements by assigned date. The outline of the script file lists as follows:/* ******************************************************************************** * Name: YourNameGoesHere * * Class: CST 235 * * Section: * * Date: * * I have not received or given help on this assignment: YourName * ***********************************************************************************/USE RetailDB;####### Tasks: Write SQL Queries ######### -- Task 1 (Customer Information):-- List your SELECT statement below.
Make sure the SQL script file can be run successfully in MySQL and show the outcome of the code on MySQL
arrow_forward
In Java Language Write Code below Image
arrow_forward
2. load_friendsdb
This function does the reverse of save_friendsdb -- it takes a single argument, filename, and opens that specified file for
reading. Then it reads the file one line at a time and creates a new friends database to return. Like in the previous
function, each line will contain a friend's name followed by a tab, then the friend's height, and then a newline.
Sample calls should look like this:
>>> load_friendsdb("friendsdb.tsv")
[{'name': ' bimmy', 'height': 600}, {'name': Ian Donald Calvin Euclid Zappa', height': 175}]
arrow_forward
2. load_friendsdb
This function does the reverse of save_friendsdb -- it takes a single argument, filename, and opens that specified file for
reading. Then it reads the file one line at a time and creates a new friends database to return. Like in the previous
function, each line will contain a friend's name followed by a tab, then the friend's height, and then a newline.
Sample calls should look like this:
>>> load friendsdb("friendsdb.tsv")
[{'name': ' bimmy', 'height': 600}, {'name': 'Ian Donald Calvin Euclid Zappa', height': 175}]
arrow_forward
CCDConnect < C X
Dashboard - CCD X
M5 Assignment 1 x ▸ How to install Or X
https://mycourses.cccs.edu/d21/le/content/83491/viewContent/6197961/View
Requirements for Your M5 Assignment 1 Pseudocode for Program Integration
For the first module, write the pseudocode to process these tasks:
(Note: lines beginning with # are comments with tips for you)
2. Define a class called Dice
PDF Oracle 12c SQL (
1. From the random module import randint to roll each die randomly
a. # in pseudocode, import a random function
b. # the name is helpful for the next M5-2 assignment
a. In Python, the syntax has a colon after it: class Dice():
b. In pseudocode, you can specify it generally or be specific
3. Under the class declaration, list the attributes. Here are some tips:
a. # attributes are what we know about a single die (dice is plural)
b. # self is the first attribute in Python and must always appear first
c. # add a num_sides attribute and to set it to 6 for the 6 sides on the dice
4. Define a method…
arrow_forward
save_compressed_image: takes a nested list and a filename (string) as input, and saves it in the
compressed PGM format to a file with the given filename. If the image matrix given as input is not
a valid compressed PGM image matrix, instead raise a AssertionError with an appropriate error
message.
>>> save_compressed_image([["0x5", "200x2"], ["111x7"]], "test.pgm.compressed")
>>> fobj open("test.pgm.compressed", 'r')
>>> fobj.read()
=
'P2C\\n7_2\\n255\\n0x5 200x2\\n111x7\\n'
>>> fobj.close()
>>> image
[["0x5", "200x2"], ["111x7"]]
>>> save_compressed_image(image, "test.pgm")
>>> image2 =
>>> image
True
=
==
load_compressed_image("test.pgm")
image2
• save_image: takes a nested list and a filename (string) as input. Checks the type of elements in the
list If thou are intogors thon saves the posted list as a PCM imago matrix into a file with the given
arrow_forward
Attached File: a2provided:
grades = [[71, 14, 41, 87, 49, 93],[66, 73, 54, 55, 94, 79],[20, 51, 77, 20, 86, 15],[79, 63, 72, 57, 63, 73],[30, 66, 78, 65, 41, 45],[11, 83, 51, 47, 68, 63],[99, 43, 85, 86, 24, 75],[67, 102, 11, 84, 64, 109],[16, 24, 101, 78, 55, 89],[100, 26, 37, 95, 106, 100],[55, 77, 30, 34, 28, 15],[87, 67, 13, 71, 67, 83],[95, 65, 94, 56, 15, 92],[102, 23, 36, 39, 60, 39],[90, 59, 96, 105, 83, 16],[101, 40, 17, 12, 44, 36],[39, 63, 96, 12, 65, 82],[95, 20, 105, 34, 69, 95],[95, 93, 75, 18, 105, 102],[35, 15, 82, 106, 73, 30],[80, 52, 67, 49, 11, 88],[86, 17, 44, 75, 78, 49],[22, 60, 74, 110, 92, 37],[13, 14, 15, 82, 75, 57],[71, 106, 15, 77, 30, 98],[43, 80, 76, 85, 102, 53],[26, 98, 60, 80, 104, 79],[12, 28, 40, 106, 88, 84],[82, 75, 101, 29, 51, 75],[20, 31, 84, 35, 19, 85],[84, 63, 56, 101, 83, 102],[25, 106, 36, 24, 61, 80],[86, 75, 89, 47, 28, 27],[38, 48, 22, 72, 53, 83],[70, 34, 46, 86, 32, 58],[83, 59, 38, 16, 94, 104],[62, 110, 13, 12, 13, 83],[90, 59, 55,…
arrow_forward
+||
8
Exercise 1 (2%)
Create an anonymous block that displays a course list. Declare a cursor and use the OPEN,FETCH, and
CLOSE cursor statements to access the cursor. Use the %ROWTYPE attribute for the cursor.
Output:
Course Code
Course Title
Accounting Theory
Microeconomics
Financial Accounting
Anthropology
Introduction to Business
Businéss Planning
Web Technologies I
Programming Logic
Web Technologies II
Python Programming
Web Technologies III
Database Design & SQL
Communications I
ACC104
ACC205
ANT100
BUS100
BUS230
CIS100
CIS105
CIS200
CIS225
00ESI)
CIS400
ENG101
ENG201
GEO101
MGT410
Communication II
The Physical Environment
Human Resources Management
Project Management
Algebra
Geometry
Nursing Theory I
Nursing Theory II
MGT415
MTH120
MTH400
NSG130
NSG230
-19°C Mostly sunny ^ o
prt sc
home
end
insert
delete
F6
F7
F10
F11
F12
81
)
(
num
backspace
lock
6
}
{
]
enter
7.
shift
B.
/
dn 6d
up 6d
alt
ctrl
>
arrow_forward
individual characters using their 0-based index. Hint: You will need to do this for checking all the rules. However, when you access a character .
arrow_forward
Please help me write the following function (please see the attached photos for context of the problem):
find_treasure(start_map_num):
Takes an integer between 0 and 9 as input. Loads the corresponding map file, and starts following the trail (at position 0, 0 of that file) as described above. Continues following the trail through other map files as needed. Places an 'X' at the conclusion of the trail and saves the updated treasure map to a new file with 'new_' prepended to the current map filename. Returns a tuple of the row and column index where the 'X' was placed in that file.
arrow_forward
Given the following link list, please do the following:
head
2000
2800
1500
3600
null
17 2800 92
info link
2000-
1500-
63
3600-
45
info
link
info
link
info
link
current 2000
a) Provide the values for each statement.
head.info =
head.link.link.link
current.link =
current.link.link.link
b) Write the java code to print all info (data) fields stored in the above linked list.
arrow_forward
shell scripting
arrow_forward
Description
Create a new list called good_books_list by slicing The Great Gatsby to Hamlet from book_list). Then loop through good_book_list and print out each book on it's
own line.
Specification
• You should submit a single file called MidtermExam1.py
• It should follow the submission standards outlined above. The assignment name will be Midterm Exam 1
Each print statement should be sent a single f-string as an argument or nothing at all. For example:
• Don't do this: (print("My variable is ", myvar1)
. This is ok: print (f"My variable is (myvar1}"))
. This is ok: (print())
Hard-code
Copy the code below to the top of your python file
book_list = [
'Ulysses',
]
'Don Quixote',
'One Hundred Years of Solitude',
'The Great Gatsby",
'Moby Dick',
'War and Peace',
'Hamlet',
'The Odyssey',
'Madame Bovary',
arrow_forward
Python Programming Assignment: Create a dictionary that takes a basketball team's information (that includes team's name and points) as parameter, creates a teams_dict and returns it. Also, create a parameter for write_file parameter that opens current results text file in write mode and writes the dictionary information to file as per format and closes the file.
arrow_forward
BASH FLOW CHART:
Create a flow chart to describe an algorithm that takes a text file with format ID,FirstName,Last Name,Street,City and appends a user ID field consisting of a C followed by theemployee ID. For example, the first entries in Lab 2's employees.txt are:0,Douglas L,Eberhard,Addenda Circle,Cornwall1,Elizabeth Sua,Hemauer,Wyatt Way,Peterborough2,Bailey Rae,Lopez,Turnagain Street,Sault Ste. MarieAfter processing, the entries should be:0,Douglas L,Eberhard,Addenda Circle,Cornwall,C01,Elizabeth Sua,Hemauer,Wyatt Way,Peterborough,C12,Bailey Rae,Lopez,Turnagain Street,Sault Ste. Marie,C2
arrow_forward
In the attached city list.txt file, the names of the provinces in Turkey are given in a single line according to the format given in Figure 1. In the application you will write, write the city names read from this file into the license plate list.txt file in the format shown in Figure 2. In more descriptive terms, citylist.txt is a file given to you. license plate list.txt is the file you will get with your code.
city list:
Adana, Adıyaman, Afyon, Ağrı, Amasya, Ankara, Antalya, Artvin, Aydın, Balıkesir, Bilecik, Bingöl, Bitlis, Bolu, Burdur, Bursa, Çanakkale, Çankırı, Çorum, Denizli, Diyarbakır, Edirne, Elazığ, Erzincan, Erzurum, Eskişehir, Gaziantep, Giresun, Gümüşhane, Hakkari, Hatay, Isparta, İçel (Mersin), İstanbul, İzmir, Kars, Kastamonu, Kayseri, Kırklareli, Kırşehir, Kocaeli, Konya, Kütahya, Malatya, Manisa, Kahramanmaraş, Mardin, Muğla, Muş, Nevşehir, Niğde, Ordu, Rize, Sakarya, Samsun, Siirt, Sinop, Sivas, Tekirdağ, Tokat, Trabzon, Tunceli, Şanlıurfa, Uşak, Van, Yozgat,…
arrow_forward
4:
In the Department of Mathematics and Computer Science (MACS), undergraduate
course codes begin with either M (for Mathematics courses) or CS (for Computer
Science courses). Thereafter, the code has four (4) digits. The first digit is the year of
study, which is 1 to 6. The second digit is the credit hours, which is again 1 to 5. For
Mathematics courses, the third and the fourth digits is just a running index to
differentiate the course from the others. For Computer Science courses, the third digit is
the area of specialisation, which is from 0 to 4. The fourth and the last digit is just a
running index to differentiate the course from the others.
a) Draw a finite state machine (FSM) accepting/generating course codes in MACS.
b) As the result of a) above, write the corresponding C++ function
int is_MACS_course(char * str)
{
I/ C++ code
which will determine whether or not the given string, str, represents the correct code
for MACS courses.
arrow_forward
Code to create java
arrow_forward
String data type is not allowed you can make use of CString instead (char arrays with null termination).
Q1. Create an Input File with the following information regarding to inventory:
Item_Id Price Quantity Availability
Add atleast 10 records in input file.
Where item_id will be of type int , price will be of type double , quantity will be of type int and Availability will be of type char representing the status y for yes the product is available and n for not available.
Write a menu driven C++ program to perform the following four tasks in a single file, if user press option 1 the task 1 get solved and so on:
1. Display the Item_Id of the products which are not available in stock on screen.
2. Copy all the available products data in a separate file.
3. Read the original input file and update the price of each item by 10 percent increase in the original price and save the complete information in separate file.
4. Try to save the information processed in part 3 in the original…
arrow_forward
b.
ID: A
Name:
0. A summer camp offers a morning session and an afternoon session. The list morningList contains the names
of all children attending the morning session, and the list afternoonList contains the names of all children
attending the afternoon session.
Only children who attend both sessions eat lunch at the camp. The camp director wants to create lunchList,
which will contain the names of children attending both sessions.
The following code segment is intended to create lunchList, which is initially empty. It uses the procedure
IsFound (list, name), which returns true if name is found in list and returns false otherwise.
FOR EACH child IN morningList
11
Which of the following could replace so that the code segment works as intended?
IF ((IsFound (morningList, child)) OR
(IsFound (afternoonList, child)))
IF (ISFound (afternoonList, child))
APPEND (lunchList, child)
APPEND (lunchList, child)
a.
{
C.
IF (IsFound (lunchList, child) )
IF (IsFound (morningList, child))
APPEND…
arrow_forward
The above screen is used to browse the products table it uses the ProductDAO.java file, it calls the getProductByCriteria() function which should accept a parameter, this parameter should be the criteria that would be built from the two combo boxes and the text box, and queries the products table.The getProductByCriteria() function should return a list of Product objects that matches the criteria specified.
Modify the function so that it accepts a string paramater consisting of the fields from the combo boxes and a price number from the text box separated by commas and use this string to modify the query in the function to return the desired result set.
public List<Product> getProductByCriteria() //MAKE MODIFICATIONS TO THIS FUNCTION SO IT CAN TAKE PARAMETER(S)
{
if (openConnection())
{
try{
List<Product> items = new ArrayList <> ();
Product temp = null;
String…
arrow_forward
Using the data file below design a hierarchical struct to organize the data. Then declare an array of structs for the reservations. The data file contains ten reservations. There are 8 columns of data: party name, size, date and time for the reservation, phone number, email address, credit card number and expiration date for the credit card. The data can be read from the file below so you will not need to type it in repeatedly.
Once you have populated the array with data perform the following tasks:
Write a function that will print out to the screen the information for one reservation.In the main program write code that prompts the user to enter a date in the form MM DD YYYYCall the function to print out all reservations on that date. You can make a loop that calls the print function repeatedly or you can put that code inside the print function.TEST CASES: April 30, 2023 and May 12, 2023.
In this example you need to carefully consider what data types to use. For example, the credit…
arrow_forward
Using the data file below design a hierarchical struct to organize the data. Then declare an array of structs for the reservations. The data file contains ten reservations. There are 8 columns of data: party name, size, date and time for the reservation, phone number, email address, credit card number and expiration date for the credit card. The data can be read from the file below so you will not need to type it in repeatedly.
Once you have populated the array with data perform the following tasks:
Write a function that will print out to the screen the information for one reservation.In the main program write code that prompts the user to enter a date in the form MM DD YYYYCall the function to print out all reservations on that date. You can make a loop that calls the print function repeatedly or you can put that code inside the print function.TEST CASES: April 30, 2023 and May 12, 2023.
In this example you need to carefully consider what data types to use. For example, the credit…
arrow_forward
Step1-Study the scenario below and create a Java Program for Builders Warehouse, The program must consist of a class called Materials to handle the details of the materials.
Step 2-The program should read the materials details from the material.txt file then use a LinkedList to store the material details.
Step 3-Then finally the products stored in the LinkedList must be displayed like the sample code below:
Step 4-There must be clear code and a screenshot of the code running.
arrow_forward
the "list.txt" contains information about materials stored in the warehouse. Every record (line) in the file contains code, name and description seperated by "#"
write a php script that will open the file, read the content of the file and manupulate using associative array with code as a key.
the array should be sorted by the code and displayed to the user.
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
Related Questions
- 1. The timeclock.txt file contains the hours worked data for every employee as well as the shift they worked. The layout for the file is as follows: EMPLOYEE NUMBER, HOURS WORKED, SHIFT 2. The personnel.txt file contains the names of all employees and their hourly pay rates. The layout for the file is as follows: EMPLOYEE NUMBER, EMPLOYEE NAME, PAY RATE Note: Both the timeclock.txt and payroll.txt files are pre-sorted by EMPLOYEE NUMBER in ascending order. Business Rules 1. For hours <= 40, the employee gross pay is: HOURS WORKED PAY RATE 2. For hours> 40, the employee gross pay is: HOURS WORKED PAY RATE 1.5 3. For shift 3, add $1 per hour to the employee pay rate The program should: 1. Download both input files in the same folder that you will create your .py program. 2. Read both input files together. 3. Match the input files by the EMPLOYEE NUMBER. 4. For each record in the timesheet.txt file, write a record in a new output file named payroll,txt based on the business rules…arrow_forwardPYTHON CODE Using Artists.csv (link below), write a query that returns all lines that are female artists only, with begin date greater than 1950 but no greater than 2000 Write a query that will return all lines of British Male artists, who's first names starts with the letter ‘A’ and has an end date earlier than 1990 Write a query that will write to a file all lines that have Japanese Artists who’s difference of end date and begin date exceeds 100 years. I.e. if artist begins in 1900 and ends in 2005, then they would be included in the output (2005-1900 = 105 years) Write a query that will write and find to a file the artist who’s been at the Museum the longest (the widest gap between Begin Date and End Date) Artists.csv: https://media.githubusercontent.com/media/MuseumofModernArt/collection/master/Artists.csvarrow_forward#Data is given in the order: Serial Number | Item Name | Quantity | Priceprice_list = [["01","Keyboard",4,200.0],["02","Mouse",4,150.0],["03","Printer",2,300.0]] #Write Code to increase the price of all the items by 50 taka #Code1 #Write code to add a new item to the list using user input #Code2 print()#Print the list using nested loops #Code3 #Sample output given below: Enter Serial: 05Enter Item Name: MonitorEnter Quantity: 200Enter Price: 50 01Keyboard4250.0-----------------02Mouse4200.0-----------------03Printer2350.0-----------------05Monitor20050-----------------arrow_forward
- return_dict() that takes the name of a CSV file as the input parameter and returns a dictionary, where each key is the Reporting_PHU_ID and the value is a list containing the following data. name of CSV file is "data23.csv"arrow_forwardPart B - reading CSV files You will need a Python repl to solve part B. Define a Python function named cheapest_rent_per_state that has one parameter. The parameter is a string representing the name of a CSV file. The CSV file will be portion of a dataset published by the US government showing the median (middle) rent in every county in the US. Each row in the CSV file has the same format Area Name, Efficiency, 1-Bedroom, 2-Bedroom, 3-Bedroom, 4-Bedroom, State Code The data in the Area Name and State Code columns are text. The data in all of the other columns are decimal numbers. Your function will need to use the accumulator pattern to return a dictionary. The keys of that dictionary will be the state codes read in from the file (state codes are at index 6). For each key in the dictionary, it's value should be the smallest median rent for an efficiency in that state (median rents for an efficiency are at index 1). Important Hints: * You will really, really want to use the built-in csv…arrow_forwardJAVA Script Create a form that has a last name, a first name, an email address, a drop-down listing of 10 cities in Massachusetts. The list is to be sorted (hint: think array), an email address, and a zip code field. Each field is to be process through a validation function. You may use one function for each but if you are creative you should be able to use just one function. The drop-down listing will not require validation because they will be choosing from a list that you are providing. This input from must be styled and show an effect to the user as to which field that are currently providing input.arrow_forward
- LINKS : https://youtu.be/rR_mmsfIzzs Input for games - UWP applications | Microsoft Learnarrow_forwardCodearrow_forwardAssignment Submission Instructions:This is an individual assignment – no group submissions are allowed. Submit a script file that contains the SELECT statements by assigned date. The outline of the script file lists as follows:/* ******************************************************************************** * Name: YourNameGoesHere * * Class: CST 235 * * Section: * * Date: * * I have not received or given help on this assignment: YourName * ***********************************************************************************/USE RetailDB;####### Tasks: Write SQL Queries ######### -- Task 1 (Customer Information):-- List your SELECT statement below. Make sure the SQL script file can be run successfully in MySQL and show the outcome of the code on MySQLarrow_forward
- In Java Language Write Code below Imagearrow_forward2. load_friendsdb This function does the reverse of save_friendsdb -- it takes a single argument, filename, and opens that specified file for reading. Then it reads the file one line at a time and creates a new friends database to return. Like in the previous function, each line will contain a friend's name followed by a tab, then the friend's height, and then a newline. Sample calls should look like this: >>> load_friendsdb("friendsdb.tsv") [{'name': ' bimmy', 'height': 600}, {'name': Ian Donald Calvin Euclid Zappa', height': 175}]arrow_forward2. load_friendsdb This function does the reverse of save_friendsdb -- it takes a single argument, filename, and opens that specified file for reading. Then it reads the file one line at a time and creates a new friends database to return. Like in the previous function, each line will contain a friend's name followed by a tab, then the friend's height, and then a newline. Sample calls should look like this: >>> load friendsdb("friendsdb.tsv") [{'name': ' bimmy', 'height': 600}, {'name': 'Ian Donald Calvin Euclid Zappa', height': 175}]arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageNp Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:Cengage
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage