Questions
Use C++ please You will be building a linked list. Make sure to keep track of...

Use C++ please

You will be building a linked list. Make sure to keep track of both the head and tail nodes.

(1) Create three files to submit.

  • PlaylistNode.h - Class declaration
  • PlaylistNode.cpp - Class definition
  • main.cpp - main() function

Build the PlaylistNode class per the following specifications. Note: Some functions can initially be function stubs (empty functions), to be completed in later steps.

  • Default constructor (1 pt)
  • Parameterized constructor (1 pt)
  • Public member functions
    • InsertAfter() - Mutator (1 pt)
    • SetNext() - Mutator (1 pt)
    • GetID() - Accessor
    • GetSongName() - Accessor
    • GetArtistName() - Accessor
    • GetSongLength() - Accessor
    • GetNext() - Accessor
    • PrintPlaylistNode()
  • Private data members
    • string uniqueID - Initialized to "none" in default constructor
    • string songName - Initialized to "none" in default constructor
    • string artistName - Initialized to "none" in default constructor
    • int songLength - Initialized to 0 in default constructor
    • PlaylistNode* nextNodePtr - Initialized to 0 in default constructor

Ex. of PrintPlaylistNode output:

Unique ID: S123
Song Name: Peg
Artist Name: Steely Dan
Song Length (in seconds): 237

(2) In main(), prompt the user for the title of the playlist. (1 pt)

Ex:

Enter playlist's title:
JAMZ 


(3) Implement the PrintMenu() function. PrintMenu() takes the playlist title as a parameter and outputs a menu of options to manipulate the playlist. Each option is represented by a single character. Build and output the menu within the function.

If an invalid character is entered, continue to prompt for a valid choice. Hint: Implement Quit before implementing other options. Call PrintMenu() in the main() function. Continue to execute the menu until the user enters q to Quit. (3 pts)

Ex:

JAMZ PLAYLIST MENU
a - Add song
d - Remove song
c - Change position of song
s - Output songs by specific artist
t - Output total time of playlist (in seconds)
o - Output full playlist
q - Quit

Choose an option:


(4) Implement "Output full playlist" menu option. If the list is empty, output: Playlist is empty (3 pts)

Ex:

JAMZ - OUTPUT FULL PLAYLIST
1.
Unique ID: SD123
Song Name: Peg
Artist Name: Steely Dan
Song Length (in seconds): 237

2.
Unique ID: JJ234
Song Name: All For You
Artist Name: Janet Jackson
Song Length (in seconds): 391

3.
Unique ID: J345
Song Name: Canned Heat
Artist Name: Jamiroquai
Song Length (in seconds): 330

4.
Unique ID: JJ456
Song Name: Black Eagle
Artist Name: Janet Jackson
Song Length (in seconds): 197

5. 
Unique ID: SD567
Song Name: I Got The News
Artist Name: Steely Dan
Song Length (in seconds): 306


(5) Implement the "Add song" menu item. New additions are added to the end of the list. (2 pts)

Ex:

ADD SONG
Enter song's unique ID:
SD123
Enter song's name:
Peg
Enter artist's name:
Steely Dan
Enter song's length (in seconds):
237


(6) Implement the "Remove song" function. Prompt the user for the unique ID of the song to be removed.(4 pts)

Ex:

REMOVE SONG
Enter song's unique ID:
JJ234
"All For You" removed


(7) Implement the "Change position of song" menu option. Prompt the user for the current position of the song and the desired new position. Valid new positions are 1 - n (the number of nodes). If the user enters a new position that is less than 1, move the node to the position 1 (the head). If the user enters a new position greater than n, move the node to position n (the tail). 6 cases will be tested:

  • Moving the head node (1 pt)
  • Moving the tail node (1 pt)
  • Moving a node to the head (1 pt)
  • Moving a node to the tail (1 pt)
  • Moving a node up the list (1 pt)
  • Moving a node down the list (1 pt)

Ex:

CHANGE POSITION OF SONG
Enter song's current position:
3
Enter new position for song:
2
"Canned Heat" moved to position 2


(8) Implement the "Output songs by specific artist" menu option. Prompt the user for the artist's name, and output the node's information, starting with the node's current position. (2 pt)

Ex:

