create a public class and a main class to
deletebyStudentID number with get ID and getStudentByName in public
class. when the user is prompted to search for the student and
delete them by their. ID has seven digits and 6 students
each.
Ex. Delete student by their ID
Enter students name and
their ID
Vanessa,
1111-111
Vanessa is now
deleted
In: Computer Science
Consider the following three data sets which shows the students’ results for test in the
new course launched in the undergraduate program across three sections.
Class A:{65;75;73;50;60;64;69;62;67;85}
Class B:{85;79;57;39;45;71;67;87;91;49}
Class C: {43;51;53;110;50;48;87;69;68;91}
Using appropriate statistical tools- numerical and graphical, describe the similarity and differences in the students’ performance among the three classes.
In: Math
In a large survey, third graders were asked what their favorite color is. The results are in the table below.
| Color | Red | Blue | Yellow | Pink | Green | Orange |
| Relative Frequency | 14% | 25% | 18% | 20% | 13% | 10% |
Suppose that 10 randomly selected students are chose. What is the probability that 3 students say blue is their favorite color?
In: Math
In: Computer Science
4. Suppose from our class (with 25 students), we find the
average GPA is 2.7, with standard deviation
0.4. Regard our class as a random sample from the whole university.
Based on the information from our
class, can we believe at significance level 0.05, that the average
GPA for all students can be at least 2.8?
In: Math
In python I want to create a singular function that takes two parameters 'head; and 'skip'.
Head is a linked list. Skip is a non negative value. If skip is zero it should return the linked list unchanged. The skip amount determines the amount to skip over. I want to change the linked list accordingly and then return the linked list with the modifications, not a list.
If you have a linked list 11 -> 12 -> 18 -> 20 -> 24 -> 32 -> 38 -> 44
and skip =2, then the linked list you return should be the following:
18 -> 32
If skip = 1, then the linked list you return should be the following:
12 -> 20 -> 32 -> 44
In: Computer Science
04 Prove : Homework - Data Structures
Linked Lists
Outcomes
At the end of this study, successful students will be
able to:
Articulate the strengths and weaknesses of Linked
Lists.
Use Linked Lists in Python to solve
problems.
Preparation Material
Read the following sections from Wikipedia: Linked
Lists:
The Introduction
Advantages
Disadvantages
Basic concepts and nomenclature
The following subsections are sufficient:
Intro
Singly Linked Lists
Doubly Linked Lists
Tradeoffs
The following subsections are sufficient:
Linked Lists vs. Dynamic Arrays
Data Structures for the Common Person
After going over the technical details of linked lists
above, please watch the following short video, containing a
non-computing example:
Using Linked Lists in Python
Many languages have a LinkedList library that provides
all of this behavior for you. Python does not specifically have a
"LinkedList" collection. It does, however, have a deque
(Double-ended queue, pronounced "deck"), which is in fact
implemented as a doubly-linked list (see: StackOverflow).
The Deque is a generalization of stacks and queues
(which we will learn about in future weeks), but provides all the
functionality we would expect from a LinkedList, with O(1)
insertion and removal from the beginning and end of the list, and
O(n) retrieval of an item at a specific index. See the Python
documentation for a list of available methods, but in
short:
append(x) - Adds x to the end of the list
appendleft(x) - Adds x to the beginning of the
list
insert(i, x) - Inserts x at index i
pop() - Removes and returns the last item in the
list
popLeft() - Removes and returns the first item in the
list
In addition, you can iterate over a deque, using a for
loop, just like a list:
from collections import deque cars = deque() cars.append("Ford")
cars.append("Mazda") cars.append("Dodge") for car in cars:
print(car)
And, you technically can use the index notation
to access and object (e.g., print(cars[2]), but remember, this is
an O(n) operation, so if we are wanting to do this much, a linked
list may not be the right choice.
Homework Assignment
Use a linked list (i.e., a Python deque) to keep track
of a playlist of songs. Your playlist should have the functionality
to add songs to the end of the list, insert a new one at the first
of the list (so that it is played next), and then to play a song
(which removes it from the list).
INSTRUCTIONS
Follow these steps to help guide you through the
assignment:
Create a Song class that has member variables for a
title and an artist. It should have a prompt function that asks the
user for the title and artist, and a display function that displays
the title and the artist to the screen.
Create a deque of songs for your playlist.
Set up a main loop that asks the user for one of the
following options:
Add new song to the end of the playlist.
Insert a new song at the beginning of the playlist (so
it will play next).
Play a song (this should remove it from the
playlist).
Implement each of the above actions. For the ones that
add a new song, it should prompt the user for the values, and then
add the song to the play list.
When the user selects the option to play a song, it
should be removed from the list. Then, display a message to the
user, "Playing song:", followed by the title and the artist of the
song that was just removed from the front of the
playlist.
If the user attempts to play a song and the playlist
is empty, they should receive a message that informs them the
playlist is empty, and then they can make another selection. (A
Python error message should not occur and be displayed.)
EXAMPLE OUTPUT
Options: 1. Add a new song to the end of the playlist 2. Insert a
new song to the beginning of the playlist 3. Play the next song 4.
Quit Enter selection: 3 The playlist is currently empty. Options:
1. Add a new song to the end of the playlist 2. Insert a new song
to the beginning of the playlist 3. Play the next song 4. Quit
Enter selection: 1 Enter the title: Let it Be Enter the artist: The
Beatles Options: 1. Add a new song to the end of the playlist 2.
Insert a new song to the beginning of the playlist 3. Play the next
song 4. Quit Enter selection: 2 Enter the title: The Sound of
Silence Enter the artist: Simon and Garfunkel Options: 1. Add a new
song to the end of the playlist 2. Insert a new song to the
beginning of the playlist 3. Play the next song 4. Quit Enter
selection: 3 Playing song: The Sound of Silence by Simon and
Garfunkel Options: 1. Add a new song to the end of the playlist 2.
Insert a new song to the beginning of the playlist 3. Play the next
song 4. Quit Enter selection: 3 Playing song: Let it Be by the
Beatles Options: 1. Add a new song to the end of the playlist 2.
Insert a new song to the beginning of the playlist 3. Play the next
song 4. Quit Enter selection: 3 The playlist is currently empty.
Options: 1. Add a new song to the end of the playlist 2. Insert a
new song to the beginning of the playlist 3. Play the next song 4.
Quit Enter selection: 4 Goodbye
TESTING YOUR PLAYLIST PROGRAM
To help keep your focus squarely on the data structure
involved, and not on matching a particular testBed output, an
automated grading script is not provided. Instead, test your own
code by adding different songs to the beginning and end of the
playlist, and playing them. Ensuring that everything works as you
would expect.
In: Computer Science
An insurance company would like to test the hypothesis that a difference exists in the proportion of students in 12th grade who text while driving when compared to the proportion of
11th-grade drivers who text. A random sample of 160 12th grade students found that 84 texted while driving. A random sample of 175 11th grade students found that 84 texted while driving. A random sample of 175 12th grade drivers and Population 2 is defined as 11th-grade drivers. What is the 95% confidence interval for the difference in population proportions?
A.
(−0.119,0.369)
B.
(0.019, 0.231)
C.
(−0.037,0.287)
D.
(0.103, 0.147)
In: Statistics and Probability
Suppose these are the following Demand/MV and Supply/MC
equations for higher education, where Q is the number of students
and P is tuition.
The marginal value equation is: MV=17.80-1.40*Q
The marginal cost equation is: MC=1.00+0.59*Q
13.What is the equilibrium tuition(price)?
=5.98
Students receive a per-unit $2.00 scholarship if they attend
university.
14. What is the new tuition?
=6.57
15. What is the total amount spent on
scholarships?
Now, in addition to the scholarships received by students, the
university receives a $1 per student subsidy.
16. What will the new tuition be?
17. What is the total revenue (including subsidy) to
universities?
In: Economics
A data set contains the yearly tuitions in for undergraduate programs in arts and humanities at 66 universities and colleges. Tuition fees are different for domestic and international students. Suppose the mean tuition charged to domestic students was $5146, with a standard deviation of $944. For international students, suppose the mean was $14,504, with a standard deviation of $3175. Which would be more unusual: a university or college with a domestic student tuition fee of $3000 or one with an international student tuition fee of $8500? Explain.
Complete the statement below.
1. The domestic student tuition fee has a z-score of _______ and the international student tuition has a z-score of __________. Thus, the _____________ (domestic or international) is more unusual than the ___________ (domestic or international)
In: Advanced Math