Design a Clock program in C

Updated on technology 2024-03-12
9 answers
  1. Anonymous users2024-02-06

    C++, just refer to the ctime library file directly, in addition to settime, which is difficult to handle, of course, if this can be used API, it's just a line of **. If you don't use API, it's a bit more troublesome!

  2. Anonymous users2024-02-05

    #include using namespace std;class time һ void next() else if(hour<23) else hour=0; } get time int get() clock class clockwhile(1); int main()

  3. Anonymous users2024-02-04

    class clock void clock::setalarm(int hour,int minute,int second) void clock::increamenthour() void clock::

    InCreamEntMinute() Void Clock::InCreamEntSecond() Void Clock::Run(int hour,int minute,int second) Just started to work, just had time, and wrote the constructor by itself, hehe.

  4. Anonymous users2024-02-03

    Just keep an eye out for error messages.

    #include

    using namespace std;

    class clock

    void sethour()

    void setminute()

    void setsecond()

    void show()

    The int gethour() return type is intint getminute().

    int getsecond()

    private:

    int hour,minute,second;

    void main() should be main

  5. Anonymous users2024-02-02

    void sethour()

    void setminute()

    void setsecond()

    It's not reasonable to write, and generally don't use standard input in the class, I think the meaning of dynamically setting hours, minutes, and seconds is to update the displayed content immediately after setting, that is, call the show method.

    void sethour(int h)

  6. Anonymous users2024-02-01

    You have to write it yourself and judge the realization of this carrying.

  7. Anonymous users2024-01-31

    It's still relatively easy to write this class, but it also takes time. Your question is not like asking for help, it's asking for help. Then you'll probably have to get paid to write this class, haha.

  8. Anonymous users2024-01-30

    #include

    using namespace std;

    It has three member functions.

    class cmytime

    void show()

    1. For illegal assignment, the legal range of the three parameters is: 0<=h<=23, 0<=m, s<=60. If the parameter is invalid, the set function does not change the original value.

    2. If the assignment is successful, 1 will be returned, otherwise 0 will be returned.

    int set(int h, int m, int s)else

    The time value of 1 second is added to the original time.

    void addonesecond()

    protected:

    int h;

    int m;

    int s;

    int main()

  9. Anonymous users2024-01-29

    What does it mean to set the prefix plus and post subtract unary operator overload to find the difference between two clock objects? Want 3 functions? ++time, time--, and time-time?

Related questions
11 answers2024-03-12

It's not interesting, it's just that there's these members and methods in this category.

3 answers2024-03-12

3. All include

using namespace std; >>>More

19 answers2024-03-12

Write in the click of button1; Then write using system in the main function; >>>More

5 answers2024-03-12

Let's talk about my thoughts, first of all, if you start from a learning point of view, you don't have to start with a software copy based on the current GPU architecture and concepts. Current GPUs are mainly based on triangular rasterization and Z-buffer. >>>More