₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,331,001 members, 8,448,191 topics. Date: Sunday, 19 July 2026 at 10:53 PM

Toggle theme

Iyalodeofcanada's Posts

Nairaland ForumIyalodeofcanada's ProfileIyalodeofcanada's Posts

1 2 (of 2 pages)

ProgrammingRe: Help Needed With The Following Questions In C++ Or Any Language Please!!! by Iyalodeofcanada(op): 6:05pm On Jan 16, 2016
Visual studio c++ 2011.
proxy20:
Which compiler are u using?
ProgrammingRe: Help Needed With The Following Questions In C++ Or Any Language Please!!! by Iyalodeofcanada(op):
Otuabaroku:



@Iyalodeofcanada let me put you through to number 1 and 5, with that you can try the rest.

Question 1. Write a function that takes three integers as arguments and returns the product of
the largest two.

Here you are required to find the largest two of the three numbers entered by the user. In my solution, I have decided to store the data entered by the user in array and subsequently sort them in ascending order. With this sorting, I now know that the last two are the largest two of the three numbers entered by the user; hence, simply multiplying the two, will give me the answer.Here is code blow.


#include <iostream>
using namespace std;

int ProductOfLargestTwo(int a,int b,int c)
{
//store the user input with array
int userInput[3] = {a,b,c};

//sort the array in ascending order
for (int i = 0; i < 3; i++)
{
int compare = i+1;
if (compare < 3 && userInput[i]> userInput[compare] )
{
int temp = userInput[i];
userInput[i] = userInput[compare];
userInput[compare] = temp;
}
}

//returns the product of the largest two
return userInput[1] * userInput[2];
}

int main()
{
cout<<"the product of the largest two is :"<<ProductOfLargestTwo(20,2,140)<<endl;
getchar();
return 0;
}

Thank you for this but your code seems too advanced for a baby programmer like me(I started this class one week ago). I have been googling each line all day. The truth is it is an assignment due tommorow. It is not as if i am been lazy but right now i just have to deliver and i am looking for the simplest way to go about this later i can now read up and catch up on array declarations and all that. Still working on it though thanks alot


#include <iostream>
using namespace std;
int maxmul(int a, int b, int c)
{

int min;
int a = 1;
int b = 2;
int c = 3;
}

int main()

if b < min min = b;
if c < min min = c;

{
cout << maxmul(1,2,3) << endl;
cout << maxmul(3,1,2) << endl; cout << maxmul(3,2,1) << endl;
}

return a*b*c/min;
ProgrammingRe: Help Needed With The Following Questions In C++ Or Any Language Please!!! by Iyalodeofcanada(op): 11:22pm On Jan 15, 2016
proxy20:
solution 7 is pending
TheTrapezoidal Rule
As regards your solutions, can i present the first like this?

#include<iostream>
int maxmul(int a, int b, int c)
{
}
int main()
{

int a =1;
int b=2;
int b=3;
product =inta*intb

cout <<product<< endl;
return 0
}
cout << maxmul(1,2,3) << endl;
cout << maxmul(3,1,2) << endl; cout << maxmul(3,2,1) << endl;
}
ProgrammingRe: Help Needed With The Following Questions In C++ Or Any Language Please!!! by Iyalodeofcanada(op): 11:17pm On Jan 15, 2016
proxy20:
solution 7 is pending
TheTrapezoidal Rule
I am very grateful thank you alot!............Please teach me! I really want to learn!!
ProgrammingRe: Help Needed With The Following Questions In C++ Or Any Language Please!!! by Iyalodeofcanada(op): 11:15pm On Jan 15, 2016
Otuabaroku:

@Op, I think this is an assignment given to you to do. It makes sense for you to make an attempt. When people see your effort, then you can be helped. In that way,you learn more from the assignment.
I was able to come about this for number 1
int maxmul(int a, int b, int c)

{
int min;
min = a;
if b<min min = b;
if c<min min = c;
return a*b*c/min;
}

Question 2
double inc(double x)
{
return x+1.0;
ProgrammingHelp Needed With The Following Questions In C++ Or Any Language Please!!! by Iyalodeofcanada(op): 4:21am On Jan 15, 2016
Please help a beginner

Question 1. Write a function that takes three integers as arguments and returns the product of
the largest two.

#include<iostream>
int maxmul(int a, int b, int c)
{
}
int main()
{
cout << maxmul(1,2,3) << endl;
cout << maxmul(3,1,2) << endl; cout << maxmul(3,2,1) << endl;
}

Question 2. Write a function, inc, that increases the value of variable x by 1.0;

#include<iostream>
int main()
{
float x=10.0;
cout << inc(x) << endl;
}

Question 3. Write a function that calculates and returns the average value of an array of
doubles. The length of the array is provided as a second argument, n.

double average_array(double data[], int n)
{
}

Question 4. Write a function to subtract the average value of the entire array from each array
element. You may make use of the average_array function from the first question.

void subtract_average(double data[], int n)
{
}

Question 5. Write a function to calculate the average value of a 100 by 100 array of ints.
Return the average as a double.

question 6. Write a program to dynamically allocate a n by m array of doubles. Both n and m
should be read from the console. All elements of the array should be initialized to zero. All
memory should be freed before the program exits.


Question 7. The function trap() numerically integrates exp(x^2) in the interval x=[a,b]. n is the number of points to evaluate the function at. Add comments to the function and format it using C++ standards.

#include<cmath>
float exp_mx2(int x)
{return(exp(x*x));}
float trap(float a, float b, int n) { float h = (ba)/(n1); float value = 0.5*( f(a)+
f(b)); for(int k=2; k < n; k++){value+=f( a + h*(k1)); } value*=h;return(value); }
EducationRe: What Keeps You Going? by Iyalodeofcanada: 8:54pm On Jan 13, 2016
Interesting

1) God
2)parent
3)Positive friends
4)Family
5)Goals
6)Vision
7)Dreams
9)Excellence
10)Heaven

