0

Not Yet Answered # Help me with "Math Library" Related coding =)

Hey, I am in a beginning C++/C# Class and we are jsut starting the Math LIbrary. I need to write a program that displays all perfect integers up to 100. I am required to write a boolean function, IsPerfect(), to use in the program. My problem is I was either absent or, you know, spaced out, during last chapters which were Classes and objects and Functions. I understand Functions basically, but I am confused with classes. Can someone please gimme some logic and some example code for this, and I can try to deceipher it, (Good practice for me =) ). Thank You!!!!!

Tight_Coder_Ex 17 Discussion Starter shonenhype Dave Sinkula 2,398 Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...

0

0

I don't think you'll find anyone here that will provide you with code right from scatch without you showing any effort at all. Post what you think you should do (*your code*), and I'm sure you'll find lot's of help from that point.

0

your code), and I'm sure you'll find lot's of help from that point.

Its not that Im asking for the code of my program neede...I essentially asking for an example of how Math Library is used. I wrote my assignment as an exmaple of the type of Math Library functions I am working with.

0

I need to write a program that displays all perfect integers up to 100. I am required to write a boolean function, IsPerfect(), to use in the program.

A definition of perfect numbers: a number whose value is the sum of its divisors.

Its not that Im asking for the code of my program neede...I essentially asking for an example of how Math Library is used. I wrote my assignment as an exmaple of the type of Math Library functions I am working with.

You don't need *any* library functions. You only need the % operator to tell you when a potential divisor is in fact a divisor because it evenly divides into the number. That plus a loop or two and the ability to calculate a sum ought to do. Take a stab at it.

This article has been dead for over six months. Start a new discussion instead.

Recommended Articles

Hi. so this is actually a continuation from another question of mineHere but i was advised to start a new thread as the original question was already answered.

This is the result of previous question answered :

code for the listbox - datagridview interaction

At the top of the code ...

the function that I created to find the ...