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
A: In C++ the access privileges are public, private and protected. The default access level assigned to members of a class is private. Private members of any class are accessible o

basic salary of employees & calculate net salary in C++ Programming

Project Description: We want an EXPERT CODER to help us create an 'audio engine' in C#. We want to be able to specify an input of a wave/MP3 file, and have the engine manipul

//Create a custom calculator program capable of reading the input stream of an expression //and make basic computations to provide answer. //Your program will ask the user to

Can you think of a condition where your program would crash without attaining the breakball, which you set at the straining of main()? A: C++ let for dynamic initialization of g

1. Jewels can only be removed for polishing from either end of the necklace (i.e. head or tail) 2. Once a jewel type is removed from the necklace, all other instances of the same j

The Preprocessor Directives A preprocessor directive which starts with a hash '#' ,is an instruction to the preprocessor, which acts on the source code before the compilation p

Write a c++ program to find the sum of 0.123 ??103 and 0.456 ??102 and write the result in three significant digits

Task Your task is to write a program, words, that reports information about the number of words read from its standard input. For example, if the file qbf.txtcontains the text th

Object Oriented Programming Paradigm: For OOP, Paradigm is a standard set.  The OOP will help to develop software in modules, which will be integrated later as a full packag