OUTPUT SONGS BY SPECIFIC ARTIST
Enter artist's name:
Janet Jackson

2.
Unique ID: JJ234
Song Name: All For You
Artist Name: Janet Jackson
Song Length (in seconds): 391

4.
Unique ID: JJ456
Song Name: Black Eagle
Artist Name: Janet Jackson
Song Length (in seconds): 197


(9) Implement the "Output total time of playlist" menu option. Output the sum of the time of the playlist's songs (in seconds). (2 pts)

Ex:

OUTPUT TOTAL TIME OF PLAYLIST (IN SECONDS)
Total time: 1461 seconds

In: Computer Science

You will be building a linked list. Make sure to keep track of both the head...

You will be building a linked list. Make sure to keep track of both the head and tail nodes. (1) Create three files to submit. PlaylistNode.h - Struct definition and related function declarations PlaylistNode.c - Related function definitions main.c - main() function Build the PlaylistNode class per the following specifications. Note: Some functions can initially be function stubs (empty functions), to be completed in later steps. Private data members char uniqueID[50] char songName[50] char artistName[50] int songLength PlaylistNode* nextNodePtr Related functions CreatePlaylistNode() (1 pt) InsertPlaylistNodeAfter() (1 pt) Insert a new node after node SetNextPlaylistNode() (1 pt) Set a new node to come after node GetNextPlaylistNode() Return location pointed by nextNodePtr PrintPlaylistNode() Ex. of PrintPlaylistNode output: Unique ID: S123 Song Name: Peg Artist Name: Steely Dan Song Length (in seconds): 237 (2) In main(), prompt the user for the title of the playlist. (1 pt) Ex: Enter playlist's title: JAMZ (3) Implement the PrintMenu() function. PrintMenu() takes the playlist title as a parameter and outputs a menu of options to manipulate the playlist. Each option is represented by a single character. Build and output the menu within the function. If an invalid character is entered, continue to prompt for a valid choice. Hint: Implement Quit before implementing other options. Call PrintMenu() in the main() function. Continue to execute the menu until the user enters q to Quit. (3 pts) Ex: JAMZ PLAYLIST MENU a - Add song r - Remove song c - Change position of song s - Output songs by specific artist t - Output total time of playlist (in seconds) o - Output full playlist q - Quit Choose an option: (4) Implement "Output full playlist" menu option. If the list is empty, output: Playlist is empty (3 pts) Ex: JAMZ - OUTPUT FULL PLAYLIST 1. Unique ID: SD123 Song Name: Peg Artist Name: Steely Dan Song Length (in seconds): 237 2. Unique ID: JJ234 Song Name: All For You Artist Name: Janet Jackson Song Length (in seconds): 391 3. Unique ID: J345 Song Name: Canned Heat Artist Name: Jamiroquai Song Length (in seconds): 330 4. Unique ID: JJ456 Song Name: Black Eagle Artist Name: Janet Jackson Song Length (in seconds): 197 5. Unique ID: SD567 Song Name: I Got The News Artist Name: Steely Dan Song Length (in seconds): 306 (5) Implement the "Add song" menu item. New additions are added to the end of the list. (2 pts) Ex: ADD SONG Enter song's unique ID: SD123 Enter song's name: Peg Enter artist's name: Steely Dan Enter song's length (in seconds): 237 (6) Implement the "Remove song" function. Prompt the user for the unique ID of the song to be removed.(4 pts) Ex: REMOVE SONG Enter song's unique ID: JJ234 "All For You" removed (7) Implement the "Change position of song" menu option. Prompt the user for the current position of the song and the desired new position. Valid new positions are 1 - n (the number of nodes). If the user enters a new position that is less than 1, move the node to the position 1 (the head). If the user enters a new position greater than n, move the node to position n (the tail). 6 cases will be tested: Moving the head node (1 pt) Moving the tail node (1 pt) Moving a node to the head (1 pt) Moving a node to the tail (1 pt) Moving a node up the list (1 pt) Moving a node down the list (1 pt) Ex: CHANGE POSITION OF SONG Enter song's current position: 3 Enter new position for song: 2 "Canned Heat" moved to position 2 (8) Implement the "Output songs by specific artist" menu option. Prompt the user for the artist's name, and output the node's information, starting with the node's current position. (2 pt) Ex: OUTPUT SONGS BY SPECIFIC ARTIST Enter artist's name: Janet Jackson 2. Unique ID: JJ234 Song Name: All For You Artist Name: Janet Jackson Song Length (in seconds): 391 4. Unique ID: JJ456 Song Name: Black Eagle Artist Name: Janet Jackson Song Length (in seconds): 197 (9) Implement the "Output total time of playlist" menu option. Output the sum of the time of the playlist's songs (in seconds). (2 pts) Ex: OUTPUT TOTAL TIME OF PLAYLIST (IN SECONDS) Total time: 1461 seconds

