How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask lifesaver Your Own Question

lifesaver
lifesaver, Engineer
Category: Homework
Satisfied Customers: 5962
Experience:  Years of experience in teaching maths , physics , chemistry , biology and economics
16528259
Type Your Homework Question Here...
lifesaver is online now
A new question is answered every 9 seconds

C programming - write functions with testing. Need by 4 next

Customer Question

C programming - write functions with testing. Need by 4 next hours. More info directly to you.
Submitted: 1 year ago.
Category: Homework
Expert:  lifesaver replied 1 year ago.

lifesaver :

Hi

lifesaver :

Welcome to Justanswer

lifesaver :

COuld you please mention the details.

lifesaver :

You can upload to www.wikisend.com and share the download link with me.

Customer :

first, a question. will our exchange be confidential and not searchable on the internet?

lifesaver :

Yes.

lifesaver :

I will close the question and the answer won't be searchable.

Customer :

ok. uploading to wikisend. give me a minute. using Codeblocks 10.05 compiler.

lifesaver :

Hey

lifesaver :

were you able to upload

Customer :

having problems with site.

lifesaver :

ok..

Customer :

let me try using mozilla

lifesaver :

you can use justanswer site itself.

Customer :

here is the zip file for the project. next are instructions.

Customer :

http://wikisend.com/download/785172/201.zip

Customer :

http://wikisend.com/download/551224/201 instructions-v6.pdf

lifesaver :

I am not able to access the pdf

Customer :

I would like help with task 1. no need to refactor

Customer :

ok. copying.

Customer :

Synopsis
We want to implement two functions which are part of a program meant to operate on a
two dimensional integer matrix. Other programmers will work on the GUI while we have
been tasked to develop the functions. In order to help us test the functions before they are
used by the other programmers, we write a main which will use our two functions on
some pre-defined data in order to make sure they operate as expected by the
requirements.
Our first function will test whether a given matrix is in order or not while the other will
sort it. We will have other functions in our project but they will be there to help us
structure the testing of the two above-mentioned functions. The main will simply invoke
the test functions so we display the results when we run our program.

Customer :

You will be provided with several files to get you started working on this assignment.
Make sure you edit them but do not alter their name or add new files. Here are the files;
main.c Do not modify this file.
It will invoke the two functions you have to implement in tools.c and
apply them to a list of tests which you will define in tests.c / tests.h.
tools.h Do not modify this file.
Prototypes for the two functions you have to implement in tools.c along
with documentation describing what they should be doing.
tools.c Implement the two functions in this file.
tests.h This header file contains some test-related constants which are used in the
whole program to make things a little easier. You should not modify the
number of rows and columns of the matrices but you will have to alter the
number of tests since you will be the one writing them. When you modify
this file, make sure to rebuild the whole project.
tests.c Modify the arrays in this file to provide your own test data. Make sure you
update the NB_TESTS in tests.h to reflect your modifications.
You will have to comment each test, as illustrated with the first one which
I give you for free, to explain what you are trying to evaluate with it

Customer :

all that was just a little background. here is the task #1.

Customer :

Task #1 – Implementing and testing your isMatrixSorted
Some reading before you start
Before to start working on implementing anything, you’ll have to read the entire source
and make sure you understand what it is doing so that you are able to add to it without
breaking everything.
Pay specific attention to the way the parts of the program already written for you use the
data in tests_inputs and tests_expected. These are defined in tests.c. The data in these
arrays is used to invoke the two functions you need to write with some pre-determined
parameters. Each time we invoke these functions with a pre-defined data, we verify it
returned the expected result which is also stored in the two above-mentioned arrays.
In addition, spend some time reading the requirements in this document and modify the
arrays in tests.c to reflect the tests you think your program ought to pass to meet these
requirements. When you do so, make sure you update accordingly the value of the
NB_TESTS integer constant defined in the tests.h file.
Implementing your solution
Next step is implementing the isMatrixSorted function in the tools.c file so that it
detects whether a matrix passed as parameter is already sorted or not and returns an
appropriate value. Refer to the comments in the code for the specific details.
To give you an example, a two dimensional 3x5 matrix is sorted when its elements are
ordered as follows;
3 5 9 20 20
42 50 55 99 142
200 209 500 900 999
Testing your solution
Now is time to add more tests based on what you learned when you actually started
implementing the solution and what you learned when you had to fend off your first bugs.
Revise the tests you previously used to populate the arrays tests_inputs and
tests_expected in file tests.c.
As you add or remove tests, make sure you remember to update accordingly the value
of the NB_TESTS integer constant defined in the tests.h file.

Customer :

It has 2 parts, but i am only seeking help on this part.

Customer :

the 2 functions, matrixSort and isMatrixSorted must be operational. I can then tackle the rest.

lifesaver :

Ok.

lifesaver :

Let me go through the requirements

lifesaver :

