SHARE
SPREAD
HELP

The Tradition of Sharing

Help your friends and juniors by posting answers to the questions that you know. Also post questions that are not available.


To start with, Sr2Jr’s first step is to reduce the expenses related to education. To achieve this goal Sr2Jr organized the textbook’s question and answers. Sr2Jr is community based and need your support to fill the question and answers. The question and answers posted will be available free of cost to all.

 

#
Authors:
Walter Savitch ,julia Lobur
Chapter:
Separate Compilation And Namespaces
Exercise:
Self-test Exercises
Question:5 | ISBN:9780321531346 | Edition: 7

Question

Suppose you want to change the implementation of the class Digital-

Time given in Displays 12.1 and 12.2. Specifically, you want to change

the way the time is recorded. Instead of using the two private variables

hour and minute, you want to use a single (private) int variable, which

will be called minutes. In this new implementation the private variable

minutes will record the time as the number of minutes since the time

0:00 (that is, since midnight). So 1:30 is recorded as 90 minutes, since it

is 90 minutes past midnight. Describe how you need to change the

interface and implementation files shown in Displays 12.1 and 12.2.

You need not write out the files in their entirety; just indicate what

items you need to change and how, in a very general way, you would

change them.

TextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbook

Sorry the answer is not available at the moment…

If you are able to find the answer, please make sure to post it here. So that your Juniors have smile on their lips and feel happy.

Spread the 'tradition of sharing'.