Help Please! Cos/Sin errors

So I am in a C++ programming class for the first time and the assignment is to make a partical motion simulation:
A particular object moves according to specific equations for velocity v, acceleration a, and drag d, all of which are functions of time t. write a c++ program to show velocity acceleration and drag for the first five seconds t=1 to t=5

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Partical Motion Simulation
// Alex Wild
// Engr 21
// 9/19/2011
// This program will show the acceleration, velocity, and drag for a particular object for the first five seconds.

// Psuedocode
// 1. Declare Variables
// 2. Input equations for drag, velocity, and acceleration
// 3. Present drag, velocity, and acceleration
// 4. Hold window open

#include <iostream>
#include <cmath>
using namespace std;

int main()
{
	// 1. Declare Variables

	int v, a, d;
	const float t = 1;
	char f;

	// 2. Input equations for drag, velocity, and acceleration

	v = (0.07*pow(t,3)) - (0.627*pow(t,2)) + (0.266*t) + 121.3;
	a = (0.013*pow(t,2)) - (1.954*t) + 1.266;
	d = (0.866*pow(t,4)) + (sin(3(t))) + (cos(t)*cos(t));

	// 3. Present drag, velocity, and acceleration

	cout << "At t=1:" << endl;
	cout << "Velocity Is:" ;
	cout << v << endl;
	cout << "Acceleration Is:" ;
	cout << a << endl;
	cout << "Drag Is:" ;
	cout << d << endl;

	// 4. Hold window open

	cin >> f;

	return 0;
}


It gets an error on the line for the equation of drag saying it does not evaluate to a function. Thank you!
Last edited on
(sin(3(t)))

The error is what it says. "3" is not a function, yet you are trying to call it like one.

If the intent was to multiply 3*t, then do that: sin(3*t)
Thank you so much! I appreciate the quick answer!
Topic archived. No new replies allowed.