Web Development
Define a derived class , ApartmentBuilding that contains four (4) data members: an integer named numFloors, an integer named unitsPerFloor, a boolean named hasElevator, and a boolean named hasCentralAir. There is a constructor containing parameters for the initialization of the above variables (in the same order as they appear above).
LANGUAGE: C++ CHALLENGE: Assume the existence of a Building class . Define a derived class , ApartmentBuilding that contains four (4) data members: an integer named numFloors, an integer named unitsPerFloor, a boolean named hasElevator, and a boolean named hasCentralAir. There is a constructor containing parameters for the initialization of the above variables (in the same order…
Read MoreDefine a derived class , CameraPhone that contains two data members: an integer named , imageSize, representing the size in megapixels of each picture, and an integer named memorySize, representing the number of gigabytes in the camera’s memory.
LANGUAGE: C++ CHALLENGE: Assume the existence of a Phone class . Define a derived class , CameraPhone that contains two data members: an integer named , imageSize, representing the size in megapixels of each picture, and an integer named memorySize, representing the number of gigabytes in the camera’s memory. There is a constructor that accepts two integer parameters …
Read MoreWrite a recursive, bool-valued function, isPalindrome that accepts a string and returns whether the string is a palindrome.
LANGUAGE: C++ CHALLENGE: A palindrome is a string that reads the same forwards or backwards; for example dad, mom, deed (i.e., reversing a palindrome produces the same string ). Write a recursive, bool-valued function, isPalindrome that accepts a string and returns whether the string is a palindrome.
Read MoreWrite a recursive, bool-valued function, containsVowel, that accepts a string and returns true if the string contains a vowel.
LANGUAGE: C++ CHALLENGE: Write a recursive, bool-valued function, containsVowel, that accepts a string and returns true if the string contains a vowel. A string contains a vowel if: The first character of the string is a vowel, or The rest of the string (beyond the first character ) contains a vowel
Read MoreAssume the existence of a BankAccount class . Define a derived class , SavingsAccount that contains two instance variables : the first a double , named interestRate, and the second an integer named interestType.
LANGUAGE: C++ CHALLENGE: Assume the existence of a BankAccount class . Define a derived class , SavingsAccount that contains two instance variables : the first a double , named interestRate, and the second an integer named interestType. The value of the type variable can be 1 for simple interest and 2 for compound interest. There is also a constructor …
Read MoreWrite the definition of a function called product.
LANGUAGE: C++ CHALLENGE: Write the definition of a function called product . The function receives two int parameters. You may assume that neither parameter is negative. The function returns the product of the parameters . So, product (3,5) returns 15 and product (30,4) returns 120. The function must not use a loop of any kind…
Read MoreWrite a function called fact that recursively calculates the factorial value of its single int parameter.
LANGUAGE: C++ CHALLENGE: Write a function called fact that recursively calculates the factorial value of its single int parameter. The value returned by fact is a long ..
Read MoreHow to add a new Member Page to Buddy Press
Platform: BuddyPress In Buddy Press each directory under the members/single directory is known as a component and can be very frustrating to customize. I recently had to add several new components to a theme and thought I should post the resulting snippet for others looking to modify their theme.
Read MoreHow to print out global $bp variable to screen
Platform: BuddyPress CHALLENGE: Working with BuddyPress can be one interesting adventure. When diving into this jungle I prefer to have all of the tools I can gather before hand. One of the handiest tools I have found is this little snippet that prints the $bp global to the screen so the developer can read first hand…
Read MoreRead two text files into arrays and query the arrays for boy and girl names
LANGUAGE: C++ CHALLENGE: Read in boynames.txt and girlnames.txt into separate arrays and search by the user entered boy name or girl name. The most popular names are listed first and the least popular names are listed last. write a program that allows the user to input a name. The program should then read from the…
Read MoreRead in string and evaluate for word count and letter occurrences
LANGUAGE: C++ CHALLENGE: Write a program that will read in a line of text and output the number of words in the line and the number of occurrences of each letter. Define a word to be any string of letters that is delimited at each end by either a whitespace, a period, a comma, or the…
Read MoreSQL – Get all records entered this week
For developers who do not regularly program in SQL, there is a constant need for handy tips that help to ease the pain of accomplishing what they need. I work in MSSQL regularly but am no means a 10, if you know what I mean. That is why I thought I would create this category…
Read More