|
Ev3nflow wrote: ...I take it I have gone wrong by using this statement printf("\n\n\t\tThe total cost%31.2f "); in my code...
Not by using it, but by using it incorrectly. If you were a compiler and I handed you that same statement, what would you print?
Ev3nflow wrote: ...but i'm not sure how to make it right
See here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
printf("\n\n\t\tThe total cost%31.2f ",pay);
|
|
|
|
|
Hi thanks for your help. I have fixed it now, I have pasted my working code below so you can see what I have changed. I think your way would of worked as well.
#include <stdio.h>
float premium=1.5,standpayrate,overtime,pay,hours,;
int main()
{
printf("\n\n\t\tPayroll report ");
printf("\n\n\t\tEnter standard rate of pay ");
scanf("%f",&standpayrate);
printf("\n\n\t\tEnter number of hours in a week ");
scanf("%f",&hours);
printf("\n\n\t\tEnter the number of over time hours worked ");
scanf("%f",&overtime);
getchar();
pay=standpayrate*(hours+premium*overtime);
premium=pay;
printf("\n\n\t\tThe total amount payable %15.2f",premium );
getchar();
}
|
|
|
|
|
Ev3nflow wrote: float premium=1.5,standpayrate,overtime,pay,hours,;
Moving these global variables to be local to the main() function would not change anything, but they are usually not a good idea to use. For larger projects, they could indeed cause you grief.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
From DavidCrow:
#include <stdio.h>
int main()
{
float premium=1.5,standpayrate,overtime,pay,hours,;
printf("\n\n\t\tPayroll report ");
|
|
|
|
|
Hi
I tried to use "GetGlyphOutline" to get a Unicode true type outline (curve) data. But the plotted char was rotated by 90 degree. What is wrong ?
Best regards,
modified on Tuesday, October 20, 2009 3:31 PM
|
|
|
|
|
Hi transoft,
Is the font a vertical font? Is the first letter of the font name '@'?
Best Wishes,
-David Delaune
|
|
|
|
|
Thank you very much for reply. I think it is a vertical font. I tried other font, it shows OK.
Best,
|
|
|
|
|
Hi all, I've got some serious Googling ahead of me but I was hoping some of the experts in here could point me in the right directions.
I have a fairly exciting (but daunting) opportunity to develop software for the identification of bird calls. I am daunted because pattern recognition is a field I know little of and have virtually no experience with. I have used SAPI before for a basic TTS implementation but this, I imagine, will be significantly more complicated.
So, I'll be grateful for any advice anyone can dispense. I'll probably be doing the development in C++ so I'd be particularly interested in resources available to C++ programmers. Is SAPI the way to go? I am also specifically interested to know if there are any specific concepts in speech recognition that might be applicable to a solution that is concerned with the recognition of sounds such as bird calls (ie. no grammar to speak of, no sentences, just individual sounds ranging from say 2 seconds to 10 seconds in length).
Eagerly, awaiting your comments and suggestions.
|
|
|
|
|
I did a project to recognize bird sounds in the past.
Speech recognition software can be used for this task, but you need to change ASR front-end
to cope with bird sound vocalizations.
What type of birds do you want to recognize?
Luis
ASR Labs
http://www.asrlabs.com
|
|
|
|
|
Hi Luis,
Thanks for the response. The project hasn't been spec'ed fully yet but I would imagine that the expectation is for the software to recognise bird calls ranging from small Warblers with high pitched chattering to Crows with their harsh squawks and everything in between. In total there will be something in the order of 600 to 700 species that need to be identified. I'm not sure yet over how many phases the project will stretch but, if I complete phase successfully I can probably position myself well to see the project through to the last phase.
Ultimately I think the idea will be that a user can record a bird call in the field, using his PDA for instance, and then have the software immediately identify the bird based on the call, or at least give a short list of most likely candidates.
I'm glad to hear that someone else has done something similar already and that you can confirm that Speech Recognition can be used for this application. I would love to hear more about the project you did.
Regards,
Déwald Swanepoel
|
|
|
|
|
Déwald Swanepoel,
I worked with Amazon sound birds to set up a demo for a client.
Client didn't buy project, but demo worked for 4 types of birds
with a very high accuracy.
PLP was used as a front-end, but it is necessary to change some
parameters to cope with high pitch, etc. It is an experimental
jobs to set these parameters.
Luis
ASR Labs
http://www.asrlabs.com
|
|
|
|
|
Could you explain PLP perhaps please? The only PLP I know of was something like Packet Layer Protocol from way back when I did some work on X.25. Obviously you're referring to something different.
Would you mind if I contact you off list with some specific questions? You seem to have some experience of ASR and specifically bird call recognition and I'm sure you'd be able to answer most of my questions without too much effort. I'll leave you alone then 
|
|
|
|
|
Send me an email at:
luis uebel at g m ail d ot com
Please remove spaces, just to reduce spams.
|
|
|
|
|
PLP is a type of speech recognition feature vector.
Please send me your email to contact you.
Luis
|
|
|
|
|
Would you to post your project here?
I am sure there are a lot of interested in Speech recognition.
Thanks,
|
|
|
|
|
Im having problem with the output of this program that i made that supposed to count the numbers of successful a's and b's based on the pattern indicated in my condition.
*********************************************************************
#include<iostream>
using namespace std;
int main()
{
int lookahead;
int q1=0, q2=0, q3=0, q4=0, q5=0, q6=0;
int count_a=0;
int count_b=0;
while((lookahead = getchar())!='.')
{
switch(lookahead)
{
case 'a':{
if(q1==0 && q2==0 && q3==0 && q4==0 && q5==0 && q6==0)
{
q1=0;
q2=1;
q3=0;
q4=0;
q5=0;
q6=0;
}
else if ( q1==0 && q2==1 && q3==0 && q4==0 && q5==0 && q6==0 )
{
q1=0;
q2=1;
q3=1;
q4=0;
q5=0;
q6=0;
}
else if ( q1==0 && q2==1 && q3==1 && q4==0 && q5==0 && q6==0)
{
q1=0;
q2=0;
q3=0;
q4=0;
q5=0;
q6=0;
count_a++;
}
else if ( q1==0 && q2==0 && q3==0 && q4==1 && q5==0 && q6==0)
{
q1=0;
q2=1;
q3=0;
q4=0;
q5=0;
q6=0;
}
else if (q1==0 && q2==0 && q3==0 && q4==1 && q5==1 && q6==0)
{
q1=0;
q2=1;
q3=0;
q4=0;
q5=0;
q6=0;
}
}
break;
case 'b':{
if(q1==0 && q2==0 && q3==0 && q4==0 && q5==0 && q6==0)
{
q1=0;
q2=0;
q3=0;
q4=1;
q5=0;
q6=0;
}
else if ( q1==0 && q2==0 && q3==0 && q4==1 && q5==0 && q6==0 )
{
q1=0;
q2=0;
q3=0;
q4=1;
q5=1;
q6=0;
}
else if ( q1==0 && q2==0 && q3==0 && q4==1 && q5==1 && q6==0)
{
q1=0;
q2=0;
q3=0;
q4=0;
q5=0;
q6=0;
count_b++;
}
else if ( q1==0 && q2==1 && q3==0 && q4==0 && q5==0 && q6==0)
{
q1=0;
q2=0;
q3=0;
q4=1;
q5=0;
q6=0;
}
else if (q1==0 && q2==1 && q3==1 && q4==0 && q5==0 && q6==0)
{
q1=0;
q2=0;
q3=0;
q4=1;
q5=0;
q6=0;
}
}
break;
default:{
q1=0;
q2=0;
q3=0;
q4=0;
q5=0;
q6=0;
}
}
cout<<"\n count_a :"<<count_a;
cout<<"\n count_b :"<<count_b;
}
return 0;
}
*****************************************************************
when i didnt enter any letter the output is:
count_a: 0
count_b: 0
when the letter increase the number of count display multiplies too and it shouldnt'..
like this; input words "aaa"
count_a: 0
count_b: 0
count_a: 0
count_b: 0
count_a: 1
count_b: 0
count_a: 1
count_b: 0
Where do you think is the problem on my codes?
modified on Tuesday, October 20, 2009 2:00 PM
|
|
|
|
|
Please post such code with the code block.
|
|
|
|
|
done ^_^... sorry newbie here
|
|
|
|
|
What should be the exact output for input "aaa" ?
Have you tried "running" this on paper ? ie. do all of the operations on paper with a pencil ? follow each step manually.
Did you try debugging, i.e. stepping in the code after each getchar ?
Put a breakpoint at the switch and try following what is happening.
good luck.
This signature was proudly tested on animals.
|
|
|
|
|
the exact output for "aaa" should be"
count_a: 1
count_b: 0
Its a program for a Finite State Machine that accept a language that has 3 consecutive letters in the end.
Thats the diagram.
<a href="http://s137.photobucket.com/albums/q222/riel_tp/?action=view¤t=no_1.jpg" target="_blank"><img src="http://i137.photobucket.com/albums/q222/riel_tp/no_1.jpg" border="0" alt="no_1"></a>
*** I'll try to do what you said... ***
Thanks, pls check the above details too ^_^
|
|
|
|
|
songryong wrote: Its a program for a Finite State Machine...
I've never seen an FSM that looks like this. How about something along the lines of:
void state0( void )
{
if (buffer[pos] == 'a')
{
pos++;
state1();
}
else if (buffer[pos] == 'b')
{
pos++;
state3();
}
}
void state1( void )
{
if (buffer[pos] == 'a')
{
pos++;
state2();
}
else if (buffer[pos] == 'b')
{
pos++;
state3();
}
}
...
void state5( void )
{
valid = true;
}
void main( void )
{
state0();
if (valid)
cout << "Valid" << endl;
else
cout << "Not valid" << endl;
}
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
The diagram is... it was given to us to confirm the language the machine accept through this program if its valid or not....
hhmmmm im still 2 months old in c++ .... so i need to study the codes you have given to me above...... thanks a lot for your help ^_^
|
|
|
|
|
songryong wrote: The diagram is... it was given to us to confirm the language the machine accept through this program if its valid or not....
There was nothing with the diagram. It was your implementation of it that I had trouble with.
songryong wrote: hhmmmm im still 2 months old in c++...
Other than using cout , the code snippet I showed was plain C. No objects were used or are required.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
i haven't used some of those codes before..
sorry for the bad implementation. I'll see what i can do with it.. thanks for your help... i realize what i need to do with it.. ^_^
|
|
|
|