473,785 Members | 2,310 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

a program which rang a bell at certain at certain moments

84 New Member
I was asked to make a program which rang a bell at certain at certain moments. The one way i can think of making it is by using a loop, but i should try to avoid using it and i don't have any idea. I thought of looping, and when the time matched with the specified one, it rang the bell. I do not have it clear how to make it ring. They told me that i had to think of how to develop the program and they would think of how to make the bell ring when i returned 1 or 0. This is the thing: if main() returns any number, the program finishes...!
Any ideas...??? Help is really much appreciated
Apr 11 '07 #1
12 2040
RedSon
5,000 Recognized Expert Expert
Using a good, clear thread title is important. The reasons for this are:

* We want this site to grow, many of our new members find the site using a search engine, by using a good thread title you will help us grow the site by helping us get better search engine rankings.
* Using a good title will benefit you too because other members of the forum will be less likely to skip over your thread and it allows the experts to quickly scan through the forum for questions they know the answer to.
* If the threads are well titled it allows other users to easily see if there have been any threads that could be relevant to their own current problem.
* It is in everybody's best interests to post properly titled threads as the more time the moderators have to spend on managing titles the less time they have available to give answers to the questions posed.

-MODERATOR
Apr 11 '07 #2
Banfa
9,065 Recognized Expert Moderator Expert
What platform and operating system are you using?
Apr 12 '07 #3
JosAH
11,448 Recognized Expert MVP
What platform and operating system are you using?
And maybe even more important: what bell?

kind regards,

Jos ;-)
Apr 12 '07 #4
bluesteel
84 New Member
And maybe even more important: what bell?

kind regards,

Jos ;-)

I was told to make a program give a device either zero or one at appropiate moments. The bell is supposed to ring when it's one (don't worry about how to make the bell react, it is out of my responsibility) . It should work under WXP
Apr 16 '07 #5
Banfa
9,065 Recognized Expert Moderator Expert
If it needs to work under Windows XP then just create a program with a Window (can be invisible if you do not want to be able to see it).

Then set a timer going at an appropriate frequency using SetTimer.

Whenever the timer goes off get the current time using GetSystemTime, compare that to when you wish to have the bell go off and if it is the right time output your 1.
Apr 16 '07 #6
bluesteel
84 New Member
If it needs to work under Windows XP then just create a program with a Window (can be invisible if you do not want to be able to see it).

Then set a timer going at an appropriate frequency using SetTimer.

Whenever the timer goes off get the current time using GetSystemTime, compare that to when you wish to have the bell go off and if it is the right time output your 1.
That's the point. How do i give a device an output?
Apr 17 '07 #7
Banfa
9,065 Recognized Expert Moderator Expert
That's the point. How do i give a device an output?
Depends what the device is and how it is connected to the computer.
Apr 17 '07 #8
JosAH
11,448 Recognized Expert MVP
Depends what the device is and how it is connected to the computer.
Also see my reply #4 again ;-)

kind regards,

Jos
Apr 17 '07 #9
bluesteel
84 New Member
And maybe even more important: what bell?

kind regards,

Jos ;-)
The bell is not what i should worry about, it should be conected to the parallel port, then i'll tell the other people which cable(s) will be returning the 1.
I should make a program which does everything, i mean that i should have to open the program and the program would do everything for me. That means not needing to use windows xp scheduler, at least not manually. Thanks for your help. Please ask for clarification if there's something i forgot to write.
Apr 18 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

5
3095
by: Tyler | last post by:
Hi ppl, I know it's forbidden to mention Java in this newsgroup but I've been presented with a problem which requires that my C++ program communicate with another java program. What is the best,simplest and quickest way to go about this? I was thinking, I could have my C++ program write data to a file and then my Java program pick it up from there but this is a little too
7
1998
by: Dave Hammond | last post by:
You'd think this was an occasionally asked question, but a search for previous related posts only turned up one from 1999, and that one was never anwered. So... When handling a keypress event, the terminal bell always rings (at least with Internet Explorer). While it's not a show-stopper, it can become annoying. Anyone have any tricks to silence the bell? Thanks in advance!
2
2317
by: MLH | last post by:
This question, I apologize, is more of a math question than it is an Access question - I'm almost certain. The bell curve is another name for the normal distribution, which is a common type of graph that has more or less the shape of a bell. "The Bell Curve" was also the title of a book, a controversial book back in 1994. It was about intelligence. If you graph scores on an IQ test on the horizontal axis, and number of people who got...
1
1686
by: jessebasketball | last post by:
i am a very beginner programmer and am stuck on a very simple problem. I am trying to make a game where the user is presented with a scenerio and options. ie you are standing in the parking lot a.run b.go home c.stay there when a option is selected a new option is presented.
7
2597
by: tiger786 | last post by:
I am new to programming and studying basics in college .Can somebody write a program on this? The program should monitor a possibly infinite stream of characters from the keyboard (standard input). If it detects the sequence "ccc" it outputs a "0". If it detects the sequence "cdc" it outputs a "1". DO NOT detect sequences within sequences. The program should exit cleanly when it detects an End Of Input. For example:
6
6857
by: Csaba Gabor | last post by:
Is there a way in Mozilla/Firefox to ring the bell? For example, in Emacs or Notepad (on my Win XP Pro system) if you enter certain shortcuts (e.g. ^g or ^q, respectively), you get a sound to let you know that from the app's point of view, something unexpected happened. Can I accomplish something similar in FF with javascript or via the keyboard? Thanks, Csaba Gabor from Vienna
3
13608
by: Josh | last post by:
I want to get the ASCII Bell character (7) as a string. How? I'm pulliing my hair out over the stupid little task. HELP!!!!!!!!! ARRRAGGH! -- #####-----#####-----##### POV Tips and Hints at ... http://povman.blogspot.com/
24
6589
by: John | last post by:
I know this is a very fundamental question. I am still quite confused if the program call stack stack should always grows upwards from the bottom, or the opposite, or doesn't matter?? That means the stack pointer should go upwards when there are "push" operations, and stack pointer should go downards when there are "pop" operations?? If this is the case, the address should go upwards (increasing) or downards (decreasing) then? i.e....
11
1639
by: Steven D'Aprano | last post by:
I'd be interested in hearing people's stories of Eureka moments in Python, moments where you suddenly realise that some task which seemed like it would be hard work was easy with Python. I had a recent one, where I had spent some time creating a function which took a list as an argument, and then rearranged the items according to what magicians call a Monge shuffle. I had started off with a piece of code that walked the list, dropping...
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10161
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9958
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8986
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5523
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4058
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2890
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.