Have you been taught about binary search or just linear search

Customer :

mostly linear

Customer :

binary would be too sophisticated

Customer :

although we have discussed it

lifesaver :

Ok.

Customer :

i think the arrays we are testing are not complex enough for binary

Customer :

would you agree?

lifesaver :

sorting..

lifesaver :

what techniques

lifesaver :

bubble ,selection ?

Customer :

here is what he says

Customer :

Most students like to use the “bubble sort” from the textbook and adapt it to a two
dimensional matrix. I personally think it’s a bit too much work.
Others go with the following logic; we need to look at each element of the matrix in
order, one after the other. For each such element, I use loops to go other all the elements
between it and the end of the matrix. Each time, I compare the two elements and swap
them if they are out of order. This result is me looking for the smallest element and
putting it first in the matrix, then looking for the next smallest one and putting it second
in the matrix. For a one dimensional array, the algorithm would look something like;
// my array name is XXXXX XXXXX has indexes between 0 and N-1
int i,j;
for(i=0 ; i < N-1; i++){
for(j=i+1; j < N ; j++){
if( data > data[j]) SWAP THEM
}

lifesaver :

Ok

Customer :

do you accept my request? I need to step away from the computer for a little while.

lifesaver :

Yes.

lifesaver :

I will have it ready in couple of hours.

Customer :

thank you. i will check back in an hour?

lifesaver :

Ok.

Customer :

im back

Expert:  Angela--Mod replied 1 year ago.
Hello. I am a moderator for this topic. Unfortunately, the professional is no longer available to assist. I am searching for another professional to assist you, and appreciate your understanding. If you no longer need assistance, please let me know. Otherwise, you will receive an email notification as soon as you have a new reply.

Thank you,

Angela
Customer: replied 1 year ago.

ok. i will check back in a few minutes.

Customer: replied 1 year ago.

Please cancel the request. I haven't heard back from you or had any acknowledgement of last 2 messages.

JustAnswer in the News:

 
 
 
Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.
 
 
 

What Customers are Saying:

 
 
 
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
< Last | Next >
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
  • This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!! Alex Los Angeles, CA
  • Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult. GP Hesperia, CA
  • I couldn't be more satisfied! This is the site I will always come to when I need a second opinion. Justin Kernersville, NC
  • Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around. Esther Woodstock, NY
  • Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know. Robin Elkton, Maryland
  • He answered my question promptly and gave me accurate, detailed information. If all of your experts are half as good, you have a great thing going here. Diane Dallas, TX
 
 
 

Meet The Experts:

 
 
 
  • Manal Elkhoshkhany

    Tutor

    Satisfied Customers:

    4522
    More than 5000 online tutoring sessions.
< Last | Next >
  • http://ww2.justanswer.com/uploads/BU/BusinessTutor/2012-2-2_115741_Kouki2.64x64.jpg Manal Elkhoshkhany's Avatar

    Manal Elkhoshkhany

    Tutor

    Satisfied Customers:

    4522
    More than 5000 online tutoring sessions.
  • http://ww2.justanswer.com/uploads/ComputersGuru/2010-02-13_051118_Photo41.JPG LogicPro's Avatar

    LogicPro

    Engineer

    Satisfied Customers:

    3458
    Expert in Java C++ C C# VB Javascript Design SQL HTML
  • http://ww2.justanswer.com/uploads/LI/lindaus/2012-6-10_04811_IMG20120609164157.64x64.jpg Linda_us's Avatar

    Linda_us

    Finance, Accounts & Homework Tutor

    Satisfied Customers:

    3124
    Post Graduate Diploma in Management (MBA)
  • http://ww2.justanswer.com/uploads/chooser77/2009-08-18_162025_Chris.jpg Chris M.'s Avatar

    Chris M.

    M.S.W. Social Work

    Satisfied Customers:

    2385
    Master's Degree, strong math and writing skills, experience in one-on-one tutoring (college English)
  • http://ww2.justanswer.com/uploads/JawaadAhmed/2009-6-27_12137_SIs_SHadi.jpg F. Naz's Avatar

    F. Naz

    Chartered Accountant

    Satisfied Customers:

    1988
    Experience with chartered accountancy
  • http://ww2.justanswer.com/uploads/JK/jkcpa/2011-1-16_182614_jkcpa.64x64.jpg Bizhelp's Avatar

    Bizhelp

    CPA

    Satisfied Customers:

    1876
    Bachelors Degree and CPA with Accounting work experience
  • http://ww2.justanswer.com/uploads/avremote/photoa.jpg Seanna's Avatar

    Seanna

    Tutor

    Satisfied Customers:

    1781
    3,000+ satisfied customers, all topics, A+ work
 
 
 
Chat Now With A Tutor
lifesaver
lifesaver
Tutor
5962 Satisfied Customers
Years of experience in teaching maths , physics , chemistry , biology and economics