python >>> feathered_pets=["canary", "parrot", "budgie", "hawk"] >>> furry_pets=["dog", "cat", "ferret", "hamster", "bunny"] >>> all_pets=furry_pets+feathered_pets what will give me the result ["parrot", "canary", "bunny"]
Q: Create a user define data type class called Room having three dimensions length, width and height…
A: //Code For the Problem // Next details of the Operators are Provided in the next step using…
Q: find and fix all the errors so the code can run #ifndef Student.h #define Student.h class…
A: The code below is an error free modified code from the above given code to store the student details…
Q: re 4 er of all
A: Below the program for you which store employee details using class with python program
Q: /* Using JAVASCRIPT write a function that parses through the below object and displays all of their…
A: I have done the code using Javascript
Q: / FILE: IntSet.h - header file for IntSet class // CLASS PROVIDED: IntSet (a container class for a…
A: C++ is an object oriented programming language which is used to create a class, class object. Using…
Q: 1 ifndef DATE_H 2 #define DATE H 3 finclude 5 6 enum class Month { 7 jan = 1, feb, mar, apr, may,…
A: there are so many errors in my 'gdb compiler' i suggest you how to do this #include…
Q: Run the program and give its output.
A: Required: Run the program and give its output.
Q: }; private: AeroCar(double new height, double new_speed); const; { void display_data() AeroCar::…
A: C++ is an object-oriented generic programming language for creating software, and it is a…
Q: #include<iostream>#include<string>class Bicycle{friend std::ostream&…
A: The objective of the question is to implement the decrement operator (--) for the Bicycle class in…
Q: Code:#include <string>using namespace std;class MOVIE {private:string movieTitle;string…
A: The given code for the class “MOVIE” is used in the below program. Keywords should not be used as…
Q: data member numCalories with a value read from input. Then, assign Ham and Cheese's data member…
A: Dear Student, The completed code is given below -
Q: fix the getIndex function
A: Step 1: To fix the getIndex function make the following changes to function. template <typename…
Q: In a population, the birth rate and death rate are calculated as follows: Birth Rate= Number of…
A: The C++ program using above conditions with snippet of the code.
Q: write a function that returns the name of the root property that a particular integer lives in. *…
A: An object is the state which stores the field and defines its behaviour through the use of the…
Q: n a string containing all the expression info such as 50 + 50 =…
A: Code: #include <iostream>#include <vector>#include <string> using namespace std;…
Q: Q1: There are common attributes and methods between passengers and drivers. What is the best choice…
A: The national railway company is seeking to develop a simple application to manage trips and…
Q: A floor plan is arranged as follows: • You may freely move between rooms 1 and 2. • You may freely…
A: In this problem we need to write the progam into the RUBY programming language. To solve this…
Q: a Wins2 Console application and an empty C+ source file in Visual Studio able to start lyping…
A: Actually, c++ is a powerful general purpose language. It is a high level language.
Q: #include using namespace std; class Player { private: int id; static int next_id; public:…
A: There is one C++ Program given. Program: #include <iostream>using namespace std;class…
Q: Write a C++ class to handle costumers buying list from Electronics store the list can go up to 20…
A: The program will ask the user to add 3 electronic device name and device price. Then we have used…
Q: def is_teenager(age: int) -> bool: "* "Return True iff age represents a teenager between 13 and 18…
A: According to the Question below the solution: Output:
Q: /Please Fix this probem. #include #include Class Soccer { Int g_no, no_assist, no_goal;…
A: /* all c in cout and cin was in capital, so, changed C to small c. */#include <iostream>…
Q: / CONSTANT // static const int DEFAULT_CAPACITY = ____ // IntSet::DEFAULT_CAPACITY is the…
A: Leaving the .h file as it is, here is the CPP file commented version: #include "IntSet.h"#include…
Q: Topical Information Use C++. The purpose of this project is to test your ability to use files,…
A: #include <iostream>using namespace std;//number of spaces in stringint cur_word_len (string…
Q: #include using namespace std; class Player { private: int id; static int next_id; public:…
A: Given, Code: #include <iostream> using namespace std; class Player { private: int id;…
Q: For this lab you need to continue editing lab sheet2 , QuadraticEquatio Class: include…
A: C++ language is a direct descendant of C programming language with additional features such as type…
Q: C++ Define an "Expression" class that manages expression info: operand1 (integer), operand2…
A: The C++ code is given below with output screenshot
Q: Usage: mortgagepmt [-s] -r rate [-d downpayment] price In this assignment, you are asked to do a…
A: Here is the answer below:-
Q: In C++ implement the relational operators (, >=) in the Circle class in the code below, to order the…
A: Your C++ program is given below as you required with an output.
Q: C++ Define an "Expression" class that manages expression info: operand1 (integer), operand2…
A: C++ defines classes and objects. It is more powerful than procedural-oriented programming. C++…
Q: • Function cancelReservation • Parameters: · An object of type HikeList • An object of type…
A: Answer
Q: Considere the following variable. ]: Students_Info={'lloyd' : { "name": "Lloyd", "homework":…
A: In python, function is defined using def keyword. The syntax is, def function_name():…
Q: #include using namespace std; class Player { private: int id; static int next_id; public:…
A: Coded using C++.
Q: Vigenere.h #include using namespace std; //Create class Vigenere class Vigenere { //Members…
A: In C++ we can create the program to encrypt a text using Vigenere Cipher giving message as input and…
Q: Given main(), build a struct called BankAccount that manages checking and savings accounts. The…
A: Define the structure for the BankAccount with customerName, savingsBalance, and checkingBalance as…
Q: Write code to instantiate/create two Bicycle objects: a default object (my_bike) and a non-default…
A: The concept of class, constructors, inheritance, object, and polymorphism is used in the C++…
Q: def report(filename): Write a function report(filename) that consumes a string file and returns the…
A: Given information, It is required to implement the report method that takes and reads a text file…
Q: Write a function report(filename) that consumes a string file and returns the grades of each student…
A: class Coursegrade: ''' Fields: grade(Str) course(Str) Requires: grade in ['4', '5', '6', '7',…
Q: // static const int DEFAULT_CAPACITY = ____ // IntSet::DEFAULT_CAPACITY is the initial…
A: The answer for the above mentioned question is given in the following steps for your reference.
Q: #include using namespace std; class Player { private: int id; static int next_id; public: int…
A: The output of the given program is:- 1 2 3
Q: c++ A FastCritter moves twice as fast as a regular critter. When asked to move by n steps, it…
A: Required fastcritter_Tester.cpp file is provided below along with screenshots.
Q: C++ Coding Help (Operators: new delete) Assign pointer myGas with a new Gas object. Call myGas's…
A: Here a code help solution: Here is a main function: int main() { Gas* myGas = nullptr; /*…
Q: // A likes: Apple, Mango, Orange, // F likes: Grapes, Mango, Lychee, Che // B likes: Plum, Peach,…
A: The code below is to print the fruits liked by each person and determines which person likes most…
Q: Write program in C++ Language The other solutions on chegg were incorrect! Please read carefully!…
A: We need to write a program that defines and tests a class called COP3014. The class has the…
Q: #include using namespace std; class Player { private: int id; static int next_id; public: int…
A: Required: Run the program and give its output.
Q: C++ Define an "Expression" class that manages expression info: operand1 (integer), operand2…
A: #include <iostream>#include <vector>#include <string> using namespace std; class…
Q: def seal_and_dodo(fox, pig): typhoon = [[9],[5]] if pig < len(fox)/2: return typhoon[0] else: return…
A: Given:-
python
>>> feathered_pets=["canary", "parrot", "budgie", "hawk"]
>>> furry_pets=["dog", "cat", "ferret", "hamster", "bunny"]
>>> all_pets=furry_pets+feathered_pets
what will give me the result ["parrot", "canary", "bunny"]
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images
- in phython language Create a package folder named shapes. Inside this package, place two more package folders: 2d and 3d. Inside 2d package, place a module file: circle.py circle.py module has two function definitions: areaCircle(), circCircle(). areaCircle() function takes a parameter: radius, calculates and returns the area of the circle. You may assume PI is 3.14. circCircle() function also takes a parameter: radius, calculates and returns the circumference of the circle. Inside 3d package, place two module files: sphere.py and cylindir.py sphere.py module has two function definitions: areaSphere() and volumeSphere() which both take a parameter for radius, calculates and returns area and volume of a sphere respectively. cylindir.py module has two function definitions: areaCylindir() and volumeCylindir() which both take two parameters: height and radius. They calculate area and volume of a cylindir and return the values respectively. You may find the formulas for those shapes…C++ Question Hello Please answer the attached C++ programming question correctly, just as the prompt states. Also, make sure that the code is working properly. Thank you.C:/Users/r1821655/CLionProjects/untitled/sequence.cpp:48:5: error: return type specification for constructor invalidtemplate <class Item>class sequence{public:// TYPEDEFS and MEMBER SP2020typedef Item value_type;typedef std::size_t size_type;static const size_type CAPACITY = 10;// CONSTRUCTORsequence();// MODIFICATION MEMBER FUNCTIONSvoid start();void end();void advance();void move_back();void add(const value_type& entry);void remove_current();// CONSTANT MEMBER FUNCTIONSsize_type size() const;bool is_item() const;value_type current() const;private:value_type data[CAPACITY];size_type used;size_type current_index;};} 48 | void sequence<Item>::sequence() : used(0), current_index(0) { } | ^~~~ line 47 template<class Item> line 48 void sequence<Item>::sequence() : used(0), current_index(0) { }
- In C++#include <iostream>using namespace std;class Player{private:int id;static int next_id;public:int getID() { return id; }Player() { id = next_id++; }};int Player::next_id = 1;int main(){Player p1;Player p2;Player p3;cout << p1.getID() << " ";cout << p2.getID() << " ";cout << p3.getID();return 0;} Run the program and give its output.// FILE: IntSet.h - header file for IntSet class// CLASS PROVIDED: IntSet (a container class for a set of// int values)//// CONSTANT// static const int MAX_SIZE = ____// IntSet::MAX_SIZE is the highest # of elements an IntSet// can accommodate.//// CONSTRUCTOR// IntSet()// Pre: (none)// Post: The invoking IntSet is initialized to an empty// IntSet (i.e., one containing no relevant elements).//// CONSTANT MEMBER FUNCTIONS (ACCESSORS)// int size() const// Pre: (none)// Post: Number of elements in the invoking IntSet is returned.// bool isEmpty() const// Pre: (none)// Post: True is returned if the invoking IntSet has no relevant// relevant elements, otherwise false is returned.// bool contains(int anInt) const// Pre: (none)// Post: true is returned if the invoking IntSet has anInt as an// element, otherwise false is returned.// bool isSubsetOf(const IntSet& otherIntSet) const//…
- /* Interface File: Movie.h Declaration of Movie Class (Variables - "Data Members" or "Attributes" AND Functions - "Member Functions" or "Methods") */ #ifndef MOVIE_H // Include Guard or Header Guard -If already defined ignore rest of code #define MOVIE_H // Otherwise, define MOVIE_H #include<string> // Note: Not "using namespace std;" or even "using std::string" class Movie { private: std::string title = ""; // Explict scope used --> std::string int year = 0; public: Movie(std::string title = "", int year = 1888); // Declaring a Default Constructor ~Movie(); // A Destructor used for freeing up resources void set_title(std::string title_param); std::string get_title() const; // "const" safeguards class variable changes within function std::string get_title_upper() const; void set_year(int year_param); int get_year() const; }; //…#include <iostream>using namespace std; class Date{ string year, month, day, hour, minute; public: Date(int=1990, int=1, int=1, int=12, int=1); Date(const Date &date); //getters: int getYear(); int getMonth(); int getDay(); int getHour(); int getMinute(); //setters: void setYear(int); void setMonth(int); void setDay(int); void setHour(int); void setMinute(int); //toString. string to_string();};class Player{private: string name; int age, goal;public: Player(string nname = "player", int nage = 25, int ngoal = 0); //getter string getname(); int getage(); int getgoal(); //setter void setname(string nname); void setage(int nage); void setgoal(int ngoale); //toString string to_string(); return 0; }; This is an C++ CODE i want your help to let the code run so if you can make itc++ A FastCritter moves twice as fast as a regular critter. When asked to move by n steps, it actually moves by 2 * n steps. Implement a FastCritter class derived from Critter whose move function behaves as described. Complete the following file: fastcritter_Tester.cpp #include <iostream>using namespace std; #include "critter.h" /**A FastCritter moves twice as fast as a regular critter.*/class FastCritter:public Critter{public:void move(int steps);}; . . . int main(){FastCritter speedy;speedy.move(10);cout << speedy.get_history() << endl;cout << "Expected: [move to 20]" << endl;speedy.move(-1);cout << speedy.get_history() << endl;cout << "Expected: [move to 20, move to 18]" << endl;return 0;} Use the following file: critter.h #ifndef CRITTER_H #define CRITTER_H #include <string> #include <vector> using namespace std; /** A simulated critter. */ class Critter { public: /** Constructs a critter at position 0 with blank…
- / CONSTANT// static const int DEFAULT_CAPACITY = ____// IntSet::DEFAULT_CAPACITY is the initial capacity of an// IntSet that is created by the default constructor (i.e.,// IntSet::DEFAULT_CAPACITY is the highest # of distinct// values "an IntSet created by the default constructor"// can accommodate).//// CONSTRUCTOR// IntSet(int initial_capacity = DEFAULT_CAPACITY)// Post: The invoking IntSet is initialized to an empty// IntSet (i.e., one containing no relevant elements);// the initial capacity is given by initial_capacity if// initial_capacity is >= 1, otherwise it is given by// IntSet:DEFAULT_CAPACITY.// Note: When the IntSet is put to use after construction,// its capacity will be resized as necessary.//// CONSTANT MEMBER FUNCTIONS (ACCESSORS)// int size() const// Pre: (none)// Post: Number of elements in the invoking IntSet is returned.// bool isEmpty() const// Pre: (none)//…C++ Define an "Expression" class that manages expression info: operand1 (integer), operand2 (integer), and the expression operator (char). It must provide at least the following method:- toString() to return a string containing all the expression info such as 50 + 50 = 100 Write a command-driven program named "ListExpressions" that will accept the following commands:add, listall, listbyoperator, listsummary, exit "add" command will read the expression and save it away in the list "listall" command will display all the expressions "listbyoperator" command will read in the operator and display only expressions with that given operator "listsummary" command will display the total number of expressions, the number of expressions for each operator, the largest and smallest expression values "exit" command will exit the program Requirements:- It must be using the array of pointers to Expression objects to manage the list of Expression objects. Please…// CONSTANT// static const int DEFAULT_CAPACITY = __10__// IntSet::DEFAULT_CAPACITY is the initial capacity of an// IntSet that is created by the default constructor (i.e.,// IntSet::DEFAULT_CAPACITY is the highest # of distinct// values "an IntSet created by the default constructor"// can accommodate).//// CONSTRUCTOR// IntSet(int initial_capacity = DEFAULT_CAPACITY)// Post: The invoking IntSet is initialized to an empty// IntSet (i.e., one containing no relevant elements);// the initial capacity is given by initial_capacity if// initial_capacity is >= 1, otherwise it is given by// IntSet:DEFAULT_CAPACITY.// Note: When the IntSet is put to use after construction,// its capacity will be resized as necessary.//// CONSTANT MEMBER FUNCTIONS (ACCESSORS)// int size() const// Pre: (none)// Post: Number of elements in the invoking IntSet is returned.// bool isEmpty() const// Pre: (none)//…