142 Topics

Member Avatar for
Member Avatar for Craftknight

Hello, I just wrote my first code with a while loop and I am getting strange results. The program is supposed to give a Fahrenheit (TF) to Celsius (TC) conversion for every 5 degrees Fahrenheit increases between 0 and 100. It increases the value of TF just fine but in …

Member Avatar for Craftknight
0
91
Member Avatar for Mayank23

how would be able to display all the names a user entered. the user entered the names through a while loop

Member Avatar for alaa sam
0
105
Member Avatar for Mayank23

how can i display all the account numbers that have been entered. it only shows the last account number entered, not any before it. heres the code- [code] #include <iostream> using namespace std; int main() { double deposit; double previous; double newtotal; double withdraw; int total; int number; int res; …

Member Avatar for Mayank23
0
176
Member Avatar for Mayank23

i made a bank program, it askas the users to put in their account number. it works with a while loop. i ask for the person to enter 1 to start or 0 to stop. i need help on how to display all the account numbers that were entered once …

Member Avatar for Mayank23
0
114
Member Avatar for damsean102

I've built a blog where the user can attach a PDF to a post. This all works fine apart from one small minor detail. I call the details from the MYSQL database on the home page and use a while loop to go through the results. In the DB there …

Member Avatar for damsean102
0
1K
Member Avatar for mrar85

Hello, i'm a newbie with c++.. all help and explanation are welcome..my problem is, i try to make a factorial program in c++ . Here is my code: [CODE]#include <iostream> using namespace std; int main() { int a,b,fact=1; char key; do { cout<<"\nPlease enter a positive integer : "; cin>>b; …

Member Avatar for mrar85
0
2K
Member Avatar for nukabolhi

How can I get the values in Check box while loop in php. Pls give me some tips to get the values from the below php code. [CODE] $sql=mysql_query("select * from tree"); while ($result = mysql_fetch_array($sql)) { echo "<br>"; echo "<label> <input type=checkbox name=Test value=checkbox id=Test_0 > $result[fruit] | $$result[fruit_charges] …

Member Avatar for phpology
0
2K
Member Avatar for MothershipQ

I have a 200 point program to write for school that says how much extra grain will be left in the silo and Tomorrow is the last day to turn it in. But something is wrong with my while loop. Could you help me out? Also, I'm writing this code …

Member Avatar for gerard4143
0
132
Member Avatar for philip.s

Hi guy's, I am missing something, what on earth is wrong with this script, I can not get it to insert all my values into a table. [CODE] $host="localhost"; // Host name $username="root"; // Mysql username $password="1234"; // Mysql password $db_name="database"; // Database name $tbl_name="input table"; // Table name $que …

Member Avatar for Caeon
0
81
Member Avatar for cortez716

I've writen a simple calculator code it is pasted below. What do I need to change in order to make it loop using a "while" statement until, the user inputs the letter ("Q" upper or lower), casuing it to exit the program instead of a function such as(/,*,-,+).. please help... …

Member Avatar for VernonDozier
0
121
Member Avatar for tristanhall

Hey guys! I am working on creating a website that offers resources and calculators for a lot of algebraic and geometric equations. One thing that I want it to do is factor polynomial equations. For example, x^2-x-2=f(x) would become f(x)=(x+1)(x-2). WolframAlpha.com does this for all polynomials so I know that …

Member Avatar for tristanhall
0
539
Member Avatar for KriBez

Hello! Finally I joined daniweb. Great stuff in here guys. Anyways lets get to the problem: I have a page where a number of topics are displayed ( they are added by admin). And to get this list I`m using this script [CODE=php] // Query the database $gettopic = mysql_query("SELECT …

Member Avatar for KriBez
0
103
Member Avatar for doctorphp

Hi All. I am trying to display images using the while loop but I want the pictures to be displayed like this. [ATTACH]16585[/ATTACH] The only thing is, I don't know how to do it. Any help would be much appreciated. Thank you in advance Cameron

Member Avatar for dev.vini
0
7K
Member Avatar for Sunshineserene

I have 2 arrays that are in a while loop each. I have declared the array ouside of the main, declaring it 'public static'. I want to use the values store in the array outside of the while loop, but I can't seem to do it. May I know how …

Member Avatar for Sunshineserene
0
803
Member Avatar for doctorphp

Hi everyone I am trying to develop a friend system where you can view friends who you are friends with. I have been able to get it to show one result but it wont show any other. Please can someone tell me what I am doing wrong. Here is the …

Member Avatar for doctorphp
0
148
Member Avatar for jatpatel1

Hi there, I have been scratching my head for a few days now! with this problem: I am trying to echo out some data from a mysql table. I have a column name Country which has the following Countries: India, Malaysia Austaralia etc. I also have a column name Town …

Member Avatar for kingredyard
1
213
Member Avatar for ilkeamasya

As you see at below I used "-1" as my sentinel value but my program wants the other 6 values i asked for in scanf too. How can i solve this problem? I just want the user to enter -1 and exit my loop. I would greatly appreciate for your …

Member Avatar for ilkeamasya
0
245
Member Avatar for arafat_alam

this is my code for a simple link list...i cant solve the problem of the while loop.it is only working for "1".and i cant swap two nodes in the list and cant insert nodes in a given position...how can i do those???plz help....[CODE]//Pirateā„¢ #include<stdio.h> #include<string.h> #include<stdlib.h> struct list_element { char …

Member Avatar for Ancient Dragon
0
206
Member Avatar for mimsc

Hello..Im trying to read the HTML from a URL and I threw in yahoo.com as a test...for some reason, "n.readLine()" is coming back as NULL and the while loop fails...and ideas?? thanx [code] <%@ page import="java.io.*" %> <%@ page import="java.net.*" %> <%@ page language="java" %> <%@ page import="trader.webservices.util.Utils" %> <%@ …

Member Avatar for kk4real
-1
107
Member Avatar for aakaashjois

Hello, Can anyone help me solve the error in this program?? I get the following error: [COLOR="Red"] Exception in thread "main" java.lang.NumberFormatException: For input string: "" at java.lang.NumberFormatException.forInputString(Unknown Source) at java.lang.Integer.parseInt(Unknown Source) at java.lang.Integer.parseInt(Unknown Source) at converter.main(basic_convert.java:20)[/COLOR] The whole program runs properly. The error come after asking if I want …

Member Avatar for aakaashjois
-1
201
Member Avatar for choosenalpha

Hello Guys, I am trying to code this assignment below but I can't seem to get the running total stored for each user that I have listed below(A, B, E). Can someone guide me on how I can store the running total for each user so that I can have …

Member Avatar for choosenalpha
0
413
Member Avatar for nomemory

Hello, I am a python newbie and I am trying to accommodate to the basics. What's the python equivalent for the following Java snippet ? [B]Java:[/B] [CODE]public class Main { public static void main(String args[]){ int a,b,c; a= (int) (Math.random()*100); c=0; while((b=(int)(Math.random()*100))!=a){ c+=1; } System.out.println(c); } }[/CODE] I was trying …

Member Avatar for woooee
1
214

The End.