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
Objectives: The objective of this assignment is to use C++ to queue students into an array-based queue for BCS registration. Students have the option of taking five different cours



program to convert string from super ascii string with minimum cost

The game of hangman may have originated in the Victorian era, and involves trying to guess a word by suggesting letters. The game is played as follows: A word is chosen and the pl


Consider the following algorithm to generate a sequence of numbers. Start with an integer n. If n is even, divide by 2. If n is odd, multiply by 3 and add 1. Repeat this process wi

hwat is the area fsdjlakl;aeklfjtealrtl;gka


Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec