#include <cstdlib>
#include <iostream>
#include <math.h>
#include <cstdio>
#include <stdio.h>
#include "dp_lib.h"
int main() {
int A =1;
[Code]...
im new to coding but ive written this code for an assignment and it creates 2 sine waves and adds them together but i want to be able to create a range of different sine waves at different frequencies and play them one after the other like in my code,but with the end result being that i would like each sine wave to represent a different note, so when your on the the console screen the user will be able to choose from a select number of notes and input them in any order so that the WAV file produced plays the sine waves in the order the user chooses so they can make a simple tune. but my code only plays it in the order it is in the code
#include <cstdlib> #include <iostream> #include <math.h> #include <cstdio> #include <stdio.h> #include "dp_lib.h" int main() { int A =1; float* data;
[Code] ...
I am doing ive written this code that creates 2 sine waves and adds them together but my question is that im trying to write a code where i can create multiple sine waves assign each sine wave to a separate values (musical notes ie A B C) and then be able to add them together in any order to create a tune.
i am trying to create a program for multiple windows. Here is my code
#include<Windows.h> // Store handles to the main window and application instance globally. HWND ghFirstWnd =0; HWND ghSecondWnd=0; HWND ghThirdWnd=0; HINSTANCE ghAppInst=0;
[Code]...
problem is when i try to execute the code it just say create window1- failed!!
I would like to create an array of struct variables inside a table to avoid using many if/else and/or switch/case statements. I have attached a simple example of what I am trying to do, it doesn't work. For the table "sTablePtr" I see different values than what I set, when I dereference it with a "&" it just shows me the addresses of the variables. However at the end, when I do print out the values, by just using the structs themselves, they print out the values correctly.
My structure declarations must remain a pointer. To be clear, what I am trying to do is have sTablePtr[i] show me the correct values I set, in this case I want the for loop to print out 1, 2 and 3. If there is a different way of doing this, I am open to it as long as I can use a table of my struct variables to avoid many if statements.
#define MAX_CNT 3 typedef struct { int nNum; int nCnt; }sDummy1;
I am trying to create a multiple choice quiz so I can learn the menu at my new job, while doing a side project but I am having a warning when outputting. Speaking of side projects, is this a kind of side project people are looking for on a resume?
So im trying to create a quiz using c++ that incorporates three different types of questions. These are the standard one answer question, true false questions and multiple choice questions.
How to create the true false and multiple choice questions?
Code: 90 y | | | +-180 -------------------- 0 x | | | -90
I want to calculate a new x,y such that it follows a sine wave like pattern until it gets to point (0,0). I want the width of the arc to go out to about -45 degrees, and the same on the other side to about -135 degrees.
How can I compute these new x,y coordinates in C++?
I am currently working on an arcade game for my final assignment this year. I am struggling to get a sine wave movement with the saucer. Here is the code for it:
I am basically trying to make a program for a calculator. I am struggling with how to do the sine calculation. this calculation will take place at line 158.
#include <iostream> #include <cmath> using namespace std; int main() {
I'm having trouble with getting a sine function to work. All variables are defined earlier in the same section. I have the code in a button (where I figured it would go) but I get the following error:
WindowsFormsApplication2.Math does not contain a definition for 'Sin'
For reference, I am using Microsoft Visual Studio Express 2013, and am coding a Windows Forms Application.
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text;
[Code] ....
I've tried other functions as well (abs, sqrt, etc.) to no avail, as Math only seems to pop up with two options: Equals and ReferenceEquals.
Write a C program with a separate function which calculates the sine function from the first principles according to the formula below. The code should find the sine value in 5 stages and then final answer
formula below :
sin(x) = x −x3/3!+x5/5!−x7/7!+x9/9!
I have done the code and it just gives me a final sine wave
it should find a error then plus one so on till it gets the answer
Link:
These are images of what it should look like and the image of a the formula ....
I need to create a sinewave. I have the values in an Excel file. The code reads the excel file and prints the values in the cmd but I need it to print back into excel as a sine wave. Pretty sure its currently values for a triangle wave but whatever I want a wave before I care about the type.
Description: Creates an array of values of a triangle wave, prints the result to the screen and creates a CSV (comma separated variable) file of data points. Allows user to enter number of amplitude and number of cycles
#include <stdio.h> #include <stdlib.h> #include <conio.h> #define N_SAMPLES 1000 // crashes if array size > 1000? #define UP 1 #define DOWN 0
I am writing a program to solve a triangle. Given any three pieces of information, find the other three. I am having trouble with SSA. I use the cosine law to find the unknown side. Then I use the sine law to find the other two angles. The sine law will give me each of the other angles. If one of the unknown angles is over 90 degrees, my program gives an angle as under 90 degrees. Not surprisingly, the correct angle and my wrong angle add up to 180 degrees. If you draw out the triangle you can deduce the right answer. How to have my program find out when the angle needs to be over 90 degrees.
#include <iostream> double fact (int f); //declaration of factorial function double power(double x, int y); //declaration of power function double sin(int x); //declaration of sine function //double cos(int x); //declaration of cosine function //double tan(int x); //declaration of tangent function
I want to develop an application which can host multiple views of explorer (window), where as each window is totally separate from others. So that I can have multiple desktop views through my single explorer. Any built in feature in .NET ?
I've been working on a function that works like a pipeline of a shell but receives a directory, go over it an search for every file to send it to a filter, something like this in bash "cat dir/* | cmd_1 | cmd_2 | ... | cmd_N", The only problem i have with the code is the redirection of the pipe descriptors.
Code:
int main(int argc, char* argv[]){ char** cmd; int Number_cmd; cmd = &(argv[2]); /*list of cmds*/ Number_cmd = argc-2; /*number of cmds*/ }
[code]....
The code is seems to work fine except when i run it with more than one command in example ("./filter DIR wc rev") in this case it returns
wc: standard input: Bad file descriptor wc: -: Bad file descriptor 0 0 0
I'm using multiple C++ files in one project for the first time. Both have need to include a protected (#ifndef) header file. However, when I do that, I get a multiple definition error.
From what I found from research, adding the word inline before the function fixes the error. Is this the right way to do this, and why does it work? Should I make a habbit of just declaring any function that might be used in two .cpp files as inline?
Say I have 5 vectors of unsigned char each of size 5. I want to take the max of each index and store it in a new vector. What is the most optimal way to accomplish this?
I have a struct called Array and I'm to create a function to create a dynamic array that's fill with randomly generated integers from 0 to 50 (inclusive) and a function to destroy the array for freeing its memory. Below the code that I have written so far.
Code:
* Struct */ typedef struct {int *pArray; //the dynamic array int length; //the size of the dynamic array}Array; /* Function to create a dynamic array */ Array *initializeArray (int length) {int i; }
I need to create a project that create a automated backup of a file.
i will get the file from C:/Folder/file.exe and move for a other created folder, but.. in every time that user make this backup, a folder will be created with year, month and date, like: C/Folder2/2014/April/16:42/file.exe.
For my data-structures class, I am attempting to create a binary search tree template to be used to create an AVL tree. I've written a Generic_Tree template for the BST to inherit from, and before I jump into implementing the AVL tree I'm testing the BST member functions. Everything was compiling fine until I added the BST insert() function. Now, I'm getting the following error message from my linker:
undefined reference to 'BST<void>::insert(int, void*)'
My professor asked my to make a program that makes the "FCFS","SWJ" operations using any programming language actually i preferred c++ i like it more than java so i started in it but i'm facing a little problem ,,, which is i cant enter multiple inputs with a space tabs between them if this possible , for example : i want to get the arrival time and execution time from user
arrival (spaces " ") execution >> i want the input be like this input1 (spaces " ") input2