C :: Cannot Find Way To Operate Duration Of Beep
Mar 2, 2013I'm trying to build morse code, but seems like I cannot find the way to operate the duration of the beep.
View 4 RepliesI'm trying to build morse code, but seems like I cannot find the way to operate the duration of the beep.
View 4 RepliesYour objective is to write a program that calculates the simple interest for a given loan amount and duration (in years).
Formula:
Simple interest = loan amount X interest rate X number of years
Assume interest rate is a constant 6% per year.
Specifically, your program will:
1. Output descriptive header
2. Prompt and read any customer’s first name, middle initial, and last name individually
3. Prompt and read the principal/loan amount
4. Prompt and read the duration of the loan in years
5. Calculate the interest
6. Output:
a. Customer full name
b. Principal/loan amount
c. Duration of loan
d. Interest rate
e. Interest on loan
f. Principal and interest due at end of term
OK SO THIS IS MY PROGRAM SO FAR. As you can see i got it all but i am so confused with as to for loan amount and duration of year, if i should use float or double to declare it?
i need to finish this assignment by calculating the simple interest and i dont know how or where to begin.
int main(){
system("color f0");
string firstName;
string middleInitial;
string lastName;
cout<<"Please enter your First Name: ";
[Code]...
0 down vote favorite
I want to perform operation like prime,armstrong finding etc on in C using very large number, bigger data types supported by C. scanf and print. I tried CLN and GNUMP library but I did not get clue how to use it...
can I operate a char string to a function at C programming?
View 1 Replies View RelatedI need to be able to sound an alarm (a beep) for 10 seconds in C.this beep has to mirror a sleep period, before the code loops back to the beginning. Now I've got the loop sorted and I can make it beep and sleep, however the beep follows 10 seconds after the sleep..Both the beep and the sleep need to happen at the same time..
View 3 Replies View RelatedI code login form. In the textbox I want to clear if there are some text or close form if there's nothing. The problem is System beep sound occured when the text is cleared. Here's my code
private void tbPassword_TextChanged(object sender, EventArgs e)
{
string _enteredPassword;
while (tbPassword.TextLength == 8)
[Code]....
Code:
#include <iostream>
#include <windows.h>
#include <iomanip>
using namespace std;
[Code] .....
I'm trying to implement Morse code program. However, I cannot find any codes which make a time gap between the letters. How the time gap code?
I need to find S and how did you find S in N is 4
#include <iostream>
int main () {
int n,i,s;
cout<<"Put the number of n"<<endl;
cin>>n;
s=0
for (i=1;i<=n;i++)
s=s+i
cout<<"S is<<s<<endl;
return 0
}
I'm a beginner in C and system programming. I need to use multiple process and POSIX shared memory to find all primes between 0 and 100. My code compiles, but the result is not correct, it shows all the multiples of 3 as primes.My instructor also mentioned that the multi-process portion will fork() the appropriate number of child processes. The parent process will create a POSIX shared memory object to which the sub-processes will attach. I am confused about the things he said about parent process.why I'm not getting the right primes?
Code:
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/mman.h>
[Code]....
I just got assigned a project in my C programming class. The objective is to find the min and max number out of a .txt file full of numbers on separate lines called "data.txt". I am pretty much stuck at this point. I don't know how to actually scan the file and print the min and max. Also, the list of numbers in the data.txt file contains hundred on hundreds of numbers. So I couldn't specify the exact amount of numbers listed in the file. I must also find the count number, sum, and the average of the given data, So far I have:
Code:
#include<stdio.h>
int main()
{
int counter=0;
int maximum=0, minimum=1;
int num_data_points, avg;
double max, min;
FILE *sensor;
sensor = fopen("data.txt", "r");
[Code]...
This is the first time I'm trying to program in C# and I'm having some trouble.I can't find a way to compile whatever I do.I don't think it's a problem of what I wrote but I might not have what is necessary.I tried: C:>csc fisrt.cs csc was not a valid command.
View 1 Replies View RelatedI am working on a homework lab in which we have to find all the subsets equal to a given sum from an array of numbers.For example, an array of 7 numbers (1, 3, 4, 6, 7, 10, 25) with a sum of 25 would be (1, 3, 4, 7) and (25)...We are supposed to use dynamic programming to solve this.Now using the code below that we went over in class (Sedgewick's subsetSum), I understand how to this finds the first subset that adds up to the sum given. What's stumping me is how to find multiple subsets.
Code:
main(){
// Get input sequence
int n; // Size of input set
int m; // Target value
int *S; // Input set
int *C; // Cost table
int i,j,potentialSum,leftover;
}
[code]....
In class the teacher said it would be mainly just modifying the code we went over in class.
when I try to run the program (new to VC++, I click the green arrow next to "Debug" in the toolbar, right) and I get a message box - code builds without errors - but the debugger says: "Unable to start program 'c:users/sal/documents/visual studio 2010/Projects/SFML App/Debug/SFML App.exe Cannot find file specified"...well, I go to the directory it says, and nothing is even in the Debug file.
View 10 Replies View Relatedhow to get this program to find the palindrome? Here is my program:
#include <iostream>
#include <string>
using namespace std;
using std::string;
[code].....
Would you use regex? (not sure how though)
Or, would you go through the hard way, and iterate through every word, until you discarded (n-1) words and reached the nth word?
The second wouldn't be so short and clear to one who reads the code, therefore i was wondering if there's a neater way.
How to find the sum of even factors ????
View 1 Replies View Related Consider a map that has the following properties;
- the map is two dimensional
- the map is perfectly square with dimensions 10000000x10000000
- the map has an associated set of many features
- the map does not "wrap around"
Each feature on the map is described by a 2D coordinate in the range (0, 0) to (10000000, 10000000).
Find the most isolated feature on the map, where the "most isolated feature" is the feature that is furthest (largest Euclidean distance) from any other feature. Because the map does not "wrap around", this should be a direct distance across the map.
<----10000000---->
--------------- -
| A | |
| | |
| | 10000000
| | |
| B C | |
| E D | |
--------------- -
In the example above, A is the most isolated feature on the square map with edge length 10000000. Write a program that reads in many features from standard input, and outputs the name of the most isolated feature to standard output. The format of the input is the feature name, x coordinate and y coordinate separated by spaces.
Each feature is on a new line. There may be any number of features between 1 and 100000. The program should be fast, so the algorithm must be better than O(n^2).
Any of the following languages are fine - C++, Python (>=2.5), C#, Java. The program shouldn't require any third-party libraries other than the chosen language's standard libraries, and should be compilable and runnable on a modern Windows or Linux development environment of your choice (e.g. MS Visual Studio, gcc, Eclipse etc). You should submit your program source code and any necessary makefiles or project files required for compilation. If you write the code in C++, using C++11 features is fine.
I need to be able to find every possible permutation using all possible values of a char. But I have to make it be able to form permutations from a length of 1 to variable N. For example, if N=3, I need it to be able to come up with
0x00
0x01
.......
0x00 0x00
0x01 0x01
.......
0xff 0xff 0xfe
0xff 0xff 0xff
How could I do this. (I would like to avoid recursion, since N might be as large as 50 or 60 and using recursion would most likely cause a stack overflow)
How can I find each and every pixel in a circle so that I can do some operations on it.
View 6 Replies View RelatedI know how to find find ASCII value of given character, but I am not getting how to find ASCII value of given string. For example I want to find ASCII value of string "HELLO",so how to do that.
View 13 Replies View RelatedJust wondering about how to write extremely simple version of 'find' in C: It just lists the path names of the files in the specified directories and all subdirectories.For example,
Code:
$find_version .
./foo
./bar
./baz
./baz/other
[Code]....
I got a code written in Java. But, I gave up writing code in Java. The program written is supposed to find the maximum subsequence sum. It's originally like this.
Code:
private static int maxSumRec (int [] a, int left, int right)
{
if(left == right)
if(a[left > 0])
return arr[left];
[Code] .....
I turned it into C, add some elements (to generate random numbers and change some variables' names), and becomes like this
Code:
int maxSumRec (val, left, right)
{
int x;
long int arr[val];
srand ( time(NULL) );
for(x=0; x<val; x++)
[Code] .....
It fails to compile. What have I done wrong? And I keep wondering why in the original code there is left and right variables and their values are never assigned. My c compiler (I use codeblocks) keeps telling me that. Idk why. My friend who keeps it in Java says it is fine but he cannot explain how his program works. What *is* left and right actually?
The method doesn't work properly, the point of the code is to tell the minimum value in the given matrix "m", it's supposed to take the first value of the matrix store it in min_ and then compare it to every value of the matrix, if the value stored in min_ is bigger than the current value in the loop then it's stored as the new min_ and at the end it's supposed to print that minimum...
Code:
#include <stdio.h>
#include <stdlib.h>
#define SIZE 3
void minimum (int mat[SIZE][SIZE]){
int r,c;
int min_;
printf("
[Code] ......
Any way to determine the highest value of an array I created with random numbers. I am confused because the array needs to be initialized in the main, but populated in a function. I was able to populate it using a pointer variable and my results came out good for the initial array values and elements.
In order to figure out the max, I think I would need the results of the populated array. How do I do this when the populated array is stored in a pointer variable? Would I need to create a pointer to the first pointer I created? I tried creating another pointer to the initial array and printing that, but my results were not good.
Code:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
[Code].....
I am entering numbers to float ... I want program to find out, which first number is not from specific interval. How to do it ? Example: Enter input : 5 10 20 30 50 46 . 30 is invalid. Here is the code :
Code:
while(scanf("%f",&input)!=EOF || input==0) {
sum=input+sum;
if (getchar() == '
[Code]....
I want to find the remainder of the division between a and b, but without using the reminder operator a%b.I thought to subtract b from a as long as a>b, that will give the remainder, but I don't know how to write it in code.
View 11 Replies View Related