10 likes | 84 Views
Add the following methods to BpeppsClass :. An overloaded constructor – it should receive no parameters, and assign the number 42 to the age variable. An overloaded abs( ) – receives two numbers as parameters, only returns the absolute value of the smaller number.
E N D
Add the following methods to BpeppsClass: • An overloaded constructor – it should receive no parameters, and assign the number 42 to the age variable. • An overloaded abs( ) – receives two numbers as parameters, only returns the absolute value of the smaller number. • same( ) – receives 2 words as parameters, returns true if they are the same word • An overloaded same( ) – receives one word as a parameter, returns true if the word is “bird” • convertToDecimal( ) – receives a String parameter (which will actually be an 8-bit binary #), converts this number to decimal, and returns it (as an int). • displayGreeting( ) – a private method that just displays “oh hey.” • letterGame( ) – receives no parameters, calls the private method displayGreeting( ), creates a random lowercase letter (hint: easier than it seems), then gives the user 10 chances to guess the letter. Returns nothing.