Scope Resolution in Programming assignment | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Scope Resolution in Programming assignment

Hi guys! I have a programming assignment due later today. I was able to comprehend most of the code, however the scope resolution and making sure my format is correct has been tough. Here is my code right now, its no where near perfect but its getting there. Homework Question Object-Oriented Programming I Fall 2018 CIS 3100 Programming Assignment 4 For this assignment you are to create a class Time for representing time values. Objects of this class are intended to represent time values that are viewed as consisting of an hour, minute, and second values. The value associated with a Time object can range between 00:00:00 (midnight) and 23:59:59, inclusively. The public interface for this class should consist of the following sets of functions: Constructors: Time(): This function defines a default initial value of 00:00:00 for a Time object. Time(int h, int m, int s): This function initializes a Time object so that its hours is h, its minutes is m, and its seconds is s. The parameters that correspond to the minutes and seconds should be specified with a default value of 0. If an invalid initial value is specified, then the time value should be set to 00:00:00. Access Functions: int getHours() const; Returns the hours value of a Time object. int getMinutes() const; Returns the minutes value of a Time object. int getSeconds() const; Returns the seconds value of a Time object. bool LessThan(Time) const; For two Time objects t1 and t2, t1.LessThan(t2) returns true if t1 is less than, or comes before t2. bool GreaterThan(Time) const; For two Time objects t1 and t2, t1.GreaterThan(t2) returns true if t1 is greater than, or comes after t2. bool EqualTo(Time) const; For two Time objects t1 and t2, t1.EqualTo(t2) returns true if t1 is equal to, or is the same time as t2. Modifier Functions: void setHours(int h); Set the hours of Time object to value specified by h, or 0 if h is invalid. void setMinutes(int m); Set the minutes of Time object to value specified by m, or 0 if m is

20th Nov 2018, 5:01 PM
Amal Mukalel
Amal Mukalel - avatar
1 Answer
20th Nov 2018, 5:57 PM
Babak
Babak - avatar