Question

e fellowing class declaration to answer the questionist below class WeatherStation public emp, double wind, string wind dir, double prediplk void void void int Winda int getTempo double getWindSpeed) : string getWind Direction): double getPrecipitation: void setTemp(int t void setWindData(double w, string dir): void setPrecip(double pl printTempO private int temperature double windSpeed, precipitation string windDir method 14) 14) Refer to the class declaration above. Which of the following methods is an accessor A) int WindChillo: C) WeatherStation: B) void setPrecipO D) double WindSpeed0 15) 15) Refer to the class declaration above. Which of the following methods is a constructor? A) WeatherStationO: C) int WindChillo B) double WindSpeed0: D) void setPrecipo 16) od, that uses the data members to produce a different view of the data than what is stored? A) void setPrecipO: C) double WindDirection0: 16) Refer to the class declaration above. Which of the following method is a mutator (or manipulator) meth B) WeatherStationO: D) int WindChillO: 17) Refer to the class declaration above. The declaration WeatherStation myStation(32, 10,NW) is 17) valid in the main program. Assume the class declaration file has been included in the file containing the main program. B) False A) True 18) Refer to the class declaration above. The statement cin >s yourStation.precipitation is valid in the 18)_ main program, assuming that yourStation has been properly declared as a WeatherStation object. B) False A) True 19) Refer to the class declaration above. It is valid to place the statement temperature-45 in the implementation of WindChillO. B) False A) True
media%2Fe60%2Fe600e70b-2aaf-4ebe-9336-fb
media%2F167%2F167a660e-4c0a-41e9-bc44-f5
0 0
Add a comment Improve this question Transcribed image text
Answer #1

14) double WindSpeed();

15) WeatherStation();

16) A

17) fALSE, there is . no 3 argument coinstructor

18) True

19) True




Other question are not visible.

Add a comment
Know the answer?
Add Answer to:
e fellowing class declaration to answer the questionist below class WeatherStation public emp, double wind, string...
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
  • Consider the following C++ program // class declaration class person public: -person)i person ( ) person...

    Consider the following C++ program // class declaration class person public: -person)i person ( ) person (int age) i int get_age ()i private: int agei hi // class implementation person::-person age1ih person: :person age-1i) person: :person (int val) 1 ageval; > int person::get_age() return agei h int main) person lucky (42)i person group[1017 person fredi // code qoes here [8 points] Which of the following are valid C++ statements that could be compiled and executed in the main function above?...

  • Assuming the following class declaration: class   Course {        private:               string grade_;        &n

    Assuming the following class declaration: class   Course {        private:               string grade_;               int       units_;         public:              Course ( );              Course ( string grade, int units);               ~Course ( );               string get_grade ( ) const ;               int       get_units ( ) const; }; NOTE: Class definitions are not provided but you may assume they're properly defined. Variable names used in your answers must follow our stated naming convention especially for pointer names. Write a fragment of...

  • 4. Command pattern //class Stock public class Stock { private String name; private double price; public...

    4. Command pattern //class Stock public class Stock { private String name; private double price; public Product(String name, double price) { this.name = name; this.price = price; } public void buy(int quantity){ System.out.println(“BOUGHT: “ + quantity + “x “ + this); } public void sell(int quantity){ System.out.println(“SOLD: “ + quantity + “x “ + this); } public String toString() { return “Product [name=” + name + “, price=” + price + “]”; } } a. Create two command classes that...

  • Consider the Tollowing class declaration: class student record public: int age; string name; double gpa; }:...

    Consider the Tollowing class declaration: class student record public: int age; string name; double gpa; }: Implement a void function that initiatizes a dynamic array of student records with the data stored in the file "university body.txt". The function has three formal parameters: the dynamic array "S db, the count, and the capacity. Open and close an ifstream inside the function. Remember, you must allocate memory for the initial size of the dynamic array using "new" inside this function. If...

  • What is the output of the following code? public class Test { pub be static void...

    What is the output of the following code? public class Test { pub be static void main(String() args) { Object o 1 -new Object(); Object o2 = new Object(); System out.print((o1 = o2) + "" + (o1 equals(o2))); } } A. false false B. true true C. false true D. true false Analyze the following code. //Program 1: public class Test { public static void main(String[] args) { Object circle 1 = new Circle(); Object circle2 = new Circle(); System...

  • 7. (10 points=2+2+3+3) Give the class declaration below, class CD Account public: CDAccounto); CDAccount(double bal, double...

    7. (10 points=2+2+3+3) Give the class declaration below, class CD Account public: CDAccounto); CDAccount(double bal, double intRate, int T); double get InterestRate(); double InitialBalance(); double Balance AtMaturityO; int Term(); void input(); void output(); private: double balance; double interestRate; // in PER CENT int term; // months to maturity; Answer the following questions: a. List all the data field names. b. How many methods are there? - c. Write the definition for the accessor method get. InterestRate. d. Write the definition...

  • Consider the following program: # include <iostream> using namesapce std; void Func(int a, int bl double...

    Consider the following program: # include <iostream> using namesapce std; void Func(int a, int bl double number-25.0: int main) f int x-18, y-20; cout<c"Before: x- kex<" and y-eyecendl; Fundxy 1// end of main void Funcfint a, int b) int sum a+b; a-200; b-300; numberanumber+1.0 Which of the statements below are correct? (Select only the correct answers. There may be more than one) D A The statement double number-25.0; declares a global variable number B. The variables x and y are...

  • 1. What is the output when you run printIn()? public static void main(String[] args) { if...

    1. What is the output when you run printIn()? public static void main(String[] args) { if (true) { int num = 1; if (num > 0) { num++; } } int num = 1; addOne(num); num = num - 1 System.out.println(num); } public void addOne(int num) { num = num + 1; } 2. When creating an array for primitive data types, the default values are: a. Numeric type b. Char type c. Boolean type d. String type e. Float...

  • whats the answer When defining a class which has the field name of type String. How...

    whats the answer When defining a class which has the field name of type String. How is the name field declared? String nam name Opublic String name; private name; private String name; Given the following class definition, Which operation can a class user perform on an object of type Restaurant? public class Restaurant // Info about a restaurant // Internal fields public void setName(String restaurant Name) { // Sets the restaurant's name } public void setRating(int user Rating) { //...

  • #include<iostream> #include<string> #include<iomanip> using namespace std; /* ********* Class Car ************* ********************************* */ class Car {...

    #include<iostream> #include<string> #include<iomanip> using namespace std; /* ********* Class Car ************* ********************************* */ class Car { private: string reportingMark; int carNumber; string kind; bool loaded; string choice; string destination; public: Car() { reportingMark = ""; carNumber = 0; kind = "Others"; loaded = 0; destination = "NONE"; } ~Car() { } void setUpCar(string &reportingMark, int &carNumber, string &kind, bool &loaded, string &destination); }; void input(string &reportingMark, int &carNumber, string &kind, bool &loaded,string choice, string &destination); void output(string &reportingMark, int &carNumber,...

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