944,175 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 727
  • C++ RSS
Oct 10th, 2009
-3

Want some C++ questions to be solved

Expand Post »
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
Click image for larger version

Name:	1.PNG
Views:	30
Size:	366.0 KB
ID:	12050   Click image for larger version

Name:	2.PNG
Views:	23
Size:	370.1 KB
ID:	12051  
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
adhruv92 is offline Offline
1 posts
since Oct 2009
Oct 10th, 2009
0
Re: Want some C++ questions to be solved
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.
Reputation Points: 1268
Solved Threads: 228
Posting Virtuoso
vmanes is offline Offline
1,895 posts
since Aug 2007
Oct 10th, 2009
2
Re: Want some C++ questions to be solved
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.
Reputation Points: 840
Solved Threads: 594
Senior Poster
firstPerson is offline Offline
3,865 posts
since Dec 2008
Oct 10th, 2009
-2
Re: Want some C++ questions to be solved

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
misa ayame is offline Offline
2 posts
since Oct 2009
Oct 10th, 2009
0
Re: Want some C++ questions to be solved
how can i input this in a tubo c++ program? it is my first time to encounter this problem... Can anyone help me?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
misa ayame is offline Offline
2 posts
since Oct 2009
Oct 11th, 2009
0
Re: Want some C++ questions to be solved
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...

C++ Syntax (Toggle Plain Text)
  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.
Reputation Points: 55
Solved Threads: 20
Posting Whiz in Training
triumphost is offline Offline
262 posts
since Oct 2009
Oct 11th, 2009
0
Re: Want some C++ questions to be solved
//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;
}
Reputation Points: 55
Solved Threads: 20
Posting Whiz in Training
triumphost is offline Offline
262 posts
since Oct 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Help with a circular linked list
Next Thread in C++ Forum Timeline: Why I can't compile a helloworld with Unicode supported by wxDevC++?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC