Write header lines (also known as prototypes) for the following functions. C++ Help? Hi, i need some C++ hel?
-
Write header lines (also known as prototypes) for the following functions. C++ Help? Hi, i need some C++ help on functions, . Do not supply the blocks for the functions. 1. A function called lastChars which uses a string as input and returns the last two characters in the string. 2. A function called isSquare that responds to its caller the result of a test: the test is whether or not an integer is a perfect square. (For example, 16 is a perfect square, but 5 is not.) 3. A function called sumDigits which returns the sum of the digits of an integer. 4. A function called isSmall that returns an answer of true if a double precision parameter has a value between 0 and 0.001. (It returns false otherwise.) 5. A function called randomColor. The function generates a random number and based on that number chooses a color. The color is returned. 6. The following C++ program applies five different functions. Write header lines (prototypes) for the five functions. Do not supply the blocks for the functions. int main () { int x, c; double r; x = readData (); for (c = 0; c < 5; c++) printValues (x, r + 1); x = adjust (x + 2); r = max3 (x, c, 10); return fun (x + c, x - c); i did a few of them such as... string lastChars (stringstr) another one i did is int readData() another one is void printValues () <<not sure about this one and the rest above, can someone please help? thank you!
-
Answer:
1. A function called lastChars which uses a string as input and returns the last two characters in the string. strint lastChars(string); 2. A function called isSquare that responds to its caller the result of a test: the test is whether or not an integer is a perfect square. (For example, 16 is a perfect square, but 5 is not.) bool isSquare(int); 3. A function called sumDigits which returns the sum of the digits of an integer. int sumDigits(int); 4. A function called isSmall that returns an answer of true if a double precision parameter has a value between 0 and 0.001. (It returns false otherwise.) bool isSmall(double); 5. A function called randomColor. The function generates a random number and based on that number chooses a color. The color is returned. int randomColor(void); 6. The following C++ program applies five different functions. Write header lines (prototypes) for the five functions. Do not supply the blocks for the functions. int readData (void); void printValues (int, double); int adjust (int); double max3 (int,int,int); int fun (int,int); int main () { int x, c; double r; x = readData (); for (c = 0; c < 5; c++) printValues (x, r + 1); x = adjust (x + 2); r = max3 (x, c, 10); return fun (x + c, x - c);
Matt lEviews at Yahoo! Answers Visit the source
Related Q & A:
- I need help on what I need to buy or do.Best solution by Yahoo! Answers
- I need help with some horse questions, can you help me.Best solution by Yahoo! Answers
- What Do I Need To Burn My Movies In Hi Def?Best solution by Yahoo! Answers
- If I wanted to write to Oprah Winfrey what address would I need to write to?Best solution by wikihow.com
- Hi i was hoping someone could help me with my problem?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.