1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

next assignment :-)

Discussion in 'Software Development' started by aushaheed, Sep 27, 2001.

Thread Status:
Not open for further replies.
Advertisement
  1. aushaheed

    aushaheed Guest Thread Starter

    Joined:
    Sep 6, 2001
    Messages:
    85
    Anybody have any suggestions on where to start? thanks



    You are part of a software development team. I am your project leader. Our assignment is to develop a virtual calculator for the University. We have decided to develop the calculator using C++. I have given you the task to develop another math library called (arrays.h). In this library you are to develop the following functions:

    add, subtract, multiply
    These functions will take an array of numbers, the array size and two integer numbers as their parameters. The two integer numbers represent locations in the array. It will add, substract, or multiply the numbers at the two specified locations in the array return the result.
    It should be able to handle arrays that are doubles, ints, and longs.
    Return values should be of the same type as the array.
    divide
    This functions will take an array of numbers, the array size and two integer numbers as its parameters. The two integer numbers represent locations in the array. It will divide the first number located at the position designated by the first integer by the second number located at the position designated by the second integer parameter. It will return the result.
    It should be able to handle arrays that are doubles, ints, and longs.
    If the value of the second number is zero, this function will display an error message to the screen and return -999 .
    Return values should be of the same type as the array.
    negate
    This function will take an array as its first parameter, the array size as the second parameter and an integer as its third parameter, which represents a location in the array.
    This will negate the value of the element located in the position passed as the third parameter and return the new value.
    It should be able to handle arrays that are doubles, ints, and longs.
    Return values should be of the same type as the array.
    search
    This function should take an array as its first parameter, array size as the second parameter, and a search key as the third parameter.
    It will return the location number of the search key in the array, if it is found. If it is not found in the array, it should return -999.
    sort
    This function will take an array as its first parameter, the array size as the second parameter and a boolean value for sorting.
    When the third parameter is true, the array should be sorted in ascending order, if the third parameter is false, the array should be sorted in descending order.
    If the function is called with only the first 2 paramters, then sort the array in ascending order.
    It will sort the elements in the array and return nothing.

    Your program should be named arrays.h.


    Also, your program must verify that the location variables' values are within the bounds of the array, as discussed in class. If one or more location variables' value is out of bounds, display "Index out of bounds" and return -999.
     
  2. Guy

    Guy

    Joined:
    Feb 19, 1999
    Messages:
    260
    Quick question.

    Are you posting this because you need help? or because you are helping people learn c++.

    I dont want to post this program if you already know how to do it LOL.
     
  3. aushaheed

    aushaheed Guest Thread Starter

    Joined:
    Sep 6, 2001
    Messages:
    85
    I posted this because I don't know how to start the program. I'm not teaching it or anything. Any ideas? Thanks.
     
  4. Anne Troy

    Anne Troy

    Joined:
    Feb 14, 1999
    Messages:
    11,746
    First Name:
    Anne
    Aushaheed:

    You wouldn't happen to be asking someone to do your homework for you, would you?

    Most all free tech support sites offer guidance for and direction with homework, but won't "do the work for you". It doesn't help you to learn at all.

    It'd be much more appropriate if you ask simple, direct questions as you do the homework yourself.

    If you want to do that, any moderator will be happy to just delete this question immediately. Meanwhile, you can ask that simple, more direct question....

    Thanks for your understanding.
     
  5. maxim

    maxim Account Closed

    Joined:
    Jun 9, 2001
    Messages:
    457
    try:

    main()
    {
    (code here)
    }

    --maxim
     
  6. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Similar Threads - next assignment
  1. DJBrendan
    Replies:
    1
    Views:
    281
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/54272

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice