Want some C++ questions to be solved

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Oct 2009
Posts: 1
Reputation: adhruv92 is an unknown quantity at this point 
Solved Threads: 0
adhruv92 adhruv92 is offline Offline
Newbie Poster

Want some C++ questions to be solved

 
-3
  #1
Oct 10th, 2009
I have a huge amount of home work that my c++ teacher gave me at school, can you do that questions while i have to study chem and phy and maths for the exams. just post the answers.

i have attached the questions.

thanks
Attached Thumbnails
1.PNG   2.PNG  
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 1,679
Reputation: vmanes is a splendid one to behold vmanes is a splendid one to behold vmanes is a splendid one to behold vmanes is a splendid one to behold vmanes is a splendid one to behold vmanes is a splendid one to behold vmanes is a splendid one to behold 
Solved Threads: 193
vmanes's Avatar
vmanes vmanes is offline Offline
Posting Virtuoso
 
0
  #2
Oct 10th, 2009
You're kidding, right? Is it April Fool's day already?

Read the sticky posts - we don't do your work, but we'll be glad to help once you've shown a reasonable attempt on your own.
Everyone's gotta believe in something. I believe I'll have another drink.
~~~~~~~~~~~~~~~~~~
Looking for an exciting graduate degree? Robotics and Intelligent Autonomous Systems (RIAS) at SDSM&T See the program brochure here.
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 1,408
Reputation: firstPerson is just really nice firstPerson is just really nice firstPerson is just really nice firstPerson is just really nice firstPerson is just really nice 
Solved Threads: 181
firstPerson's Avatar
firstPerson firstPerson is offline Offline
Nearly a Posting Virtuoso
 
2
  #3
Oct 10th, 2009
Wow, this is funny. Hey, I have a lot of exams right now and I am
broke, can you just give me couple of thousands of dollars, so I don't have
to work? Just mail it to me.
1) What word becomes shorter if you add a letter to it? 
      [ Solved by : niek_e, Paul Thompson, SgtMe, murtan, xavier666, jonsca]
2) What does this sequence  equal to :  (.5u - .5a)(.5u-.5b)(.5u-.5c) ...
      [*solved by : murtan, xavier666]
3) What is the 123456789th prime numer?
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 2
Reputation: misa ayame is an unknown quantity at this point 
Solved Threads: 0
misa ayame misa ayame is offline Offline
Newbie Poster
 
-2
  #4
Oct 10th, 2009

1. A machine purchased for $28,000 is depreciated at a rate of $4000 a year for seven years. Write and run a C++ program that computes and displays a depreciation table for seven years. The table should have the form



Year
Depreciation
End-of-Year Value
Accumulated Depreciation

1
4000
24000
4000

2
4000
20000
8000

3
4000
16000
12000

4
4000
12000
16000

5
4000
8000
20000

6
4000
4000
24000

7
4000
0
28000
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 2
Reputation: misa ayame is an unknown quantity at this point 
Solved Threads: 0
misa ayame misa ayame is offline Offline
Newbie Poster
 
0
  #5
Oct 10th, 2009
how can i input this in a tubo c++ program? it is my first time to encounter this problem... Can anyone help me?
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 27
Reputation: triumphost is an unknown quantity at this point 
Solved Threads: 2
triumphost triumphost is offline Offline
Light Poster
 
0
  #6
Oct 11th, 2009
adhruv92 First And Last Time: I did NOT do this to actually do you homework for you, the reason I actually did it was for a C++ refreshment in math, secondly I thought since no one else will actually help you, I can give you an idea of how it is done but this is NOT exactly the right code you are looking for... what you want is to implement loops such as if(P < 2000) { Interest = , Compounded= , Etc} else if (P > 2000) && (P < 6000) { BLAH BLAH BLAH } YES you will learn loops and c++ to finish your homework if you do need help post here but I will not continue the code any further unless you show that you understand it and can continue on your own with implementing the stuff you need it to do...

  1. #include <iostream>
  2. #include <windows.h>
  3. #include <math.h>
  4. #include <stdio.h>
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10. float F, P, I, N , Y, power, Outside, U, TC;
  11.  
  12. cout<<"Please Enter the Amount Of The Initial Deposit: \n";
  13. cin>> P;
  14. cout<<"Enter The Interest Rate: \n";
  15. cin>> I;
  16. cout<<"Enter The Number Of Time Compounded Per Anum: \n";
  17. cin>> N;
  18. cout<<"Enter The Amount Of Years The Deposit Will Be In The Bank: \n";
  19. cin>> Y;
  20.  
  21. U = ((I/100)/N);
  22. I = (1 + U);
  23. TC = (N * Y);
  24. power = pow(I, TC);
  25. F = (P * power);
  26. std::cout.precision(20);
  27. cout<<"The Final Amount Is: "<< F <<endl;
  28. Sleep(10000);
  29. }


Release Note: instead of all the fancy math work you can do:
F = (P * (pow((1+ ((I/100)/N)), (N *Y)))); cuz the formula is that but for whatever reason I get the wrong result so I put fancy steps in the code to get the right output
Last edited by triumphost; Oct 11th, 2009 at 4:29 am.
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 27
Reputation: triumphost is an unknown quantity at this point 
Solved Threads: 2
triumphost triumphost is offline Offline
Light Poster
 
0
  #7
Oct 11th, 2009
//Numbers where the 3rd number is the sum of the last two numbers infront of it...
//Example 1,1,2,3,5,8,13,21

#include <stdio.h>
#include <windows.h>

int main ()
{

int num, t;
double num1, num2, ans;

num1 = 0;
num2 = 1;

printf("Enter the Amount Of Numbers You Want?\t");
scanf("%d", &num);

printf("1\t%.0f\n2\t%.0lf\n", num1, num2);

for(t = 0; t < (num - 2); ++t){

ans = (num1 + num2);

printf("%d\t%.0lf\n", t+3, ans);

num1 = num2;
num2 = ans;
}

Sleep(10000);
return 0;
}
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC