Create a program that will prompt the user to enter how many random numbers are to be displayed. The random numbers have no limit, meaning to say it can range from negative numbers to positive numbers. Display all the random numbers in a 5 column format. Display the ff,a) The smallest number,b) The largest number,c) The sum of all the random numbers. Identify the following if the sum of the numbers is ODD or EVEN.
1.)If it is EVEN identify if it is DWARF or NOT DWARF. A number is considered dwarf if the sum of its factors is greater than the half of the number.
2.)If it is ODD identify if it is prime or composite. If it turns out to be a composite number, then display the factors of the sum.
The program can also go back from the start . Use statements/structures up to ITERATION/LOOPING STATEMENTS ONLY!!!
- Follow via:
- RSS
- Email Alert
Question
0
Votes
Guys help me!!!pLease....
Tags:
feedback, windows, security, software, career, it management, project management, linux, hardware, networking, programming, e-mail, off-topic, c programming
12th Sep 2010
Answers (4)
0
Votes
oh, really?
And your homework is to be done in which language? C?
Try Mathimatica, or Maplesoft.
Try Mathimatica, or Maplesoft.
12th Sep 2010
Replies
No subtlety either. Straight from the book, grammar and all.
NexS
12th Sep 2010
To me a random number may contain several decimals. But, is 3.7473 an odd or an even number? And how do I factorize that?
TobiF
12th Sep 2010
not as odd as this exercise though.
Got to be pure Maths if it's this impractical...
Got to be pure Maths if it's this impractical...
Tony Hopkinson
12th Sep 2010
No it consists only a whole no. its either negative or positive...example of factoring 9=1,and 3..i hope it helps...please help me do this!oh! my prof. said that we can only use if else,while,looping:do,do while,for and neasted if only...
jhonnel_5
13th Sep 2010
C language...
jhonnel_5
13th Sep 2010
0
Votes
Missed a few lessons have you?
Pity....
Can't write a spec either....
If you happen to think to mention what language and then happen to ask a specific question, maybe you'll get an answer.
We don't do homework. No one did ours for us.
Can't write a spec either....
If you happen to think to mention what language and then happen to ask a specific question, maybe you'll get an answer.
We don't do homework. No one did ours for us.
12th Sep 2010
Replies
my prof said that we can only use if else,while,looping:do,do while,for and nested if statements only..please help me...do this...
jhonnel_5
13th Sep 2010
If I had the time (it would be a fair bit of work this), and the inclination (the exercise is about as interesting as watching milk curdle to me)
You aren't going to learn anything.
As TobiF said start the struggle.
First bit is a
main function
CanExit = false;
While (!CanExit)
//ask for number of random numbers
//print it out for a laugh and to see if you did it right.
//Ask if want to leave if so set CanExit to true.
That's you outer bit done.
Then attack the rest bit by bit.
I've a feeling your prof has limited you to a subset of the language because none of us guys who could do it, would ever bother to put that much donkey work into helping someone.
Effective is all I can say.
You aren't going to learn anything.
As TobiF said start the struggle.
First bit is a
main function
CanExit = false;
While (!CanExit)
//ask for number of random numbers
//print it out for a laugh and to see if you did it right.
//Ask if want to leave if so set CanExit to true.
That's you outer bit done.
Then attack the rest bit by bit.
I've a feeling your prof has limited you to a subset of the language because none of us guys who could do it, would ever bother to put that much donkey work into helping someone.
Effective is all I can say.
Tony Hopkinson
13th Sep 2010
0
Votes
ok, finished
what do you want me to do now?
12th Sep 2010
Replies
for him. Then brag at your score compared to his, non-existent score.
NexS
12th Sep 2010
I'm still struggling to represent a total of my 'unlimited' numbers represented in BCD streams when they get to 8 billion digits....
How did you get round infinity having an infinite number of factors anyway. Could be Cantor's rubber room soon.
How did you get round infinity having an infinite number of factors anyway. Could be Cantor's rubber room soon.
Tony Hopkinson
13th Sep 2010
my prof said that we can only use if else,while,looping:do,do while,for,and nested if statements only please help me...
jhonnel_5
13th Sep 2010
0
Votes
Some good, and some good...
Good 1:
It's good that you're honest about this actually being a school assignment.
Good 2:
It's good nobody here will do this for you, since you need to figure this out yourself. That's why you went to this school, right?
Good 3:
Now, sincerely give this a shot. It's not impossible, but not totally trivial, either.
Hints:
Try to break the task down into reasonable chunks and place them in separate functions.
While testing each function, use a testing "main" which will just call the function and display the answer.
It's good that you're honest about this actually being a school assignment.
Good 2:
It's good nobody here will do this for you, since you need to figure this out yourself. That's why you went to this school, right?
Good 3:
Now, sincerely give this a shot. It's not impossible, but not totally trivial, either.
Hints:
Try to break the task down into reasonable chunks and place them in separate functions.
While testing each function, use a testing "main" which will just call the function and display the answer.
13th Sep 2010

































