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>!

Trying to make it simple

Ask ALL your questions here

Trying to make it simple

Postby tsimpson on Thu Nov 05, 2009 12:32 pm

If you was to look at this programe and read what I wrote to explain what the lines are suppose to do would it make sense to you? And if not how would you make it better?
Code: Select all
#include <iostream>
#include <windows.h>

using namespace std;

int main ()
{
   int number;
   int count;
   
   for (number=0; number<10; number++) //this loop will run up to 10 times then stop
   {
      for (count=220; count<=415; count++) //frequency will start at 220Hz and end at 415Hz increasing one Hz at a time
      {
         Beep(count,5); //lengh of beep in milisecounds
      }

        for (count=415; count>=220; count--)//frequency will play downwards from 415Hz to 220Hz
      {
         Beep(count,5);
      }
   }

return 0;  //end of program
}
tsimpson
 
Posts: 17
Joined: Sun Oct 18, 2009 7:27 pm

Re: Trying to make it simple

Postby noobgrammer on Thu Nov 05, 2009 1:32 pm

I had to change the duration from 5 to at least 50 for it to work for me

I am running Windows 7 64bit so it runs through my sound card and not my motherboard so it may be different on a different system

but it did rise and fall for me so that part works
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: 193
Joined: Tue Aug 25, 2009 10:44 am
Location: Orlando

Re: Trying to make it simple

Postby tsimpson on Thu Nov 05, 2009 1:35 pm

I had to make improvments to this programe as well and I too changed the milisecounds from 5 to 50. I also changed the stepping seqence from +1 to +20.

If you read the explination part, the bit that comes after // does that make sense?
Last edited by tsimpson on Sat Nov 07, 2009 8:03 am, edited 1 time in total.
tsimpson
 
Posts: 17
Joined: Sun Oct 18, 2009 7:27 pm

Re: Trying to make it simple

Postby glinka57 on Thu Nov 05, 2009 5:22 pm

LOL LOL LMO LMOA LMAO AO AO LOL

EDIT: I was going to leave the above line as my answer without looking at your code. BUT WHOLY SMOKES KID
THATS AWWWWWSOME hahahahahhaahah.

add to this

post2267.html#p2267

and ...
ROCK ON!!!!!
User avatar
glinka57
 
Posts: 178
Joined: Fri Feb 27, 2009 7:32 pm

Re: Trying to make it simple

Postby tsimpson on Sat Nov 07, 2009 8:01 am

Just looking at what I wrote and boy I really need to use a dictionary.
tsimpson
 
Posts: 17
Joined: Sun Oct 18, 2009 7:27 pm

Re: Trying to make it simple

Postby noobgrammer on Sat Nov 07, 2009 8:29 am

if you were asking about if you commenting well on it then yes the comments said plenty and explained well what was happening
on something this small you really didn't need to make any comments the code spoke for it self
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: 193
Joined: Tue Aug 25, 2009 10:44 am
Location: Orlando

Re: Trying to make it simple

Postby tsimpson on Sat Nov 07, 2009 1:32 pm

well I'm glad the comments made sense
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

cron