In: Computer Science

In this exercise, you will create a basic data management system for students in the Department...

In this exercise, you will create a basic data management system for students in the Department of Computer Science and Information Technology using the linked list.

You must write two classes – Student class attached, and StudentChart.

Student class consists of student data. StudentChart class contains a linked list of all students in the department.

For this purpose, you must fulfill the following interfaces (note - fields of the objects should be marked as private).

Class: Student chart

Class of Student Chart contains data for all students stored in a linked list. The way to add a student to the list by method addStudent only to the front of the list. At the beginning the student list is empty, the number of students enrolled in the Department is 0. Think what would be the fields of this class, so that you can know much information at any one time.

Constructors:

Creat the class chart according to the private

StudentChart()

.fields(variables).

Methods:

Return type

Method name and parameters

operation

Add student to the front of the linked list.

void

addStudent(Student student

Delete student from the list. Do nothing if the student does not exist in the list. Returns false if student not found in the list

boolean

deleteStudent(Student student)

int

getNumOfStudents()

Returns the number of students in the list.

boolean

isStudent(Student student)

Examine if student exists in the list.

Student

getStudent(int studentNum)

Returns students data for the students with studentNum.

Returns the student average in the course with number

double

getAverage(int course)

course

Returns student average in all courses for all students.

double

getAverage()

(You can use the Student class methods).

Prints the students data for all students as follow:

Student number 1:

<Student String representation> Student number 2:

<Student String representation>

Student number <n>:

<Student String representation> If there are no students print:

void

printStudentChart()

No students!

It is recommended to write tester to present all the methods of the class and to check that they actually work.

The student class :

public class Student {
   private String name;// student name
   private long id; // student identity number
   private int [] grades = new int[5]; // list of student courses grades
   
   //costructor that initialize name and id
   public Student(String name, long id){
       String n = name.toUpperCase();
       name = name.replace(name.charAt(0), n.charAt(0));
       for(int i=0 ; i<name. length(); i++)
           if(name.charAt(i)==' ')
               name = name.replace(name.charAt(i+1), n.charAt(i+1));
       this.name = name;
       this.id=id;
       
   }
   
   //copy constructor
   public Student(Student st){
       this.name= st.name;
       this.id = st.id;
   }
   
   //return the student name
   public String getName(){
       return name;
   }
   //returns the student id number
   public long getId(){
       return id;
   }
   
   // returns the course grade accoring to parameter course(course number) 
   public int getGrade(int course){
       if(grades[course]== 0)
           return -1;
       return grades[course];
       
   }
   // set the name of student with parameter name
   public void setName(String name){
       String n = name.toUpperCase();
       name = name.replace(name.charAt(0), n.charAt(0));
       for(int i=0 ; i<name. length(); i++)
           if(name.charAt(i)==' ')
               name = name.replace(name.charAt(i+1), n.charAt(i+1));
       this.name = name;
       
   }
   
   //sets the student id with parameter id
   public void setId(long id){
       this.id = id;
   }
   //set the course grade with parameter grade 
   public void setGrade(int course, int grade){
       grades[course]= grade;
   }
    // set all the grades of the student from user
   public void setGrades(int [] g){
       for(int i=0; i< grades.length; i++)
           grades[i]=g[i];
            
   }
   //returns the student average in his course
   public double getAverage(){
       int sum= 0;
       int count =0;
       for(int i=0; i< grades.length; i++){
           if(grades[i]!=-1)
          sum=+ grades[i];
           count++;
       }
       return sum/count*1.0;// compute and return average
       
   }
   
   // takes a student object as a parameter and 
   // return true if it is the same as student parameter
   public boolean equals(Student student){
       if(student.id== this.id)
           return true;
       else
           return false;
   }
   //returns a string that represents the student object
   public String toString(){
       
       String [] g = new String[5];
       for(int i=0; i< grades.length; i++)
           if(grades[i]!= -1)
               g[i]= grades[i]+" ";
               else
               g[i]="no grade";
              
       String n1= "Name:"+ name+"\n"+ "ID:  "+ id +"\n"+ "Grades:"+"\n"+
               "Introduction to Programming - "+g[0] +"\n"+"Introduction to Management – "+g[1]+"\n"+
               "Data Structures – "+g[2]+"\n"+"Introduction to Economics – "+g[3]+"\n"+
               "Introduction to Mathematics – "+g[4];
       
       return n1;               
   }
    
}

In: Computer Science

Suppose you are a lawyer representing a Hispanic individual in a criminal trial. Twelve jurors are...

Suppose you are a lawyer representing a Hispanic individual in a criminal trial. Twelve jurors are randomly selected by the state from a population that you know to be 40% Hispanic.

a. How many jurors would you expect to be Hispanic? - 4.8

b. The select process produces a jury with 3 Hispanic individuals What proportion of the jury is Hispanic? (Enter your answer as a decimal, rounded to four decimal places) - .25

c. Use the binomial distribution and find the probability that 3 or fewer jurors would be Hispanic. 0.2253

d. Create a graph of the distribution with the area corresponding to the previous answer shaded in. Choices for creating a graph include: Excel, Binomial Distribution Calculator (in resources menu), TI-84 (take a pic), hand drawn, other software, websites. Upload your finished graph below.

e. Use Statistics to make an argument to the court on behalf of your client. Structure your essay as a paragraph that contains the following:

Your Honor,

Explain why random sampling in this situation of juror selection relates the expected sample proportion to the population proportion.
Compare the expected value to the actual sample proportion.
Show that the requirements for a binomial experiment are met in this situation, implying that the binomial distribution can be used.
Identify the values for n,p, and x for this situation
Interpret the answers to parts c. and d. and submit them as evidence.
Use this to argue that the juror selection was likely to be random or not likely to be random (depending on your answer to part c).
Request a new jury be selected or accept the selected jury (depending on your answer to part c)

Respectfully,

[Your Name]

 

In: Math

Many fast-food restaurants use automatic soft-drink dispensing machines that fill cups once an order is placed...

Many fast-food restaurants use automatic soft-drink dispensing machines that fill cups once an order is placed at a drive-through window. A regional manager for a fast-food chain wants to determine if the machines in her region are dispensing the same amount of product. She samples four different machines and measures a random sample of 16-ounce drinks from each machine. Here is the data she collects (in ounces):

Machine 1

Machine 2

Machine 3

Machine 4

16.5

15.0

16.0

16.6

16.6

15.4

16.3

15.9

16.5

15.3

16.5

15.5

15.8

15.7

16.4

16.2

15.6

15.2

17.3

17.0

16.4

16.0

16.7

15.5

16.1

15.6

15.7

16.3

a) “Number of ounces” is a quantitative variable. Is it discrete or continuous?

