Computes the amount of postage count even or odd, C/C++ Programming

(a) Write a procedure (count-even n) that counts the number of even digits in the decimal representation of the number n. For example, (count-even 234) should return 2.

(b) Write a procedure (postage wt) that computes the amount of postage to be included on a letter given its weight, wt. Use the following rules:
Less than 30 grams, 15 cents
30 to 49 grams, 17 cents
50 to 99 grams, 22 cents
100 and over grams, 1 cent for each 4 grams.

(c) The specification for (b) has a problem of ambiguity. What is it and what does your procedure do regarding the problem?

 

Posted Date: 3/25/2013 1:49:07 AM | Location : United States







Related Discussions:- Computes the amount of postage count even or odd, Assignment Help, Ask Question on Computes the amount of postage count even or odd, Get Answer, Expert's Help, Computes the amount of postage count even or odd Discussions

Write discussion on Computes the amount of postage count even or odd
Your posts are moderated
Related Questions
Q: Name the operators which cannot be overloaded? A:sizeof, ., .*, .->, ::, ?:

Program is to search for a given character in a string: Program is to search for a given character in a string and print point of match char *stsearch(char *string, char sea

Program is to define a class as employee: Write a program to define a class as employee and collect information about them by using classes and object class employee   {

why c is middle level language?

3 kilograms of peebles are needed for converting an area of 1 square meter.the rate of the peeble is 5 per kilogram

Problem: (a) Using a class hierarchy of your own choosing, with at least TWO subclass levels, show (i) the use of abstract and concrete forms of Java class and method in you

Write a function that takes an array as the argument and returns the second largest element. Bonus (+5): Write a function that takes an array and a number n as arguments and return

Write a C++ program that reads from keyboard 3 integers, with proper input prompt, and then displays the maximum sum of any pair of numbers from these three. If the 3 numbers are 5

Define Character Input and Output with Files? This is done by using equivalents of putchar and getchar which are called putc and getc. Each one takes an extra argument which id

I Want a answer for solving the big M method in the topic of simplex method...