ArcMedia JavaScript Source Code 3000 Pro (gar448) for PC Logo
Posted on Mar 24, 2008

C++ programs please make me a program that will solve a trigonometry problem & also an array

2 Answers

MILEAH

Level 1:

An expert who has achieved level 1.

New Friend:

An expert that has 1 follower.

Corporal:

An expert that has over 10 points.

  • Contributor 1 Answer
  • Posted on Jan 26, 2013
MILEAH
Contributor
Level 1:

An expert who has achieved level 1.

New Friend:

An expert that has 1 follower.

Corporal:

An expert that has over 10 points.

Joined: Jan 26, 2013
Answers
1
Questions
0
Helped
208
Points
11

Wruite a program that computes and assesses the tuition fee of the students in the third semester, based on the given mode of payment below...

Plan(key) Discount(-) or Interest(+)

cash(1) 10%discount
two-installment(2) 5%discount
three-installment(3) 10%interest

jenson jose

Level 1:

An expert who has achieved level 1.

  • Contributor 4 Answers
  • Posted on Jun 05, 2008
jenson jose
Contributor
Level 1:

An expert who has achieved level 1.

Joined: Jun 05, 2008
Answers
4
Questions
0
Helped
749
Points
4

An array is a series of elements of the same type placed in contiguous memory locations that can be individually referenced by adding an index to a unique identifier
Initializing arrays. When declaring a regular array of local scope (within a function, for example), if we do not specify otherwise, its elements will not be initialized to any value by default, so their content will be undetermined until we store some value in them. The elements of global and static arrays, on the other hand, are automatically initialized with their default values, which for all fundamental types this means they are filled with zeros
include <iostream>
using namespace std;

int billy [] = {16, 2, 77, 40, 12071};
int n, result=0;

int main ()
{
for ( n=0 ; n<5 ; n++ )
{
result += billy[n];
}
cout << result;
return 0;
}
multidimensional array pseudo-multidimensional array #define WIDTH 5 #define HEIGHT 3 int jimmy [HEIGHT][WIDTH]; int n,m; int main () { for (n=0;n<HEIGHT;n++) for (m=0;m<WIDTH;m++) { jimmy[n][m]=(n+1)*(m+1); } return 0; } #define WIDTH 5 #define HEIGHT 3 int jimmy [HEIGHT * WIDTH]; int n,m; int main () { for (n=0;n<HEIGHT;n++) for (m=0;m<WIDTH;m++) { jimmy[n*WIDTH+m]=(n+1)*(m+1); } return 0; }
and now for trignometry
#include<iostream>
#include<cmath>
using namespace std;

int main()
{
int factorial(int);
int n = 3, i = 1;
double x, x2, b, PI, r;
char choice;
//r = x * (PI / 180)

cout<<"Please enter an angle value => ";
cin>>x;
cout<<"Is the angle value in Degree or Radian?"<<endl;
cout<<"Type D if its in degree "<<endl;
cout<<"Type R if its in radian "<<endl;
cin>>choice;


if((choice = 'R')||(choice = 'r'))
do{
i++; n = 3; x2 = 0; b = x2;
{
if(i == 1)
x2 = x - (pow(x,n) /factorial(n));
n = n + 2;
};
else
{
x2 = (x2 + ((pow(x,n)) /(factorial(n))) - (pow(x,n+2)) / (factorial(n+2)));
n = n + 4;
}


}while(abs(b - x2) > 0.000001);
else
//convert it to r

r = x * PI /180;

//cout<<"error occured/n";
cout<<"sin(x) = "<<x2<<endl;

return 0;
}

Ad

Add Your Answer

×

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

218 views

Ask a Question

Usually answered in minutes!

Top ArcMedia Computers & Internet Experts

Rob Hill
Rob Hill

Level 3 Expert

1483 Answers

Anonymous

Level 2 Expert

214 Answers

Dax Estorioso
Dax Estorioso

Level 2 Expert

162 Answers

Are you an ArcMedia Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...