Even though there is no easy way out!!!
EducationRe: How To Secure A Scholarship Admission To Canadian Universities by Iyalodeofcanada: 2:51pm On Dec 27, 2015
No agent will tell you all this even if you pay them.information is key information is power!!!
TravelRe: Travelling To Canada Part 8 by Iyalodeofcanada: 4:04am On Jul 28, 2015
BeulahHephziba:
Let me share my exprience on this issue and, is quite similar to what Onyeoma3 suggested.
If your school is using Peer Transfer or anoda method of transfer, I believe most schs do, you can use your naira Master card to transfer money into your student account in Canada. Quite cheap, and it makes lot of sense. I transferred over 4M into my student account @ U of R. You can't compare this with bank charges...
how did you do that with master card? Did you use token?
TravelRe: My Funny Jjc Experience In Canada........ by Iyalodeofcanada: 12:26pm On Jul 07, 2015
bigtt76:
Hahaha nice one but the school nor try shaaa. At least den for organize orientation for new foreign students to assist them in settle in fast.
Many Canadian schools do have mentorship program that allows international students settle down fast enough. I doubt if the op arrived when the school was really active. He probably arrived either spring or summer.
TravelRe: My Funny Jjc Experience In Canada........ by Iyalodeofcanada: 12:20pm On Jul 07, 2015
[quote author=bigtt76 post=35573786]Hahaha nice one but the school nor try shaaa. At least den for organize orientation for new foreign
TravelRe: Travelling To Canada Part 8 by Iyalodeofcanada: 12:33pm On Jun 27, 2015
taiwokazx:
I need to post this to keep d hope of those who applied for spousal work permit alive cos I realised pple don't really thread on it

applied for spouse work permit

Applied online 09/05/15
Biometrics 11/05/15
Med call 25/05/15
They ask me for evidence fund for my intended trip same day 25/05/15
Med done 01/06/15
Med passed 16/06/15
Request for passport 24/06/15

Godwin noni @ iyalodeofcanada all will end with praise nd worship cos I long to hear u break the good news next
Congratulations meaning you never submitted any soa a at all till they requested? Please list the document
TravelRe: Travelling To Canada Part 8 by Iyalodeofcanada: 4:29pm On Jun 10, 2015
akanni:
What will the sister be coming to do? The spousal work permit is unique, your sister can only apply to visit, not work. She could apply for visit visa but you will need to prove you can accommodate her conveniently.
She will also need to fulfill the same requirement for a visit visa; evidence that she will come back, financial assets, job, and any other thing to support her application.
Oh I see.......I dont want to be seen by the family as someone who cares more for the husband to be than the family.......I hope you understand... So i want to at least help my sister to get here by any means possible.....she is currently a graduate student in Nigeria. I am looking for a way to bring her here before. So my husband to be can apply for his open work spousal permit without any rancour. Is there any way I can bring her her through visit, then she gets a job or apply for either another masters or phd during the visit period and stay? Please advise me....Thank you so much God bless you
TravelRe: Travelling To Canada Part 8 by Iyalodeofcanada: 9:27pm On Jun 09, 2015
@taiwokazx @akanni : Thank you so much for the answers on my husband to be. However I still have one question. Is the process of inviting one's sister whose name was listed on the cic family form the same as the process of inviting one's spouse? What documents will be needed for someones sister? . what documents do i need to gather if i am inviting my sister? and what documents does my sister need needs to show cic? Thank you.
TravelRe: Travelling To Canada Part 7 by Iyalodeofcanada: 9:46pm On Jun 08, 2015
Thank you so much for this reply. I don't have a job before I left Nigeria. But I have savings. Like 500 thousand is left in the account. I came to Canada early this year with funding paid from within canada (Scholarship)so I get paid 500 dollars biweekly after tax. This is my own profile. As for my husband to be,he earns about 80 thousand naira per month and he has a current balance of 1.2million.

Now how much soa will be enough to proof to the embassy from his own part? I got here early this year. Do I have to be a permanent resident before I can invite him after our marriage? I am on a two years masters degree and I am yet to complete a semester . Please shed more light. Thank you
taiwokazx:
ur fiance should apply for spouse open work permit outside canada
copy of ur study permit
copy of ur visa page nd data page
letter from ur school
soa from both
marriage cert weddings pics
sop from both ( as Application for spousal open work permit)
employment letter
letter of intro from employee
pay slips
TravelRe: Travelling To Canada Part 7 by Iyalodeofcanada: 8:05pm On Jun 08, 2015
taiwokazx:
Like how much should be on both soa?. Thank you


ur fiance should apply for spouse open work permit outside canada
copy of ur study permit
copy of ur visa page nd data page
letter from ur school
soa from both
marriage cert weddings pics
sop from both ( as Application for spousal open work permit)
employment letter
letter of intro from employee
pay slips
TravelRe: Travelling To Canada Part 7 by Iyalodeofcanada: 2:09pm On Jun 08, 2015
Chumsyzynny I am in the same shoes can you please put me through? I posted this yesterday but no one answered. I am studying here I got here February and I want to go back and marry my fiance in nigeria by august What documents do I need to put together and what doc will be required from him because I want him to join me here after our wedding.
TravelRe: Travelling To Canada Part 7 by Iyalodeofcanada: 12:26am On Jun 08, 2015
Hello Everyone.....I am new here. I need information on how to bring my fiance here. We are actually planning to get married by september in Nigeria. I need information on the right documents to submit so i can start preparing from my end and he can start gathering documents too. Please help me. Thank you.

1 2 (of 2 pages)