77 Topics

Member Avatar for
Member Avatar for charlybones

I've looked around this forum, and the rest of the internet, but my code is not working. Here is the problem: I read XML files that are in en-US culture. The decimal separator is a dot ".". Given the string "123.45", I want to convert the separator from a dot, …

Member Avatar for DOUGLAS_9
0
18K
Member Avatar for phony

` //Header file: stackADT.h #ifndef H_StackADT #define H_StackADT //************************************************************* // Author: D.S. Malik // // This class specifies the basic operations on a stack. //************************************************************* template <class Type> class stackADT { public: virtual void initializeStack() = 0; //Method to initialize the stack to an empty state. //Postcondition: Stack is empty. …

Member Avatar for tinstaafl
0
957
Member Avatar for goha1414

Write a program in object code that will convert a 3-bit binary number to a decimal number,For example, if input is 101, output should be 5; if input is 011, output should be 3. that is what I have to do,this is what I have so far but its not …

Member Avatar for saifali110
0
1K
Member Avatar for EarhawkPH

I'm having problems with this program. Everytime i enter a fractional decimal number, it displays -0.0000 or sometimes garbage values. Ex: Enter any fractional decimal number: 5.7 -2.888blah blah blah garbage another Ex: Enter any fractional decimal number: 25.7 -0.000000 #include<stdio.h> int main(){ long double fraDecimal,fraBinary,bFractional = 0.0,dFractional,fraFactor=0.1; long int …

Member Avatar for David W
0
385
Member Avatar for sundog1

Hi Guys, If you have a Text Box which you are putting in the Decimal Places such as "15.50". Then Submitting this to a Access Database then on re-fresh the data shows in the grid view as "15.5". Where abouts should this be modified so that it shows Decimal Places? …

Member Avatar for sundog1
0
3K
Member Avatar for sundog1

Hi Guys, Hope you can help. (Bit of a N00b still).. I've written an Functioning Program (Good start!) However, I was wondering if there is a way for the data that is being shown currently in the Grid view to be shown with 'Decimal Places? The Data is Being pulled …

Member Avatar for ddanbe
0
417
Member Avatar for oanahmed

I want to know how a microprocessor converts the binary digits into decimal equivalent. The processor only has the ability of manipulating 0's and 1's but, how these numbers are converted back into their decimal equivalent? Are they converted by another circuit? If so, then how and what it is …

Member Avatar for mike_2000_17
0
295
Member Avatar for ryan.jay.ong

I want to convert some numbers to binary, octal, and hexadecimal.. for example: . DECIMAL......BINARY......OCTAL.....HEXADECIMAL ................................................................... 1.................00000001.....001.......1 2.................00000010.....002.......2 And so on..

Member Avatar for AndrisP
0
176
Member Avatar for Start4me

How to give user the ability to set the decimal format rounding to whichever s/he prefers. I know that the users input can be gained by the code double decimalRoundTo; Scanner input = new Scanner(System.in); out.print(" Enter the number of decimal places you want to round to "); decimalRoundTo = …

Member Avatar for Start4me
0
2K
Member Avatar for adil.ghori

Hello ! I have a script, that i m running on visual C++ compiler everything is alright with it, working properly but in the result, I can see on one digit after decimal, not 2, i wanna display two digit i.e 31.02 ; Code is; # include <iostream.h> # include …

Member Avatar for adil.ghori
0
379
Member Avatar for beginner at c++

Write a complete, well-written, documented program (named convert) that prompts for and reads in a number with at most MAX_DIGITS (9) in one of the following four formats: binary, octal, decimal, and hexadecimal and converts it to a requested base. Once the number has been read in, you should verify …

Member Avatar for Labdabeta
0
267
Member Avatar for cherry.basilio2
Member Avatar for stultuske
0
267
Member Avatar for goha1414

Write a program in object code that will convert a 3-bit binary number to a decimal number,For example, if input is 101, output should be 5; if input is 011, output should be 3. that is what I have to do,this is what I have so far but its not …

Member Avatar for prvnkmr449
0
300
Member Avatar for calvintmoss

So I am using spim and I am trying to figure out how to take a users input say "16" and then print it as 9 digit binary number. for example 16, 000010000 or say 4, 000000100, 67 01000011 etc etc always 9 spaces and in binary. I have all …

Member Avatar for sbesch
0
379
Member Avatar for jetro57070

how do you manually convert a multi digit ascii string into the hex equilavent of a decimal integer with out using a C library function. For instance If I have a small program asking a user to type into the keyboard a decimal number and lets say they type in …

Member Avatar for jetro57070
0
7K
Member Avatar for UNDER-18 FG

Hi, I was assigned by my teacher to create a simple calculation program about movie tickets that are sold in a local movie theater. So, I created the coding, and it turned out perfect. Here it is: import java.util.Scanner; public class MovieTheater { public static void main(String[] args) { String …

Member Avatar for UNDER-18 FG
0
315
Member Avatar for deleted1234

[COLOR="Green"][CODE]Private Sub Text1_Change() Text1 = Format(Text1, "#,###") Text1.SelStart = Len(Text1.Text) End Sub[/CODE] This code formats the textbox value to include a comma for every 3 digits to the left. Problem is, it doesn't allow to type decimals like 3,000,000.50 What can I do?[/COLOR]

Member Avatar for AndreRet
0
6K
Member Avatar for DangleSauce19

My code works for numbers that dont have a remainder of 10 or above, but whenever I get one with a remainder 10 or above it prints out the number, not the letter. Please help #include <iostream> #include <fstream> using namespace std; const int maxstack = 51; class stack_type { …

Member Avatar for WaltP
0
2K
Member Avatar for yeeitsneo

hi. so i need help in understanding this program. its a hindu arabic - roman numeral converter. i got it from some site. i cant seem to understand how the whole process goes. Const sMatrix As String = "I~V~X~L~C~D~M" Private Function toroman(ByVal sDecNum As String) As String Text1.Text = sDecNum …

Member Avatar for yeeitsneo
0
243
Member Avatar for magicmarkuk

Hi I have a script which displays a price but currently is not fixed to 2 decimal places so a price such as $2.50 shows as $2.5 which to me looks wrong. The line of code is `amount += parseFloat($(this).metadata().amount);` Looking around I see there is a function `toFixed()` but …

Member Avatar for Troy III
0
213
Member Avatar for TarkiB

Hi there, I'm having trouble with floats in Java. My program accepts a number in the form of a float. The number typically has two decimals (but not always). It seems to work fine in most cases. For example, I could put in 54.67, and that number would be passed …

Member Avatar for JamesCherrill
0
404
Member Avatar for vegaseat

The computer is a binary beast. We want to go from the one-fingered digital box to the ten-fingered human being and convert binary to denary(base 10) numbers. This is how it works, for instance, binary 10010 is calculated as 1*16+0*8+0*4+1*2+0*1 = decimal 18. Just because it's easy, let's throw in …

Member Avatar for soorajshaji
0
2K
Member Avatar for enakta13

I intend to write a GUI java program which convert a decimal(base 10) to hexadecimal(base 16). Floating point decimals are also valid input. the code of my program private void myEnterButtonActionPerformed(java.awt.event.ActionEvent evt) { float mynum; mynum = Float.parseFloat(this.myNumberField.getText()); Float floatObject = Float.valueOf(mynum); myResultField.setText(Float.toHexString(mynum)); } but when I run the program, …

Member Avatar for enakta13
0
426
Member Avatar for blackasninja

Heres the thing. This was one our class test and the image below is the lecturers question that is supposed to be one of his jokes(Binary/base). A large amount of the class answered that it was decimal 10. Every ideas and thought would be appreciated. Heres the image [Click Here](http://imgur.com/OwEKO)

Member Avatar for blackasninja
0
150
Member Avatar for geeerald1131

Help me please.. I can't make this code in window form application.. using System; namespace _01.Decimal_to_Binary { class DecimalToBinary { static void Main(string[] args) { Console.Write("Decimal: "); int decimalNumber = int.Parse(Console.ReadLine()); int remainder; string result = string.Empty; while (decimalNumber > 0) { remainder = decimalNumber % 2; decimalNumber /= 2; …

Member Avatar for Mitja Bonca
0
199
Member Avatar for nmges

just forgot, I knew this "Textbox1.text = format(textbox1.text, “####.00”)" will set up the format to 4number with two decimal - 1234.00, how about if the user enter 12345.00, five number with two decimal, how did you do the check and give error message? Thanks.

Member Avatar for Reverend Jim
0
166
Member Avatar for abhishek_ag

Hi Guys, I have written the below program to convert binary to octal, it is giving me erroneous results. On entering 1111 as the input number I should get 17 as the output, whereas I am getting 16707000337 as the output. Kindly help me out, below is my program: /*program …

Member Avatar for abhishek_ag
0
261
Member Avatar for Dec28

Alright guys, I've been trying to think how to do this and I keep confusing myself. It's part of a project using piping in UNIX but first I need to get this small program running properly. I want to pass the final result (Hex value) to another program that will …

Member Avatar for histrungalot
0
239
Member Avatar for mags11

I am trying to get the program's decimal to output in two decimal places after the decimal. Please advise. [CODE] // MilesPerGallon.java // Program designed by XY import javax.swing.JOptionPane; // Needed for JOptionPane. import java.text.DecimalFormat; // Keeping proper decimal format. public class MilesPerGallon { public static void main(String args[]) { …

Member Avatar for mags11
0
2K
Member Avatar for rfrapp

Let me start off by saying that this is homework, and I have most of it completed. However, I am stuck on how to convert decimal to hexadecimal. The assignment is to add two hexadecimal numbers and output the answer. If the length of the answer is greater than 10 …

Member Avatar for rfrapp
0
3K

The End.