What course are you taking, and which topics have been covered?
It looks like this is an assignment to help you understand and apply what you have learned.
I believe you should be able to show us some code or at least some pseudocode and start getting help with difficulties from there.
– Define a structure called Object which includes three doubles specifying the object’s mass,
volume and density.
– Create an array of 10 Objects.
– Define the function void scanobjectsdata(struct Object objects[], int size) that scans
from the input and updates the mass and volume of each object.
– Define the function void computeobjectsdens(sruct Object objects[], int size) that
computes and updates the density of all of the objects.
– Define the function void sortobjects(struct Object objects[], int size) that sorts
the objects in the array according to their density.
– Write a program that checks all of the above functions.
Can someone tell me how to do it in c language? I do not know how to do it please help.
3 answers
It is a computer course for physicists. Therfore i do not study programming as my main course. also i have missed a few lessons, therfore i do not even know where to begin.
Programming is a subject learned by intuition (for geniuses) or by practice (most of us).
If your teacher did not cover programming, then it must have been required as a prerequisite. The problem given is not even for a first course in c-programming, so you will have a lot of catching up to do.
You can start by reading up on some c-programming tutorials online, or if you have some c-programming textbooks, start from the first page.
Start by installing a c-compiler (such as Dev-C++ (easier to install than the Microsoft C.net) and follow the tutorials from page one, such as the Hello World! program.
Make the best use of your time available and expect to spend 8-10 hours a day for the coming weekend.
Good luck.
PS: some links to c-tutorials:
http://www.cprogramming.com/tutorial/c-tutorial.html
http://www.learn-c.org/
If your teacher did not cover programming, then it must have been required as a prerequisite. The problem given is not even for a first course in c-programming, so you will have a lot of catching up to do.
You can start by reading up on some c-programming tutorials online, or if you have some c-programming textbooks, start from the first page.
Start by installing a c-compiler (such as Dev-C++ (easier to install than the Microsoft C.net) and follow the tutorials from page one, such as the Hello World! program.
Make the best use of your time available and expect to spend 8-10 hours a day for the coming weekend.
Good luck.
PS: some links to c-tutorials:
http://www.cprogramming.com/tutorial/c-tutorial.html
http://www.learn-c.org/