C/C++ :: How To Make Food Ordering Program Utilizing Voice Commands
Apr 19, 2014
I was interested in making a food ordering program utilizing voice commands. I hope to build a GUI with items listed on one side, and with voice commands picking up on key words that will add the food to the right of what you chose.
View 4 Replies
ADVERTISEMENT
Mar 1, 2013
I just started my task with Ordering system. what should I use if I'm going to ask the user if he wants to exit the system, he will press(zero)0 to exit the program and press Y(uppercase or lowercase) to continue?
View 1 Replies
View Related
Aug 1, 2013
I've read that we can write a program that displays a menu of commands for the user to choose from.We can write some functions that implement these commands, then store pointers to the functions in the array :
Code:
void ( *file_cmd[])(void) = { new_cmd , open_cmd }; // 2 cmd's for simplicity
We can get a similar effect with a switch statement but using an array of function pointers gives us more flexibility since the elements of the array can be changed as the programm is running.
I decided to write an example about this in order to understand better the context, I am facing some problems though :
Code:
#include<stdio.h>
#include<stdlib.h>
typedef void (*p_foo) (int);
void foo(int x);
void foo2(int y);
[Code] .....
The problems are :
Code:
TEST2.c:9: warning: initialization from incompatible pointer type
TEST2.c:9: warning: initialization from incompatible pointer type
TEST2.c:25: error: too few arguments to function "*(arr + (long unsigned int)((long unsigned int)i * 8ul))"
View 14 Replies
View Related
Sep 15, 2013
I'm writing a program to turn the two commands "gunzip file.tar.gz" then "tar -xvf file.tar" into "x file.tar.gz", but I've ran into a problem I can't find a solution to, here are the outputs I get depending on if I use a gunzip -f flag in my system() call or not:
if I use: (void)system("gunzip ", store );
> x file.tar.gz
gzip: compressed data not read from a terminal. Use -f to force decompression.
type: gzip -h
store 1: file.tar.gz
tar: option requires an argument -- 'f'
[code]....
I don't know if the problem is something to do with my code or something to do with gunzip and if it is to do with gunzip if I can even solve it with my code? I've tried for a while to find more info and read the gunzip man file, ran "gunzip file.tar.gz" outside of my program and found that it works normally producing file.tar so I suspect the problem is related to system()?
View 3 Replies
View Related
Feb 19, 2014
I want to make a program, which should take input from microphone, do speech recognition and then match the input keyword against a list and print the value. Whether it is possible and how.
View 1 Replies
View Related
Dec 7, 2013
I'm new to c i've been trying to write code everyday, and recently ive been reading a book and decided to write my own program with what ive learned with it, basicly you get a choice for how many different main courses you would like to have (right now you can only choose 1) and then you can choose which course you would like, it then asks for the amount of guests you would like and calculates how much food you will need to feed the guests. My code compiles but the program doesn't work properly
Code:
#include<stdio.h>
float guests;
float lbs;
int guest_att(guests)
{
puts("how many guests will be attending?");
scanf("%d",& guests);
[Code] .....
and this is how the program runs
Code:
Scotts-MacBook-Pro:learnc scott$ ./wed
how many main course choices will you have?
1
Please make a selection.
1. Chicken
2. Fish
3. Steak
invalid choice
Please make a selection.
1. Chicken
2. Fish
3. Steak
1
how many guests will be attending? 55
You need 0.000000 pounds of of chicken
Please make a selection.
1. Chicken
2. Fish
3. Steak
invalid choice
Please make a selection.
1. Chicken
2. Fish
3. Steak
View 3 Replies
View Related
Apr 13, 2014
This code i made, utilizing the type casting construct, isn't outputting what i wanted. The output for 'Dollars' and 'Cents' are returning '0' for both. instead all i want it to do is seperate the two. for example changing the float value of amount to an integer, giving a dollar value.
Code:
#include <stdio.h>
int main()
{
}
[code]....
View 1 Replies
View Related
Dec 28, 2013
All day long I tried figuring out how to setup VOCE [URL] ....
I am using VS 2010.
What I did:
* Downloaded JDK
* Downloaded the VOCE, extracted and put in c:
* Opened VS and in properties->Vc++ Direcotories:
* In Include Directories i added: C:voce-0.9.1srcc++, C:Program * FilesJavajdk1.7.0_45include, C:Program FilesJavajdk1.7.0_45includewin32
* In Library Directories i added: C:voce-0.9.1lib, C:Program * FilesJavajdk1.7.0_45lib
ALSO: I didn't get what i suppose to do with C:voce-0.9.1lib everything there * is winrars
Tried to compile a sample file and it gives me the error:
Testing.obj : error LNK2001: unresolved external symbol _imp_JNI_CreateJavaVM@12
View 14 Replies
View Related
Jun 25, 2013
This program needs to display a vertical graph of asterisks showing production for each plant in the company ...
Here is what I have so far:
***********************************
This program will read data and
display a vertical graph showing
productivity for each plant.
Reference Display 7.8 pg. 401-3
***********************************
*/
#include <iostream>
[Code].....
View 1 Replies
View Related
Jan 22, 2015
So I have a map of the form:
std::map<std::string, int> m;
I want to order this by its int value, but I don't know how to write such a function. I've had two attempts thus far:
One by using std::pair, as a map consists of pairs.
bool cmp(std::pair<std::string, int> p1, std::pair<std::string, int> p2) {
return p1.second < p2.second;
}
The other by trying to use maps, which seemed off to me at first, but I still tried it out (obviously it didn't work):
bool cmp(std::map<std::string, int> m1, std::map<std::string, int> m2) {
return m1.begin()->second < m2.begin()->second;
}
How do I write a function that compares the values of a map such that I can use it to sort the map?
View 2 Replies
View Related
Aug 2, 2014
Here's the objective of the program: "Instead of using ABCDEFGHIJ to order letters use DCBAJIHGF go order. The program should determine which 4-letter word is larger of two based on this new ordering system."
Not even sure how to start with this problem , how would I go about defining my own ordering system?
View 1 Replies
View Related
Oct 14, 2014
I have 10 or so .sql scripts (the number is likely to rise) which are required to be kept with a C# application.
For the most part the embedded resources seem to work fine , however I require a way in which to guarantee the ordering in which the files are run.
What I do currently:
Retrieve the details of the embedded resources using : Assembly.GetManifestResourceNames()
(and a bit of linq to filter based upon my requirements) which I pass to a list, I then later on use the list to grab the physical resource when its needed.
The files are named such as:
1_ScriptDescription.sql
2_ScriptDescription.sql
3_ScriptDescription.sql
10_ScriptDescription.sql <--- Here's my problem! This will come after 1_ScriptDescription.sql
Ideally I need a way in which to order the list or some kind of ordering when I pull from
Assembly.GetManifestResourceNames()
But I'm not really sure of a practical way to do this, I did consider manipulating the string .....
View 3 Replies
View Related
Nov 7, 2013
So, as far as I can tell, this code should run a system command from the C++ program:
system("ping 192.168.1.2 /t /l 32768");
However, I just keep getting a "system Was not declared in this scope" error message. Is there something wrong with this?
View 1 Replies
View Related
Apr 13, 2014
Basically it has to do with the byte ordering in a binary buffer vs the typing of a variable used to hold it.
To give you an example, if I have a buffer (say of indefinite length), and a ptr "ptr" pointing to a byte in the buffer (say, C0), such that if I open the buffer in a binary viewer it reads like this: Code: C0 DD FE 1F Such that this is true:
Code:
/*ptr is uint8_t*/
*ptr == 0xC0
Then I do this:
Code:
uint16_t var;
var = *(ptr+1);
I would expect the result to be:
Code: DD FE /*56830*/
Though if I print that out with:
Code:
printf("%u
", var);
It'll print:
Code: 65245 /*(FE DD)*/
Now obviously it's byte swapped, but what is causing that? I'm assuming if I just stream that out to a file byte by byte it'll be fine, so it's something with the 16 bit data type (also have seen this issue with a 32 bit data type, where all 4 are in reverse order). Is there any way to 'fix' it except bit shifts & masks?
View 14 Replies
View Related
Jan 18, 2015
I understand multimaps are key ordered. I have no problems with ints but when I put my char arrays in they are not alphabetically ordered. I must use char array and not <string>. Is it possible to alphabetically order them with char*
39 int c;
40 User *user;
41 char nameH[200];
42 char line[200];
43 int ageH;
44 double wH;
[code]....
View 2 Replies
View Related
May 24, 2013
I have an array in a class with some numbers in a specific order. Now I want to create a set with references to that array ordered after the arrays content. I thought a solution could be something like
class Holder {
int o[10]= {1,5,7,2,3,8,4,9,6,0};
public:
set<int,my_order> m_s;
Holder() {
for(int i=0; i<10;i++) {
m_s.insert(i);
[Code] ....
How to create the my_order.
View 9 Replies
View Related
May 25, 2014
Write a program that reads in a list of integers into an array with base type of int. Provide the facility to either read this array from the keyboard or from a file, at the user's option. If the user chooses file input the program should request a file name. You may assume that there are fewer than 50 entries in the array. Your program determines how many entries there are. The output is to be a two-column list. The first column is a list of the distinct array elements; the second column is the count of the number of occurrences of each element. The list should be sorted on entries in the first column, largest to smallest.
For example, for the input
-12 3 -12 4 1 1 -12 1 -1 1 2 3 4 2 3 -12
the output should be
N Count
4 2
3 3
2 2
1 4
-1 1
-12 4
Here's My code So far:
#include <iostream>
#include <fstream>
using namespace std;
const int SIZE = 50;
[Code]....
My Code outputs the numbers From Largest to Smallest according to given array, but I need to make it to output the numbers once(if its repeated)
View 2 Replies
View Related
Dec 9, 2014
what is the function of ordering element(char)in a struct
View 1 Replies
View Related
Jul 19, 2013
I'm trying to create an executable with C or C++ that send a command with the function system, but it waits for a command or key.
Example :
I send this:
C:
unas /noprofile user:administrator notepad.exe
But it waits for password.
Please type the password :
So my question is how can I make to send the password or that my program detect that prompt.
View 1 Replies
View Related
Sep 10, 2013
I got a assignment in which i have to write codes for execution of certain commands.
One of the command is set_time. if user enters set_time 12:12:12
The time should get reset to 12:12:12 no matter what it is now.
View 7 Replies
View Related
Nov 3, 2014
I am working on a program that does something like this,
Void main() {
cout<<"H";timedelay(1);
cout<<"E";timedelay(1);
cout<<"L";timedelay(1);
cout<<"L";timedelay(1);
cout<<"O";timedelay(1); //timedelay(int a) is a function which gives a delay of 'a' seconds.
{
....
}
}
This code is just for fancy and I would like to squish in some statements which would give the user an option to skip it (by entering any keyboard key),and resume with the rest of the program.
View 10 Replies
View Related
Sep 18, 2012
In Windows, if you open a command prompt, there are a bunch of keywords like, 'chdir', 'copy', ...
What I'm trying to figure out is how to use that COPY command in c++ code. I want to use the COPY command with the options (/a, /b, ...).
View 3 Replies
View Related
Mar 3, 2013
I made client server program with fork ,without using signal handler because I want to see the status zombie for parent server, but when i execute "ps" command i didn't see anything for server or client pid or ppid ,i wonder about how to show the server and client process coz when i execute commad "ps" i saw only ps and bash processes???
View 1 Replies
View Related
Mar 24, 2013
I'm trying to write a recursive function that takes in a vector of strings that contains
"1 forward", "2 forward", "rotate left", "2 backwards" ... etc
how can I write recursive function that creates a vector of every unique combination of commands?
View 8 Replies
View Related
Apr 7, 2010
The objective: Open and read a CSV file one line at a time using SQL commands.
The problem: I am getting an error that I have a feeling may not point to the "real" problem.
Where I may have syntax or other errors in code.
stInputConn = "Provider=Microsoft.jet.OLEDB.4.0;Data Source=V:\IT\RE\Exports\;Extended Properties="text;HDR=YES;Format=Delimited(,)"";
OleDbConnection cn = new OleDbConnection(stInputConn);
stInputFileName = ConfigurationManager.AppSettings.Get("InputFile");
// the input file name is CSV_DataExport.CSV
[Code] .....
The last line (ExecuteReader) is where I get the OleDb Exception.
View 9 Replies
View Related
Feb 12, 2014
I would like to know how can I make a simple program .exe so that I don't have to open it through code blocks every time.
View 2 Replies
View Related