1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Vladimir79 [104]
1 year ago
12

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 clocktype by adding a member variable to store the time zone called timezone. 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 a test program to test your class.
Computers and Technology
1 answer:
Ivan1 year ago
5 0

A program to test your class is given below:

<h3>The Program</h3>

#include <iostream>

class clockType

{

public:

void set_hour(int h);

int get_hour();

void set_minut(int m);

int get_minut();

void set_second(int s);

int get_second();

clockType() {};

clockType(int h,int m,int s)

{

 h = ((h < 0) ? 0 : (h > 23) ? 23 : h);

m = ((m < 0) ? 0 : ( m> 59) ? 59 : m);

 s = ((s< 0) ? 0 : (s > 59) ? 59 : s);

 hour = h;

 minut = m;

 second = s;

}

private:

int hour{ 0 };

int minut{ 0 };

int second{ 0 };

};

inline void clockType::set_hour(int h)

{

h = ((h < 0) ? 0 : (h > 23) ? 23 : h);

hour = h;

}

inline void clockType::set_minut(int m)

{

m = ((m < 0) ? 0 : (m > 59) ? 59 : m);

minut = m;

}

inline void clockType::set_second(int s)

{

s = ((s < 0) ? 0 : (s > 59) ? 59 : s);

second = s;

}

inline int clockType::get_minut()

{

return minut;

}

inline int clockType::get_second()

{

return second;

}

inline int clockType::get_hour()

{

return hour;

}

int main()

{

// example test program

// set time 22:54:12

clockType test(22, 54, 12);

std::cout << "Set time :" << test.get_hour() << "h" << test.get_minut() << "m" << test.get_second() << "s" << std::endl;

// set time 18:18:54

test.set_hour(18);

test.set_minut(18);

test.set_second(54);

std::cout << "Set time :" << test.get_hour() << "h" << test.get_minut() << "m" << test.get_second() << "s" << std::endl;

system("pause");

return 0;

}

Read more about programming here:

brainly.com/question/23275071

#SPJ1

You might be interested in
WHAT DOES INFORMATION TECHNOLOGY DO??<br> Do they offer services or products
notsponge [240]
Yes

Explanation: Information technology, or IT, describes any technology that powers or enables the storage, processing and information flow within an organization. Anything involved with computers, software, networks, intranets, Web sites, servers, databases and telecommunications falls under the IT umbrella.
4 0
2 years ago
Select the correct answer from each drop-down menu. Which IF formulas are valid? _____ and _____ are valid IF formulas.
Lyrx [107]

Answer:

=IF(D3>50; E3; F3) AND =IF(A1>60;"Pass";"Fail")

Explanation:

An IF structure is built following this pattern:

IF(TEST;IFTRUE;IFFALSE)

These are the only options in the given drop-down menus what comply with this pattern.  All others are not following this pattern.

The computer will do the test and if the result is true will apply the IFTRUE value, otherwise will apply the IFFALSE value.

4 0
3 years ago
Is the wireless network you own as secure as it should be? Examine your wireless network or that of a friend or neighbor and det
AleksandrR [38]

Answer:

See explaination

Explanation:

Wireless Security:

In a bid to examine the network you can use ipconfig /all command in windows or in the event where you are a linux user type in ifconfig to view all the configuration details of your network such as

indows IP Configuration

Host Name . . . . . . . . . . . . : myvpc-hb

Primary Dns Suffix . . . . . . . : example.com

Node Type . . . . . . . . . . . . : Hybrid

IP Routing Enabled. . . . . . . : Yes

Ethernet adapter Local Area Connection:- - - - - -

Connection-specific DNS Suffix . :- - - - - -

Description . . . . . . . . . . : Intel 68540-Based PCI Express Fast Ethernet Adapter

Physical Address. . . . . . . . . : 00-03-AA-BC-CA-8F

Autoconfiguration Enabled . . . . : Yes

Link-local IPv6 Address . . . . . : fe65::ab56:ccb9:320c:524d%8(Preferred)

IPv4 Address. . . . . . . . . . . : 192.168.45.111(Preferred)

Default Gateway . . . . . . . . . : 192.168.15.1

DHCP Server . . . . . . . . . . . : 192.168.15.1

DHCPv6 IAID . . . . . . . . . . . : 201327615

Note: If you want to deeply examine the your network and to find security model go with Wireshark application.It will help you to capture the data packets easily using GUI.Also it will provide other details like transmission control protocols,etc.

To take your network to highest level i.e. to make it more secure you can use:

1.Firewalls like application gateways,packet filtering,hybrid systems.

2.Crypto cable routers

3.Virtual private networks, etc.

Estimation of cost and the time to increase the level is solely depends on the type of the architecture you want to use for the network building structure.Also the size of the network will be responsible for the cost and time.

In case of any attack on your computer it depends on the size of the data on the computer disc and the bandwidth of the network to which your computer is connected to replace all data. The faster the bandwidth of the network,faster the data replacement rate.

3 0
2 years ago
How many times do you need to click the Format Painter button to apply copied formats to multiple paragraphs one right after the
const2013 [10]

The answer is (A) Twice

Format painter is that icon tool that looks like a paintbrush that is used to pick up formatting of an existing text and then paints it on the next text you select. If you wish to apply the formatting to more than one element, you should double-click the format painter and press esc key to deactivate.


5 0
3 years ago
Read 2 more answers
Cell styles can only be applied to the first five columns of a worksheet.<br> a.true<br> b.false
andreyandreev [35.5K]
The correct answer is A true! 
6 0
3 years ago
Read 2 more answers
Other questions:
  • How is IT related to new business initiatives?
    6·1 answer
  • .All of the following are true with the respect to implicitinvocation except:
    8·1 answer
  • Ternary operators of computer<br><br>please explain. ​
    15·1 answer
  • What are the basic tools for coding HTML manually?
    10·2 answers
  • What is the name of the interface that uses graphics as compared to a command-driven interface?
    11·1 answer
  • There are many different types of documents that are used to convey information in the business world-letters and
    12·1 answer
  • What is an Apple Pen?
    5·2 answers
  • What behaviors are most common in a successful entrepreneurship
    9·1 answer
  • A debate about city schools are more better than village schools​
    8·1 answer
  • Write the use of these computers.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!