Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please HELP! Question 1 1 pts While a class can only have one default constructor (more would be a compiler error), which of the following

Please HELP!

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Question 1 1 pts While a class can only have one default constructor (more would be a compiler error), which of the following COULD be a default constructor for a class called Spaceship? Mark all that apply Spaceship(float cost, string name, float weight); Spaceship(int serialNumber, bool moving Spaceship = true); Spaceship(string name = "Spaceship", float weight = 0.0f); Spaceshipo: Question 2 1 pts A class function could be used a number of times, by a number of different instances of that class. In a class member function, how would you access the object that has called the function? O that this. that-> O thisThingHere-> O this-> Question 3 1 pts Class variables are by default. O public private O protected Question 4 1 pts Given a class called Widget, which of the following are valid constructors? Mark all that apply Widget(float x, double y, unsigned int num = 0); Widget(); Widget(int x); void Widget(int x); int Widget(); Question 5 1 pts Given the following code: // If the boss is at half health... if (bossMonster.GetHitpoints() stuffieldByContainer; public: Container(); void AddThingtocontainer(int thingtoAdd); int NumberOfElementstored(); bool IsEmpty(); void EmptyContainer(); }; class structure class definition class declaration class creation Question 14 3 pts Given the following code: #include #include using namespace std; class Student { public: void setName(string studentName); void Setscore(int studentscore); string GetGrade(); private: string name; int score; }; void student::Setscore(int studentscore) score = studentscore; } string Student::GetGrade { string grade; if (score (40) grade = "C"; else if (score using namespace std; class Greet public: GreetO; }; Greet::Greet) cout

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

What exactly does a Ruby ensure clause do?

Answered: 1 week ago