الأربعاء، 13 أبريل 2016

هل يمكنكم مساعدتي في فهم هاذا السؤال ولم أستطيع

السلام عليكم ورحمة الله وبركاته

لدي هذا السؤال ولم أستطيع فهمه

بحيث يكون حله بلغة ++c

هذا هو السؤال :

"Create a class named Time that contains integer fields for hours and minutes.

Store thehours in military time, that is, 0 through 23. Add a function that displays

the fields, usinga colon to separate hours and minutes. (Make sure the minutes

display as two digits. For example, 3 o'clock should display as 3:00, not 3: 0.) Addanother function that takes an argument that represents minutes to add to the

time. The function updates the time based on the number of minutes added. For

example, 12:30 plus 15 is 12:45, 14:50 plus 20 is 15:10, and 23:59 plus 2 is 0:01.

The Time constructor requires an argument for hours. The argument for minutes is

optional A; the value defaults to 0 if no argument is supplied. The constructor

ensures that the hours field is not greater than 23 and that the minutes field is not

greater than 59; default to these maximum values ​​if the arguments to the

constructor are out of range. Create a main () function that instantiates an array of

at least four Time objects and demonstrates that they display correctly both before

and after varying amounts of time have been added to them



from حسوب I/O - الأكثر شيوعاً http://ift.tt/1SMDRO1

ليست هناك تعليقات:

إرسال تعليق

دائماً، رأيكم يهمنا،