Question

In C++ Correct the bugs in the following class. class player{ private: void player(string filename); ~player();...

In C++ Correct the bugs in the following class.
class player{
private:
void player(string filename);
~player();
void append_frame(string frame);
void erase_tape();
void load_tape(string filename);
void start();
void flash_forward();
void flash_backward();
void stop();
void menu();
void duplicate_frame();
void remove_frame();
global:
NodePtr Head;
NodePtr Cur;
};

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution Functions are commonly accessed by public and Global is not a type of Access specifier Modified Code: class playerf

Add a comment
Know the answer?
Add Answer to:
In C++ Correct the bugs in the following class. class player{ private: void player(string filename); ~player();...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • C++ program: Convert the classes to template classes #include <iostream> #include <string> using namespace std; class Node { private: int data; Node* next; public: Node(int...

    C++ program: Convert the classes to template classes #include <iostream> #include <string> using namespace std; class Node { private: int data; Node* next; public: Node(int data) { this->data=data; this->next = 0; } int getData(){return data;} Node* getNext(){return next;} void setNext(Node* next){this->next=next;} }; class LinkedList { private: Node* head = 0; public: int isEmpty() {return head == 0;} void print() { Node* currNode = head; while(currNode!=0) { cout << currNode->getData() << endl; currNode = currNode->getNext(); } } void append(int data) {...

  • public class Player { private String name; private int health; public Player(String name) { this.name =...

    public class Player { private String name; private int health; public Player(String name) { this.name = name; } } Write a complete method using java to find a Player by name in an array of Player objects. Use a linear search algorithm. The method should either return the first Player object with the requested name, or null if no player with that name is found.

  • In C++, for the provided template linked list class create a derived class of it which...

    In C++, for the provided template linked list class create a derived class of it which adds the functionality to it to find the high and low value of any given data stored in the list. The derived class must be a template. LinkedList.h #pragma once #include <iostream> using namespace std; template <class T> class ListNode {    public:        T data;        ListNode<T>* next;        ListNode(T data)        {            this->data = data;...

  • public class File_In_36 {    private String filename;    public int[][] matrix()    {       //...

    public class File_In_36 {    private String filename;    public int[][] matrix()    {       // 1. matrix will call scan_File to determine whether or not the file       // name entered by the user actually exists       // 2. matrix will call size_matrix to determine the number of integers       // in the input file and set the instance variable matrix_size to that       // number       // 3. matrix will call check_square to determine whether or not matrix_size...

  • For the LinkedList class, create a getter and setter for the private member 'name', constructing your...

    For the LinkedList class, create a getter and setter for the private member 'name', constructing your definitions based upon the following declarations respectively: std::string get_name() const; and void set_name(std::string); In the Main.cpp file, let's test your getter and setter for the LinkedLIst private member 'name'. In the main function, add the following lines of code: cout << ll.get_name() << endl; ll.make_test_list(); ll.set_name("My List"); cout << ll.get_name() << endl; Output should be: Test List My List Compile and run your code;...

  • 1. private Node head; private Node tail; public class Node { String name; Node next; Node...

    1. private Node head; private Node tail; public class Node { String name; Node next; Node prev; } public void displayInReverse(){ //write your code here to display names in reverse } 2. public class NodeOne { String name; NodeOne next; public NodeOne(String name) { this.name = name; } } // Complete the code snippet below so that the delete method works properly public void delete(String name) { NodeOne temp = head, prev = head; while (temp != null) { if...

  • 10. Observe the following simple program: public class Student : Person { private string name; private...

    10. Observe the following simple program: public class Student : Person { private string name; private List<string> courses; public void AddCourse(string course) { courses.Add(course); public void PrintCourses() { foreach(string course in courses) { Console.WriteLine(course); a) What is the access modifier of the member field name? b) What is the access modifier of the member method AddCourse? c) What is the immediate base class of Student?

  • class Test public static void main(String args) { Aa=new AO: a.printo: class A private String s;...

    class Test public static void main(String args) { Aa=new AO: a.printo: class A private String s; public A (String news) { 8 = news: public void print { System.out.println(s): The program would compile and run if you change A a new Alto Aa=new A('5'). The program has a compilation error because the instance variables in class A is not public. The program has a compilation error because class A does not have a no-arguments constructor The program compiles and runs...

  • Question 19 Given the following class: public class Swapper ( private int x; private String y...

    Question 19 Given the following class: public class Swapper ( private int x; private String y public int z; public Swapper( int a, String b, int c) ( x-a; y b; zC; public String swap() ( int temp -x; x-z z temp; return y: public String tostring() ( if (x<z) return y: else return" +x+z What would the following code output? Swapper r new Suapper( 5, "no", 10); System.out.printin( r. swap ) ): no no510 510 e 15 Question 20...

  • What is the output of the following program? public class Contacts Contact contacts; private void...

    What is the output of the following program? public class Contacts Contact contacts; private void addContact Contact b) if( contactsnull) contactsb; else Contact tempcontacts; contacts b; b.nexttemp; private void showContactList) Contact tempcontacts; while( tempnull) f System.out.print( temp.name + ", " ); temp temp.next; public static void main( String [] args) Contacts myContacts new Contacts ) myContacts.addContact( new Contact("Peter")); myContacts.addContact( new Contact( "Paul"); myContacts.addContact( new Contact("Mary"); myContacts.showContactList); class Contact public String name; public Contact next; public Contact( String t ) f...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT