d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Paying 50 Fg For Two Assignments Done By Tomorrow
Closed New Topic New Poll
Member
Posts: 14,537
Joined: Feb 13 2007
Gold: 3,241.00
Nov 30 2013 05:42pm
need this done by tomorrow 6 pm eastern, i have no time and will not be checking jsp till around 5pm eastern so yea

assignment 1

1. Write a complete C++ program that will contain the given 3 functions and contain all test
statements to test out the functions.
a. Write a function called firstIndex that finds the smallest index of an entry in an array
of integers that matches a given target. If the target is not present the function should
return an answer of −1.
For example, a program that uses the function follows.
int main() {
int x[6] = {3, 1, 4, 1, 5, 9};
int capacity = 6;
int target = 5;
cout << firstIndex(x, capacity, target) << endl;
// prints 4 because the target 5 is found as element number 4
cout << firstIndex(x, capacity, 1) << endl;
// prints 1 because the target 1 is first found as element number 1
cout << firstIndex(x, capacity, 8) << endl;
// prints -1 because the target 8 is not found.
return 0;
}

b. Write a function called reduceFrac that will reduce the given fraction into the lowest
term.
For example, a program that calls the function will have the output
cout << reduceFrac(5, 100) // prints out 1/20


assignment 2

1. Write a complete C++ program that will contain the following :
a. 2D array of size 10 by 10 containing only integers.
b. 1D array of size 10 containing only doubles.
c. Write a function randFill that will fill the 2d array with random numbers that is
generated in between 50 – 100.
d. Write a function averageCol that will calculate the average of a column in the 2D
array. Store the respective average of each column in the 1D array.
e. The main program should write all the test statements that will print out all the
elements in the 2d array (10 numbers per line), and also print out the newly calculated
average in the 1d array.
Member
Posts: 2,736
Joined: Nov 28 2009
Gold: 34.00
Nov 30 2013 07:01pm
he he he

This post was edited by Eagl3s1ght on Nov 30 2013 07:01pm
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Nov 30 2013 07:37pm
50 fg for two progs due in 24h on thanksgiving weekend? don't worry about a thing.

This post was edited by carteblanche on Nov 30 2013 07:39pm
Member
Posts: 5,988
Joined: May 6 2006
Gold: 30.00
Nov 30 2013 09:10pm
I will do it, just pm me your full name and what university you attend
Member
Posts: 14,000
Joined: Apr 6 2009
Gold: 140.07
Nov 30 2013 11:27pm
Quote (carteblanche @ Nov 30 2013 06:37pm)
50 fg for two progs due in 24h on thanksgiving weekend? don't worry about a thing.


lel
Go Back To Programming & Development Topic List
Closed New Topic New Poll