34 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for ogsirus

Hi guys, I am trying to write a program which picks the closest number possible out of a dictionary. The dictionary contains 50 doubles values, and I use a random double to pick the number i want to get the closest to if that makes sense. Currently I am using …

Member Avatar for ogsirus
0
854
Member Avatar for hanspeare_1

Hi there, i have recieved this notice Warning: Header may not contain more than a single header, new line detected in C:\xampp\htdocs\a\Student_Edit_Handler.php on line 53 and these are my codes. Kindly help me to fix this. <?php session_start(); $session_id = $_SESSION['user_id']; if($session_id == null){ header("location:Student_Edit.php"); die(); } include 'Connect.php'; $flag …

0
215
Member Avatar for rabadiyaronak

i have two different programs that compare float and double variales and gives output , i shown that below : 1. #include<stdio.h> main() { int r; float f=22.5; double d=22.5; r=(f==d); printf("r=%d",r); } **Output:- r=1** 2. #include<stdio.h> main() { int r; float f=22.7; double d=22.7; r=(f==d); printf("r=%d",r); } **Output:- r=0** …

Member Avatar for jwenting
0
289
Member Avatar for decade

Hi everyone, I'm new in vb.Net programming and i just want to ask how to validate a "Double" data type. for example. Dim number as Double number = textbox1.text If the value of "number" variable is in "Double" data type like 1.23 or 0.12 it returns a correct value and …

Member Avatar for decade
0
3K
Member Avatar for Szabi Zsoldos

Hi guys, I've created a simple plugin for Wordpress that interacts with an API in the backend. The problem is that everything is inserted twice in the database, and I cannot figure out why. The form is submiting only once, not twice. What could it be ? Redirects from my …

Member Avatar for Szabi Zsoldos
0
847
Member Avatar for jason.angeles.75

