Alpha Geek

(8)

$10/per page/Negotiable

About Alpha Geek

Levels Tought:
University

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Environmental science,Essay writing,Programming,Social Science,Statistics Hide all
Teaching Since: Apr 2017
Last Sign in: 438 Weeks Ago, 2 Days Ago
Questions Answered: 9562
Tutorials Posted: 9559

Education

  • bachelor in business administration
    Polytechnic State University Sanluis
    Jan-2006 - Nov-2010

  • CPA
    Polytechnic State University
    Jan-2012 - Nov-2016

Experience

  • Professor
    Harvard Square Academy (HS2)
    Mar-2012 - Present

Category > Programming Posted 19 Jun 2017 My Price 5.00

Consider a class Time that represents a time of day. It has attributes for the hour and minute

Consider a class Time that represents a time of day. It has attributes for the hour and minute. The hour value ranges from 0 to 23, where the range 0 to 11 represents a time before noon. The minute value ranges from 0 to 59.

a. Write a default constructor that initializes the time to 0 hours, 0 minutes.

b. Write a private method is Valid(hour, minute) that returns true if the given hour and minute values are in the appropriate range.

c. Write a method set Time(hour, minute) that sets the time if the given values are valid

d. Write another method set Time(hour, minute, is AM) that sets the time if the given values are valid. The given hour should be in the range 1 to 12. The parameter is Am is true if the time is an a.m. time and false otherwise.

 

Answers

(8)
Status NEW Posted 19 Jun 2017 12:06 PM My Price 5.00

-----------

Attachments

file 1497874555-Answer.docx preview (230 words )
A-----------nsw-----------er:----------- -----------The----------- fi-----------rst----------- th-----------ing----------- th-----------at -----------nee-----------ds -----------to -----------be -----------don-----------e i-----------s t-----------o d-----------efi-----------ne -----------a c-----------las-----------s a-----------nd -----------dec-----------lar-----------e i-----------ts -----------var-----------iab-----------le -----------of -----------the----------- ho-----------ur -----------and----------- mi-----------nut-----------e o-----------f t-----------ype----------- in-----------t. -----------//D-----------ecl-----------ara-----------tio-----------n o-----------f T-----------ime----------- Cl-----------ass----------- pu-----------bli-----------c c-----------las-----------s T-----------ime----------- { -----------//D-----------ecl-----------ara-----------tio-----------n o-----------f v-----------ari-----------abl-----------es -----------pub-----------lic----------- in-----------t h-----------our-----------; p-----------ubl-----------ic -----------int----------- mi-----------nut-----------e; -----------} a-----------) I-----------n t-----------his----------- pa-----------rt,----------- we----------- ha-----------ve -----------to -----------add----------- a -----------def-----------aul-----------t c-----------ons-----------tru-----------cto-----------r i-----------nsi-----------de -----------the----------- cl-----------ass----------- th-----------at -----------ini-----------tia-----------liz-----------es -----------hou-----------r a-----------nd -----------min-----------ute----------- to----------- 0.----------- //-----------Def-----------aul-----------t c-----------ons-----------tru-----------cto-----------r p-----------ubl-----------ic -----------Tim-----------e()----------- { -----------hou-----------rs=-----------0; -----------min-----------ute-----------s=0-----------; }----------- b)----------- In----------- th-----------is -----------par-----------t,
Not Rated(0)