b) “Number of ounces” is what level of measurement?

c) Is this a designed experiment or an observational study? Briefly explain.

d) At the 5% Level of Significance, determine whether or not the data indicate that the mean amount dispensed from the machines is not the same, by doing each of the following:

1) Write the Hypotheses.

2) Use your calculator to do a one-way ANOVA test. Explain in some detail how the results of the test lead you to reject or not reject the null hypothesis.

3) Write a formal conclusion.

e) Using the language of our textbook on bias (way back in Section 1.5), name at least one type of bias that might be present in this research. Briefly explain.

In: Statistics and Probability

USING R TO ANSWER QUESTION: Performance Tires plans to engage in direct mail advertising. It is...

USING R TO ANSWER QUESTION: Performance Tires plans to engage in direct mail advertising. It is currently in negotiations to purchase a mailing list of the names of people who bought sports cars within the last three years. The owner of the mailing list claims that sales generated by contacting names on the list will more than pay for the cost of using the list. (Typically, a company will not sell its list of contacts, but rather provides the mailing services. For example, the owner of the list would handle addressing and mailing catalogs.) Before it is willing to pay the asking price of $3 per name, the company obtains a sample of 225 names and addresses from the list in order to run a small experiment. It sends a promotional mailing to each of these customers. The data for this exercise show the gross dollar value of the orders produced by this experimental mailing. The company makes a profit of 20% of the gross dollar value of a sale. For example, an order for $100 produces $20 in profit.

