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 is a digital certificate? Select one: a. It is a means of establishing the validity of an offer from a person, entity, web
a_sh-v [17]

Option D is the answer because Digital Certificate is an entity that generates electronic and distributes them upon proving their identity sufficiently. In early days there was issues with people using the certificates that were not even issued by the organizations. Today it's a cryptographic technique which uses digital signatures and gives users a digital certificate that can be authenticated anytime online by any organization and is unique for every user having it.

Option A cannot be the answer because it has nothing to do with the identity of person but rather it is for specific fields.

Option B is not answer because it has no key and score matter to do with it.

Option C Web transactions has nothing to do with the certificates.

8 0
3 years ago
Which comparison operator is valid for greater than or equal to?<br><br> &gt;<br> &gt;=<br> =&gt;
lys-0071 [83]
The second one, it should be the one that is opening left with a line underneath, the images are unclear but that’s the most likely correct answer !
3 0
3 years ago
What are the names of the components (each shown with a leader and a line) of a circuit shown in the diagram?
Goryan [66]

Answer:

The name of the components of the given labelled circuit is:

The box like figure in the given image is the battery source from where the current drawn into the circuit.

A string connecting positive terminal of battery to the bulb is an electric wire through which current flows in the circuit.

A bubble like object in the circuit is a bulb which lights up when current moves through the circuit.

A component connected to the negative terminal of batter source is a switch.

Then open circuit is an open as the key of the switch is open.

8 0
2 years ago
In two to three paragraphs, come up with a way that you could incorporate the most technologically advanced gaming into your onl
Marina CMI [18]

nobody cares about plagiarism dude

7 0
3 years ago
2. A data catalog identifies all of the following, except: a. Attribute data type b. Attribute range of values c. Attribute cons
alexandr1967 [171]

Answer:

c. Attribute constraints

Explanation:

A data catalog identifies all of the following, except: "Attribute constraints"

The above statement is TRUE because a Data Catalog, a metadata management service, operates by searching for key data, understand and manage data for usefulness.

Data Catalog checks on the BigQuery datasets, tables, and views and checks both technical and business metadata by identifying the following attributes:

1. Data type

2. Range of values

3. Value for Instructor ID

5 0
2 years ago
Other questions:
  • You have installed a streaming video service on your network. You want selected hosts to be able to access this service via a dy
    6·1 answer
  • One of the major advantages of digital photography is the ability to see the shot as soon as you take it.
    13·1 answer
  • Forms often allow a user to enter an integer. Write a program that takes in a string representing an integer as input, and outpu
    9·1 answer
  • ( Game Design) The companies who get video games out to consumers are called:
    12·1 answer
  • The acceleration of a body is 3 metre per second square what does it mean​
    11·2 answers
  • During the _____ of the systems development life cycle (SDLC), an information system is operating, enhancements and modification
    9·1 answer
  • Able to make a survey form using VB (Visual basics 6.0) to represent ways of conservation of
    8·2 answers
  • How do you change your grade level
    10·1 answer
  • The way a student prepares for a test or reviews academic material is referred to as
    8·2 answers
  • The purpose of Appetizers on the menu​
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!