hi i need your help in these programs using C++ programming language.

1.write a program to enter some numbers and display the count of how many odd and how many even you entered.

2.write a program to store 10 numbers in an array and then display the sum of digits of largest number.

3.write 2 functions: int reverse (int) which returns reverse of a number and int diff(int,int) which returns difference of two numbers. using this write a program to find whether a number given as input is palindrome or not.

4.write a program to input two numbers and print all the numbers within that range. take input from a file and print output to a file.

5. imagine a publishing company that markets both book and audio-cassette versions of its works.create a class publication that stores the title and price of a publication. from this class derive two classes: book, which adds a page count and tape, which adds a playing time in minutes. each of these three classes should have getdata() function to get its data from the user at the keyboard and a putdata() function to display its data. write a main() program to test the book and tape class by creating instances of them, asking the user to fill in their data with getdata() and then displaying the data with putdata().

thank you

Recommended Answers

All 7 Replies

DaniWeb voluntaries help you with 10% of the effort that you show us (and 10% of 0% is not much!) !

no body seems to help :( even 60 views

Nobody is going to do it for you. What tonyjv says is true, you must show some effort before anyone is going to help you. As it stands, you have dumped off a handful of programs with no other explanation. The only way we can interpret that is "do this for me."

Pick one of the problems, make an attempt, and post back with something along the lines of "my program is supposed to do X, when I run it, it does Y, I think the problem is around line Z."

no body seems to help

Your idea of help doesn't correspond to ours. "Help" does not mean "write it for me".

Hey you need the following principles to read then to start with:

1- You Should know the C++ program Structure How it should Look Like:

// Libraries you need:
// define function headers you need:
//function header 1:
int or double function y( int or ... x)
//function header 2
int o double function z( int or double x)
// ....... etc

// now main function starts:
int main()
// Variable list declarations you need:
double v1,v2;

// Start Looping
for( ...............)

Code Lines
//call functions 1
//call function 2

cout<< "print any variable"<< v1;

int function y( int x)
return x*x + 2;
int function z( int x)
return 2*x-1 ;
// end of program

2- You need an algorithm to Find odd and even numbers:
// input your number:
// divide v1 by 2 and check its Remainder = 0 or not
// to decide if it is an odd or even number:
v2= v1/2;
if v2 > 0
codd = codd+1;
if v2 == 0
ceven = ceven+1;
// and so on
3- As for an array of any kind integers , floating point:

// for example do like this to store numbers:
int x[]= {2,3,5,7,8};
double y[]= {2.4,5.6,7.8};
//as a starting point for you ,I hope that I helped you to start doing some thing about your goal in c++.

4- Functions for any purpose Should be used in a similar way I used as in above.
5- Finally You should write your algorithm or flowchart for any problem you want to solve, then try it and compile it to fix the errors with Patience.

I hope you try now and wish you all the best.[/B]

thankx alot mohamads for ur precious support. i will do my best. i had wrote program and i got errors, if u could give me ur email in order to contact to u i will be thankfull.

commented: Bad language, asking email address... -3

Welcome, you can contact me, send me your code pasted in to word 2003 files.

my email : <EMAIL SNIPPED>

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.