四道 C++ 程序代写

Problem #1 (25 points)

Note that no global variables and data are allowed. All methods (as if you need them) must be

written explicitly and no library/package methods are allowed.

1. Write a function named as extractMostSeenEvenDigitProblem1YourName(),

which will

i. Receive an integer as argument; and

ii. Search and display the digits as shown in the output below; and

iii. Return the digit that has the largest occurrence.

1. A sample a program with main() would produce the sample output below – Your code must

take care of other possible output scenarios as well.

*********************************************************

* MENU *

* 1. Calling extractMostSeenEvenDigitProblem1YourName() *

* 2. Quit *

*********************************************************

Select an option (1 or 2): 1

Enter an integer: 302480443

Calling displayDigitProblem1YourName() –

There is/are 9 digit(s) with 4 even digit(s).

With the 4 even digits,

4 occurs 3 time(s)

0 occurs 2 time(s)

2 occurs 1 time(s)

8 occurs 1 t

Leave a Reply

Your email address will not be published. Required fields are marked *