c. Describe the appropriate hypotheses and type of test to use. Choose (and justify) an alpha-level for the test. Check whether the sample size condition and the random sample condition are met.

d. Summarize the results of the sample mailing. Use a histogram and appropriate numerical statistics.

e. Summarize the results of the test. Make a recommendation to the management of Performance Tires

173.08

0

0

0

0

156.84

0

136.57

303.15

0

0

0

0

0

0

0

200.49

0

0

0

0

0

0

0

0

0

0

0

In: Statistics and Probability

In a study examining psychological and organization efforts of pets in the workplace, Wells and Perrine...

In a study examining psychological and organization efforts of pets in the workplace, Wells and Perrine (2001) found that employees believed pets reduced stress and brought positive benefits to the environment. Suppose another researcher, Dr. D, believes that the presence of pets will reduce speech anxiety in oral communication classes. To test this theory, participants were recruited from oral communication classes and randomly assigned to deliver a 10- minute persuasive speech either with or without a small older yet quiet dog resting near the podium. All speeches were videotaped, and trained observers scored the number of anxiety behaviors, such as shaking hands, wobbly legs, and cracking voice. Participants also completed a speech anxiety questionnaire when they finished their speech. As Dr. D expected, participants reported less anxiety when the dog was present than participants in the control condition.

1.Identify the null and research hypotheses for this experiment?

2.Identify the independent variable and state the different levels?

3.Identify the dependent variable?

4.What is the experimental designs?

5.Name several extraneous variables that should be controlled?

6.Evaluate this study for experimenter bias and demand characteristics?

7.If the researcher examined differences in anxiety reduction between female and male participants, what kind of research design would this be?

8.If the difference in anxiety level between the experimental and control groups are due to chance, explain to the researcher why the results would change?

9.If true anxiety differences existed between the two experimental conditions, but they were not detected, what kind of error occurred?

In: Statistics and Probability

Suppose you are a lawyer representing a Hispanic individual in a criminal trial. Twelve jurors are...

Suppose you are a lawyer representing a Hispanic individual in a criminal trial. Twelve jurors are randomly selected by the state from a population that you know to be 60% Hispanic. a. How many jurors would you expect to be Hispanic?

b. The select process produces a jury with 3 Hispanic individuals What proportion of the jury is Hispanic? (Enter your answer as a decimal, rounded to four decimal places)

c. Use the binomial distribution and find the probability that 3 or fewer jurors would be Hispanic.

d. Create a graph of the distribution with the area corresponding to the previous answer shaded in. Choices for creating a graph include: Excel, Binomial Distribution Calculator (in resources menu), TI-84 (take a pic), hand drawn, other software, websites. Upload your finished graph below. Choose File2262020.docx

e. Use Statistics to make an argument to the court on behalf of your client. Structure your essay in the following way:

Your Honor,

Explain why random sampling in this situation of juror selection relates the expected sample proportion to the population proportion.

Compare the expected value to the actual sample proportion.

Show that the requirements for a binomial experiment are met in this situation, implying that the binomial distribution can be used.

Identify the values for n,p, and x for this situation

Interpret the answers to parts c. and d. and submit them as evidence.

Use this to argue that the juror selection was likely to be random or not likely to be random (depending on your answer to part c).

Request a new jury be selected.

Respectfully, Your Name

In: Statistics and Probability

Explain how the apoptotic pathway can be activated when TNF binds to its receptor? Name and...

Explain how the apoptotic pathway can be activated when TNF binds to its receptor? Name and explain any relevant proteins.

Name a cancer specific pathway drug/treatment and explain its mechanism.  

In: Biology

In innate immune response, a) How is the virus recognized by the host? Explain and name...

In innate immune response,

a) How is the virus recognized by the host? Explain and name the cells/receptors involved

b) What signaling pathways are triggered? Name and explain the major pathways needed to mount an antiviral response.

In: Biology