C++ :: Implement Source Code That Turns Numbers Into English Text
Apr 18, 2013
I have been working on the same problem as mp252 from an earlier thread and 4 days later, I appear to have it working. Mine only goes from 0-9999 though as I must move on!
Code:
#include <iostream>
#include <string>
int getThousands(int number);
int getHundreds(int number);
int getTens(int number);
int getUnits(int number);
void printNumber(int number);
[Code]......
I had a scrap of paper like a mad scientist trying to find relationships between numbers and the values that they would return through my functions. This is how I arrived at the conditions of my if statements in 'void printNumber'.
I have seen other code that allows a greater range but I can't quite follow it (yet):
C++ code by fun2code - 67 lines - codepad
View 1 Replies
ADVERTISEMENT
May 13, 2014
im trying to write a source code that find the smallest, largest and average of numbers in array. the code runs fine, but it is not giving the highest number and the the average should include only four number excluding highest and smallest number from the array.
void OlympicJudging() // Olympic Judging {
int numbers [6];
double average, sum = 0;
int temp;
for(int i = 0; i < 6; i++){
cout << "Please type a value for scores: ";
cin >> numbers[i];
[Code]...
View 5 Replies
View Related
Dec 8, 2014
I need to covert English to Morse code and vise versa. I found English to Morse however I cant figure out Morse Code to English. When it runs it read the first character of Morse Code but not the rest so .- would be outputted as ab.
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <math.h>
#include <cctype>
#include <string>
using namespace std;
string texttomorse(char l) {
[Code] ....
View 7 Replies
View Related
Feb 4, 2015
I'm working on this program that I have to design a class Numbers that can be used to translate whole numbers to the English description of the number.
Now this is what I got so far:
#include <iostream>
#include <string>
using namespace std;
class Numbers {
private:
int number;
static string ones[];
static string tens[];
[Code] ....
The program seems to work. However its not giving me the right number description,
Example:
Please enter the amount you would like translated into words: 5
six dollars
please enter another number: 10
eleven dollars
please enter another number: 20
thirty dollars
please enter another number: 30
forty dollars
please enter another number: 100
two hundred dollars
please enter another number: 150
two hundred sixty dollars
please enter another number: 500
six hundred dollars
please enter another number: 1000
two thousand dollars
please enter another number:
View 4 Replies
View Related
Jan 13, 2014
i need a program which can convert numbers you enter into their respective words till 1 million.
View 19 Replies
View Related
May 4, 2014
I am making a game and want to make an updater that grabs the source code from a page on the web. Can this use things that are available to all platforms? It could just be something that grabs the text from the page and executing it (maybe using something like Python's exec() command ?) BTW I'm using mac
View 1 Replies
View Related
Oct 14, 2014
I want to start developing Android apps in C++, but I do not know what I could use to compile the source code into an apk. I know that C++ is probably not the best choice for Android development, but I already know it and I do not want to learn Java.
View 4 Replies
View Related
Dec 16, 2013
Is there source code for LZW decompression in C++ available? Not C.
I'm looking for an implementation of the LZW decompression algorithm in C++ which can take an input buffer and not a file. if one exists?
View 6 Replies
View Related
May 23, 2013
I'm trying to write a program that prompts the user to enter a math expression (i.e 2*x + x*x) and a value of x. Then generate the value of y. My real question is: Is there a way to put the content of a string into the source code?
Example:
string math_function;
double x, y;
cout << "Enter the function: ";
getline(cin, math_function);
[Code] .....
View 4 Replies
View Related
May 24, 2013
For example, if one researched how to deep copy a map container and paraphrased a solution from a website, what is the proper format? Are there standards for citing works in code?
I am currently only citing the link to the source in my personal code and explaining what algorithm the source contains.
View 4 Replies
View Related
Sep 4, 2013
I use a programming language called layout which nobody here has probably ever heard of. It was discontinued over 15 years years ago but it was a very visual & easy to use piece of software - no coding required. In fact once you name all the variables on cards (forms) from then on it's just mouse clicking & occassionaly typing a number if required. It used blackboxes in a flowchart arrangement which were pre-done code for doing just about anything. i.e opening windows, handling numbers & text, files etc. I have written many programs with it including database management, quoting software & currently use it in my business to track my jobs & do invoicing & ordering. It's a pity it wasn't updated & still around today.
[URL]
Back to the problem. Being a 16 bit program it was written to run on Windows 3.1 but still works on Windows 7!! as long as it is the 32 bit version. I need to write a program that will run on 64 bit W7 without resorting to using a virtual PC solution. I have tried to find something similar that I might be able to use instead but so far nothing comes close to Layout. I just remembered today that layout can produce not only .exe programs but also various versions of C/C++ including visual c++. So I got this idea that if I could get those files I might be able to stick them into a C compiler program to re-make a "modern" exe file.
I could just do a simple sample program & send the source code to them to see if it works on a 64 bit version of Windows 7. how I can do this myself to produce a working exe file.
View 5 Replies
View Related
Mar 9, 2015
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
struct stock{
char symbol[5];
int quantity;
float price;
[Code] ....
- In the final output
Value
%.2f
- How is the final pointer reference at line33 leading to the output %.2f ? (i do understand that the %% is used to display a %] ....
View 1 Replies
View Related
Apr 6, 2014
I'm attempting to write the maximal clique algorithm for use with an adjacency matrix.I'm following a video which explains how to code and implement the algorithm using python. I want to write it for c++. URL....I'm currently trying to code the powerset function at 2 minutes into the video. I'm not sure if I should be using arrays or not.
So far I have coded the below but I dont know how to return an empty array inside an empty array (when the elts list is of size 0). I wrote an isEmpty function for the array since I cant use len(elts) like in python.
bool empty = true;
bool isEmpty(int elts[]) {
for (int z=0;z<10;z++) {
if (elts[z] != 0) {
cout << elts[z] << endl;
empty = false;
[code]....
The code should use either an array/list/vector that we call 'elts' (short for elements). Then firstly, it should add the empty list [], then the rest of the power set (all shown in the video).So for example, in the case that elts = [1,2,3,4], my code should return:[ [],[4],[3],[4,3],[2],[4,2],[3,2],[4,3,2],[1],[4,1],[3,1],[4,3,1],[2,1],[4,2,1],[3,2,1],[4,3,2,1] ]
View 2 Replies
View Related
Jun 10, 2013
How to make a source code into a functional program that a user can open and use without coming across the source code and building or running it.
View 1 Replies
View Related
Jun 9, 2013
I know it sounds strange but I've seen things that have files which contain source code (usually in something in Python or such) and how this is read on run-time?
View 1 Replies
View Related
Oct 9, 2013
I am working on VS2008. I have two separate projects which have almost same functionality along with same file names but few are different. So I decided to use the same .cpp and .h files for both the projects. Both are Dialog based applications.
So what I did is I merged the source code changes to one by using #ifdef XXXX in all the common .cpp and header(.h) files.
I also moved the .rc file and .vcproj file to other project (As they were of different name).
The problem is with the resource.h file, as it is the file with the same name in both the project. By using #ifdef XXXX in .cpp files the compilation is working file but here in resource.h the resource is getting corrupted and the diglogs are not getting displayed.
how to merge two resource.h files to one.
View 2 Replies
View Related
Jan 22, 2013
I'm trying to find a C library for automating mouse clicks and keystrokes, something like the Python package AutoPy would be ideal.
Might have heard of Auto-it [URL] ...., which automates GUIs in Windows. Something like that would also be good, but my main OS is Linux.
I'm not sure whether it would be possible to create a shared library from the C source code in autopy.
View 4 Replies
View Related
Apr 19, 2014
How to compile this source code and make a binary file
I think this need linux and run make command or gcc
This binary is a super user for android
source code attached
Attached File(s) : su.zip (7.59K)
View 3 Replies
View Related
May 6, 2013
I am stress testing my webservers and I need to code or port a C++ HTTP GET flood onto this C++ bot sourcecode. I believe I will need GetTickCount so I can specify the duration of the flood as well. I already have the C++ HTTP Flood .cpp and .h files but have no clue how to put it together onto this source. This will be easier to do over Teamviewer as I'm already using C++ 6.0 and have been with no issues.
View 14 Replies
View Related
Mar 2, 2013
Code:
#include <iostream>
#include <windows.h>
#include <iomanip>
using namespace std;
[Code] .....
I'm trying to implement Morse code program. However, I cannot find any codes which make a time gap between the letters. How the time gap code?
View 4 Replies
View Related
Oct 18, 2012
I need to have Ufasoft Miner source code modified so it's rendered undetectable to antivirus software. The source code is located here: [URL]
It's programmed in C++.
We have other unrelated projects after this, that you might apply to.
View 2 Replies
View Related
Feb 9, 2014
Writ a program to implement hashing of text files in a directory to find files with the same content?
View 1 Replies
View Related
Nov 22, 2013
Im trying to implement a way to use really big numbers to be able to add, substract and multiply them with the class I made. for example:
huge a = "45646464646455464654656"
huge b = "456464564646544646"
huge c = a+b;
[Code]....
View 13 Replies
View Related
Jun 30, 2014
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
int turn = 1;
int counter = 0;
int t, n;
[Code] ....
I found this program in a forum and it creates 1 to t threads with each thread pointing to the next and the last thread pointing to the first thread and it allows each thread to sequentially take a turn until all threads have taken n turns. That is when the program ends.
My doubt is if we see in void *tFunc(void *arg) function, first thread locks the mutex and then wait there forever till it's turn comes.Lets say if I spwan 1000 threads and they have take 10 turns each sequentially and what if a 550th thread locks the mutex as soon as the program starts and waiting for its turn which will never happen because still (turn=1) which means it's first thread's turn and first 549 threads have to complete their 1st turn before this 550 threda's turn comes.Doesnt this result in deadlock?
View 2 Replies
View Related
Dec 3, 2014
I need to write a widget that will implement some matrix functions using data from a text file. The input data will be spreadsheet like and fully determined with complete rows and columns. I need to do the following,
1. populate a data structure with the input data (double) to create matrix x
2. transpose the input data matrix x to create x'
3. multiply x * x' to create a square matrix x'x
4. take the determinant of x'x
This is pretty standard linear algebra, but not something I have done in cpp before. Implementation such as the best data types to use to store each of the three matrices, how they are sized, and what library functions may be available for the matrix functions like transpose, multiply, determinant, etc.
I will be removing each data row from the initial input to observe the effect on the determinant in case that has any effect on program design.
View 5 Replies
View Related
Sep 19, 2013
I got an assignment at school asking for a program that can implement functions that store, get and deletes text/binary data to a given memory area. We are supposed to make kind of like a tiny-mini OS..any links to some tutorials or explanations hon ow to understand this and be able to make a program like this on my own?
View 9 Replies
View Related