public class homework8_2 public static void main(String [] args) { Scanner keyboard = new Scanner(System.in); int selections = 0; DecimalFormat formatter = new DecimalFormat("#0.0000"); do { showMenu(); selections = keyboard.nextInt(); System.out.println("please input the amount of meters"); double meters = keyboard.nextDouble(); if (selections == 1) { double kilometers; kilometers = showKilometers(meters); …

Member Avatar for stultuske
0
240
Member Avatar for jspence29

What I am trying to do is make a program that reads a txt file and converts the number into a double array. import java.io.*; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class rocket { public static void main(String[] args) throws IOException, FileNotFoundException { System.out.println(readLines("/Users/Jeremy/Documents/workspace/altitude.txt")); } public static Double[] readLines(String …

Member Avatar for jspence29
0
381
Member Avatar for kyle.mace.35

Alright so my problem is I am getting an error that says undefined reference to all of my functions related to DoubleLinked, DoubleLinked<string> dict, dict.add, etc. If anyone knows why that would be great. Thank you. Oh and if i add () to DoubleLinked<string> dict then i just have undefined …

Member Avatar for kyle.mace.35
0
381
Member Avatar for romz

hi everyone. I want to delay the click event in a vsFlexgrid so that the double click event will run 1st. I used a timer for the delay in the click event and managed to get the value of the double click speed in the windows library for the timer …

Member Avatar for romz
0
1K
Member Avatar for tingwong

Hi everyone, I have a little problem with my code right now. For a project, we are to create a snack machine with cookies and mints using a GUI. We are given nickels, dimes, and quarters to enter in. The problem is when I enter in 1 nickel and 6 …

0
128
Member Avatar for Yoink

Hi, I'm writing a simple program that runs a vending machine. I thought I had everything working fine untill I messed around with the money input some more. In my program I obviously compare money values and check to make sure the values match up exactly to buy an item. …

Member Avatar for Yoink
0
492
Member Avatar for smith32

Hi, I'm working on a quick sort for double linked list. All work except the first item. I don't know what is wrong. Can u plz help me find the error? Here is my code. dlist_t* quick_sort(dlist_t* list) { dlnode_t *tnode = NULL, *first = NULL, *last = NULL; first …

Member Avatar for smith32
0
244
Member Avatar for Nickl246

Hi, below is my code for an android app I am developing, I was wondering how I can pass the value of pos from the array adapter to another activity through intent? What I would like is for the code in the next activity to be performed based on the …

Member Avatar for peter_budo
0
604
Member Avatar for James19142

i'm making this function that replaces single slashes in a path with doubles slashes. It works for everything but slashes because I gotta use doubleslashes to specify a single slash so how do I refer to double slashes. QString AddDoubleSlashtoPath(QString Path){ QStringList splitup=Path.split("//") ;/*supposed to be a single slash*/ QString …

Member Avatar for triumphost
0
1K
Member Avatar for diafol

Noticed that the submit a reply button has to be clicked twice in order to submit. Is this supposed to happen?

Member Avatar for diafol
0
165
Member Avatar for kiail

I'm trying to make a bubble sort to sort numbers like 3.2, 5.8, etc(double / float numbers). I have this code so far, but I'm still trying to learn and don't know why my code isn't working the way I think it should. Any help is appreciated. [CODE]using System; using …

Member Avatar for Momerath
0
270
Member Avatar for JavaPrograms

The issue with my program is that it does not calculate how many times the specific value has occurred. I believe that I have everything in place, but I'm not sure to as why it wouldn't work. Any help and/or feedback is kindly appreciated. Thanks! Ok, so basically this program …

Member Avatar for bibiki
0
462
Member Avatar for ak24

I'm trying to determine the minimum range of floating-point types. It's easy when using values from standard headers: [CODE]#include <stdio.h> #include <float.h> main() { printf("Minimum range of float variable: %e\n", FLT_MIN); printf("Minimum range of double variable: %e\n", DBL_MIN); return 0; } [/CODE] This code gives the following output: Minimum range …

Member Avatar for Adak
0
231
Member Avatar for techlawsam

ok so I am practicing with a basic carpet calculator , but when I came midway into it I noticed the " (double) " data types , I know its used to shift a value's decimal places two places but in this case it is acting the same way how …

Member Avatar for techlawsam
0
176
Member Avatar for Zexsz

I have a webpage that builds an html table if there is any data in a mySQL table. That works fine, the html table is populated with data from the mySQL table. My problem is when there is data it populates the html table but lists the first mySQL table …

Member Avatar for Zexsz
0
240
Member Avatar for nerdy9000

I am a beginner to Android programming. I am trying to convert an string(from an EditText widget) to a double Whenever i run the program, it crashes whenever the parseDouble function is used: [CODE]Double.parseDouble( input.getText().toString() ); [/CODE] Does anybody have an idea why parseDouble causes my program to crash and …

Member Avatar for nerdy9000
0
1K
Member Avatar for thecoolman5

hi, i am writing a program that keeps track of the money in my debit card account. i need the program to be able to pull out a value (such as 1.56356) from a text file, round it to the nearest hundredth, and put it back into the file. any …

Member Avatar for m4ster_r0shi
0
464
Member Avatar for virusisfound

I have done some calculations in two textbox data type is double like 9/8 The answer is in point [B]1.125[/B] how can i make it in complete value. like if it is less than .5 it take 1 as complete number. or if the answer is above .5 then it …

Member Avatar for virusisfound
0
136
Member Avatar for Labdabeta

Is it possible to overload an operator for a built-in type? And if so what is it's syntax? EG: [CODE]//Use of overloaded operator^ for types double and double (assuming it is overloaded for exponent): double a=10.0; double b=2.5; double pow=a^b;//pow is approximately 316.22....[/CODE]

Member Avatar for L7Sqr
0
174
Member Avatar for JordanHam

[CODE]#define _LL_BUFFSIZE_ 2048 string lastLine; lastLine.clear(); // regardless, zero out our return string char buff[_LL_BUFFSIZE_]; // our temporary input buffer data_filet.seekg (0, ios::end); // go to end of file int length = data_filet.tellg(); // find out how large it is data_filet.seekg(length-min(length,_LL_BUFFSIZE_),ios::beg); // seek back from end a short ways // …

Member Avatar for JordanHam
0
4K
Member Avatar for bensewards

Hey everyone, In my COMP 208 class, I was asked to do the following: "Redo Lab 2 Problem 2, only this time use vectors to hold the names and gpa’s instead of arrays. So you will work with 2 vectors, one holding the gpa’s (type double) and the other holding …

Member Avatar for user422
0
197
Member Avatar for bensewards

The question is: A file contains a list of names in the form: Jones, Frederick M Brennan, Claire Your program should alphabetize the list. Use the C++ string class. Also, extract names from the input stream with getline(). What i know so far: main() should declare a char array and …

Member Avatar for ravenous
0
199
Member Avatar for hiddepolen

Hi Daniweb! I couldnt find my problem anywhere else on this forum, so I decided to make my own thread... My problem: I'm trying to make a function to decide how many decimals a 'double' has. My code (slightly edited, here's the base of it): [CODE] // int m = …

Member Avatar for MattyRobot
0
183
Member Avatar for ohsevenfiveoh

hey guys,been browsing this site for a few weeks,but this is my first post. As you might guess by my problem I'm a C++ noob. I'm tryin to make a program in which the user inputs an array of double, I then use bubble sort to to get it into …

Member Avatar for Fbody
0
601
Member Avatar for Feim

Hi all, I have this string "May 19, 2009 15:39:41.606809000" , i need to get the seconds into a double variable. My code is like this: [CODE]double sec; string seconds = str.substr(19,10); istringstream(seconds) >> sec; [/CODE] The thing is that seconds = 41.6068090 , but sec = 41.6068 Why doesn't …

Member Avatar for Feim
0
130

The End.