Question

Cloekt Cloek ( int, int, int) etTire(int, int, intjt void getHour printTime voia int int teqran le (Clock)boolean 46. According to the UML class diagram above, which of the following is a. ClockO _ data member c. min d. Clock b. According to the UML class diagram above, which method is pablic and doesnt return anything? a getCopyO b. setTime(int, int, int) which ofthe following would be a default constructor ior he ein. Click does is te ips bro a. public ClockOf setTime(0, 0,0;:) b. public Clock(0, 0, 0) ( setTimeO: ) c. public Clock(0)setTime(0) d. private Clock(10)f setTime0: ) Constructors have the same name as the a. member methods b. data members 47. c. equals(Clock) d. incrementFloursO 48, 49. c. class d. package 50. Which of the following is used to allocate memory for the instance variables of an obiject of a class? the operator new the operator + c、 a- b· the reserved word public the reserved word static d.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:

46. Option c (min)

In class diagram, the class has three parts i) class name ii) attributes (data members) iii) operations (member functions)

The second part has attributes or members of the class. So, 'min' is one of the data members of the class Clock.

47. Option b (setTime(int,int,int))

Any method which doesn't return anything is 'void' type.

In the given options, setTime(int,int,int):void means setTime(int,int,int) returns nothing.

48. option a (public Clock() { setTime(0,0,0);}

49. Option c (class)

Constructors have same name as the class

50. Option c (the operator new)

new operator is used to allocate the memory for instance variables of objects of a class.

Add a comment
Know the answer?
Add Answer to:
Cloekt Cloek ( int, int, int) etTire(int, int, intjt void getHour printTime voia int int teqran...
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
  • D Question 6 4 pts Figure 1: clock Type |-hr: int -min: int -sec; int setTime...

    D Question 6 4 pts Figure 1: clock Type |-hr: int -min: int -sec; int setTime (int, int, int): void get Time (inte, int&, int&) const: void printTime() const: void increment seconds(): int +incrementMinutes(): int +increment Hours(): int -equalTime (const clockType.) const: bool Consider the UML class diagram shown in the accompanying figure. According to the UML class diagram, how many private members are in the class? none zero two three D Question 4 4 pts Consider the following class...

  • [Java] We have learned the class Clock, which was designed to implement the time of day...

    [Java] We have learned the class Clock, which was designed to implement the time of day in a program. Certain application in addition to hours, minutes, and seconds might require you to store the time zone. Please do the following: Derive the class ExtClock from the class Clock by adding a data member to store the time zone. Add necessary methods and constructors to make the class functional. Also write the definitions of the methods and constructors. Write a test...

  • C++ class Time { public: Time(); Time(int hrs, int min, int sec); private: int hours; int...

    C++ class Time { public: Time(); Time(int hrs, int min, int sec); private: int hours; int minutes; int seconds; }; 1. Write the class definition for ExtendedTime which derives from Time via public inheritance. Add private data member time_zone which is an enum type TimeZone (enum TimeZone { PACIFIC, MOUNTAIN, CENTRAL, EASTERN } ). Add a default and alternate constructors to ExtendedTime to initialize all class (including the base class) data; use the base member initialization list. NOTE: This implies...

  • C++ Please! Given this definition of a Time class: class Time { private: int hour, min,...

    C++ Please! Given this definition of a Time class: class Time { private: int hour, min, sec; public: Time() { hour = 0; min = 0; sec = 0; } Time(int h, int m, int s) {      hour = h; min = m; sec = s; } int getHour() const {     return hour; } int getMin() const {     return minute; } int getSec() const {     return sec; } }; Derive a class MilTime from the Time...

  • Write in C++ please In Chapter 10, the class clockType was designed to implement the time...

    Write in C++ please In Chapter 10, the class clockType was designed to implement the time of day in a program. Certain applications, in addition to hours, minutes, and seconds, might require you to store the time zone. Derive the class extClockType from the class clockTypeby adding a member variable to store the time zone. Add the necessary member functions and constructors to make the class functional. Also, write the definitions of the member functions and the constructors. Finally, write...

  • which is incorrect? struct myStruct { int i; double d; }; class myClass { public: int...

    which is incorrect? struct myStruct { int i; double d; }; class myClass { public: int i; double d; }; myStruct a; a.i = 3; myClass b; b.i = 3; a) All these statements will compile with no problem. b) A structure member is accessed using the index operator [ ], with the member name as index. [ ] c) A class is a type similar to a structure type that normally has member functions as well as member variables....

  • void card:: setNum(int n) { assert(n >= 1 && n <= 13); num = n; }...

    void card:: setNum(int n) { assert(n >= 1 && n <= 13); num = n; } void card::setSuit(char s) { assert(s == 'C' || s == 'D' || s == 'H' || s == 'S'); suit = s; } int card::getNum() { assert(num >= 1 && num <= 13); return num; } char card::getSuit() { assert(suit == 'C' || suit == 'D' || suit == 'H' || suit == 'S'); return suit; } string card:: read() { string output=""; if...

  • 4. class Person { 2} public void printValue(int i, int j) {/*…*/ } 3} public void...

    4. class Person { 2} public void printValue(int i, int j) {/*…*/ } 3} public void printValue(int i){/*...*/ } 4} } 5) public class Teacher extends Person { 6} public void printValue() {/*...*/ } 7} public void printValue(int i) {/*...*/} 8} public static void main(String args[]){ 9} Person t = new Teacher(); 10} t.printValue(10); 11} } 12} } Which method will the statement on line 10 call? A. on line 2 B. on line 3 C. on line 6 D....

  • c++ question 1. C++ string Class What does the output look like after executing the following...

    c++ question 1. C++ string Class What does the output look like after executing the following statements? std::string numstr = "12"; numstr += "3"; std::cout << numstr << '\n'; A. None of these. B. The snippet has syntax errors. C. 15 D.123 // 2. Let S be a class that allows integers to be stored in its objects like an array. For example, if obj is an object of S, one can write statements like obj[0] = 100; or int...

  • looking for a UML diagram for this program in cpp a. Member variables and member functions...

    looking for a UML diagram for this program in cpp a. Member variables and member functions b. Access specifiers for all member variables and member functions C. Data types for all member variables d. Data types for all parameters e. Return types for all member functions, constructors, and destructors class Account { private: double balance; // Account balance double interest Rate; // Interest rate for the period double interest; // Interest earned for the period int transactions; // Number of...

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