I'm a student but I'm not asking anyone to do my work for me, however I would like a little help if possible please.

For part of my assignment I have to create a program that will issue a bepp of the value ( frequency and duration ) that the end user enters.

My biggest problem is my OS (Vista 64 ultimate) does not beep so I cant tell if it is woeking until I go to my lab session.

This is what I started

#include <iostream> //Input Output header for cout
#include <windows.h> //Windows header for beep
#define BYTE 8 //Constant for 8-bits in a byte
#define KByte 1024 //Constant for Kbyte
#define beep 440-659

using namespace std; //Use standard Library

int main () //Main program begins here
{
	int frequency, time;

	cout<<"Please enter the frequency value between 440 to 659\n"

Is this looking right or not please?

Recommended Answers

All 4 Replies

if you can explain

#define beep 440-659

,maybe i would be able to help you out

if you can explain

#define beep 440-659

,maybe i would be able to help you out

You're right, I need to explain better.

I am trying to keep the range between 400 Hz to 659 Hz. I'm guessing if i must i will have to put a limit on how long the beep will play for.

This is my first attempt at the program. I aint the greatest at explaining things but I will answer your questions if you have any. As I said before my O/S does not beep so I dont know if this will work until tuesday. But until then I would be greatful if some was brave enough to try it out for me. I know there are no faults but that don't mean it does what I want it to do.

/* Enter the value to Beep
Make a simple beep when a vlue is enetered (frequency_hrs, duration_ms)
<Theophilus Simpson>
<20-October-2009>  */

#include <iostream> //Input Output header for cout
#include <windows.h> //Windows header for beep



using namespace std; //Use standard Library

int main () //Main program begins here
{
	int Beep,time;

	cout<<"Please enter the frequency value between 440 to 659\n\n";
		cin>>Beep; //assign enter frequency of beep
	cout<<"please enter the time lengh for beep to play\n\n";
	    cin>>time;  //assign entered lengh of beep
	
	cin.get();
	return 0; //indicate successful end of program

}

I think this is it but wont be 100% sure until I try it on another

* Enter the value to Beep
    Make a simple beep when a vlue is enetered (frequency_hrs, duration_ms)
    <Theophilus Simpson>
    <20-October-2009>  */

    #include <iostream> //Input Output header for cout
    #include <windows.h> //Windows header for beep



    using namespace std; //Use standard Library

    int main () //Main program begins here
    {
       int beep,time;

       cout<<"Please enter the frequency value between 440 to 659\n\n";
          cin>>beep; //assign enter frequency of beep
       cout<<"please enter the time lengh for beep to play\n\n";
           cin>>time;  //assign entered lengh of beep

      Beep(beep,time);

       cin.ignore();
       cin.get();
       return 0; //indicate successful end of program
   }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.