Welcome
Welcome to the forums of AntiRTFM's Absolute N00b Spoonfeed C++ Tutorials!

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, <a href="/profile.php?mode=register">join our community today</a>!

puter dont beep pt.2

Ask ALL your questions here

puter dont beep pt.2

Postby tsimpson on Fri Oct 23, 2009 10:55 am

After trying to contact someone from windows what for some reason they want to charge you for I have decided to soilder on.

So as I said before I got to write this program-it should beep when the user enters values for time and frequency. I been looking at what I done before, track calcultaor and simple beep program and add the the two together.

so far i have came up with this
Code: Select all
#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"


#define beep 400-659 should mean that it will beep between them freqeuncies. Could anyone tell me if I am heading in the right direction please.
tsimpson
 
Posts: 17
Joined: Sun Oct 18, 2009 7:27 pm

Re: puter dont beep pt.2

Postby noobgrammer on Fri Oct 23, 2009 11:53 am

Here take a look at this site here it will give you what the beep notes are and at what frequency. I think you would want to use const instead of define but I am not a professional still a noob in training , but I think define was more a C use. I don't know if this is even possible even though it does compile

Code: Select all
#define beep 440-659


if you feel you need to call them global then maybe you could give them a note name like

Code: Select all
const short A = 440;
const short B = 494;


you could do the same with your notes duration also, give them a name

If you need somebody to test if it is working you could post your code here and ask to see if it is working for you
I need a compiler with a can of RAID built into it

I added a msn messenger just for programming feel free to email or add yourself to it
User avatar
noobgrammer
 
Posts: 198
Joined: Tue Aug 25, 2009 10:44 am
Location: Orlando

Re: puter dont beep pt.2

Postby tsimpson on Fri Oct 23, 2009 11:59 am

Thanks. Looking at it now I think I will take out
Code: Select all
#define BYTE 8 //Constant for 8-bits in a byte
#define KByte 1024 //Constant for Kbyte


and look up const. got a felling it my be a long program
tsimpson
 
Posts: 17
Joined: Sun Oct 18, 2009 7:27 pm

Re: puter dont beep pt.2

Postby Moosader on Fri Oct 23, 2009 10:19 pm

You should have posted all three of these posts together, man. They're all related and belong in the same thread.
User avatar
Moosader
 
Posts: 25
Joined: Mon Jul 06, 2009 5:31 pm
Location: Kansas City

Re: puter dont beep pt.2

Postby tsimpson on Wed Oct 28, 2009 8:00 am

Dont know I never thought of this before, but I am now going totry and dual boot my pc with xp. hope it works.
tsimpson
 
Posts: 17
Joined: Sun Oct 18, 2009 7:27 pm


Return to QA

Who is online

Users browsing this forum: No registered users and 0 guests