Hello guys im having problem displaying a math equation result in the textbox. It shows 0 and i dont really know where i got the error. Name of the textbox where result shall be displayed is **total1** Thx for help :) int textboxnumber1; int textboxnumber2; int textboxnumber3; int textboxnumber4; textboxnumber1 = int.Parse(textBox7.Text); textboxnumber2 = int.Parse(textBox10.Text); textboxnumber3 = int.Parse(textBox18.Text); textboxnumber4 = int.Parse(textBox34.Text); int answer1 = 0; answer1 = textboxnumber1 + textboxnumber2 + textboxnumber3 + textboxnumber4; total1.Text = answer1.ToString();

Member Avatar
Member Avatar
+0 forum 3

Hello guys im having a problem and i dont see where i made error. Im tryting to write something into XML file. Also how do you read textbox input and save it into XML ?? Cheers for help :) public class CourseName { string _name; public CourseName(string name) { this._name = name; } public string Name { get { return _name; } } } private void button1_Click(object sender, EventArgs e) { CourseName[] courseNames = new CourseName[4]; courseNames[0] = new CourseName("blablabla"); using (XmlWriter writer = XmlWriter.Create("myCourses1234.xml")) { writer.WriteStartDocument(); writer.WriteStartElement("myCourse"); foreach (CourseName coursename in courseNames) { writer.WriteStartElement("myCourse"); writer.WriteElementString("courseName", coursename.Name); //<---- Object reference …

Member Avatar
Member Avatar
+0 forum 7

hello guys im having a little problem here. I have few text boxes and few labels. User enters values into textboxex. Values in lables are from XML file, so the program reads for egz **<price>30</price>** and this price is set as a label **label1 => 30** And now im wondering how to multiply a value entered by user by the value of a label ( in this case 30, but can be any number) thank you :) int answer1 = 0; answer1 = (textboxnumber1/100)*label1 + textboxnumber2 + textboxnumber3 + textboxnumber4; total1.Text = answer1.ToString(); "Error 1 Operator '*' cannot be applied …

Member Avatar
Member Avatar
+0 forum 6

Hello there guys, im having little problem and help would be appreciated :) I have few tags <name> <capacity> <lectureslot> <tutorialslot> and so on, and i want to read each tag separatly into separate field(label), or listbox. Here is part of my XML <?xml version="1.0" encoding="utf-8"?> <timetable> <module code="3SFE504"> <name>Algorithms and Data Structures</name> <capacity cap="5">5</capacity> <semester sem="1">1</semester> <prerequisite preq="none">none</prerequisite> <lectureslot ls="0">Mon 9.00-11.00</lectureslot> <tutorialslot ts="1">Mon 11.00-13.00</tutorialslot> </module> And my source code is private void show_Click(object sender, EventArgs e) { //Clear all of the items out of the list box modulelist.Items.Clear(); //String workingDir = Directory.GetCurrentDirectory(); //XmlTextReader textReader = new XmlTextReader(workingDir + @"\xmlmodulelist.xml"); …

Member Avatar
Member Avatar
+0 forum 3

Hello there Quick insight of what im trying to achieve here is. User adds data to a database called property in (addproperty.php) Then user can search for specific data in that property database Here is the code addproperty.php [CODE]<?php $dbhandle = sqlite_popen("property", 0666, $err_msg); if(!$dbhandle) die("Could not open the database"); $query = "CREATE TABLE property(postcode VARCHAR(255),price VARCHAR(255),imagefile VARCHAR(255),visits VARCHAR(255))"; if(!sqlite_query($dbhandle, $query)){ echo "table not created (maybe already created)"; } $postcode = $_POST['postcode']; $price = $_POST['price']; $imagefile = $_POST['imagefile']; $visits = $_POST['visits']; $query = "INSERT INTO property VALUES ('$postcode', '$price', '$imagefile', '$visits')"; if(!sqlite_query($dbhandle, $query)) { echo "Could not insert table row"; …

Member Avatar
Member Avatar
+0 forum 1

Hello there i would like someone to have a peek at this code and does it solve the question correctly ?? Are there any mistakes or any improvements i could add ?? Thank you Question: 1. (a)modify the addnames.php script to read in and store two fields of data – username and password (call your script adduser.php and call the table ‘passwords’). (b)modify matchname.php to identify when a username and password exists in the database table (call your script checkuser.php ). Answer: adduser.php [CODE]<?php // adduser.php adds form values to database table (but adds blank row first time!) $dbhandle = …

Member Avatar
Member Avatar
+0 forum 1

Hello there i would like someone to have a peek at this code and does it solve the question correctly ?? Are there any mistakes or any improvements i could add ?? Also If any one could tell me how to save the data entered by person into one file(XML)so it can be retrieved any time later would appreciate it ;) Thank you Question 2: Write a script to allow a user to add property data into a property table ( call it addproperty.php ). The table should initially have 4 columns for the property data (postcode, price, imagefile, visits). …

Member Avatar
Member Avatar
+0 forum 1

Hello there i would like someone to have a peek at this code and does it solve the question correctly ?? Are there any mistakes or any improvements i could add ?? Also i struggle in this questions as i do not get it fully(in fact i dont get what sessions ment to do here), any help appreciated :) Question: Add user authentication. Modify checkuser.php so that a user can log in, and modify search.php so it will only run for an authenticated user logged in with checkuser.php.(Use sessions) Add JavaScript user input form validation to the log-in form. checkuser.php …

Member Avatar
+0 forum 0

Hello there i would like someone to have a peek at this code and does it solve the question correctly ?? Are there any mistakes or any improvements i could add ?? Question 3. Write a script to search for the properties which match a postcode (call it search.php ). Use SQL search. You will need an HTML form which allows the user to type a postcode they are searching for. search.php [CODE]<html> <body> <form action="properties.php" method="post"> Postcode: <input type="text" name="postcode" /> <input type="submit" /> </form> <?php $con = mysql_connect("localhost","maciej","kupadupa1"); // sql database server/ username/ password if (!$con) // if …

Member Avatar
+0 forum 0

Hello fellas :) I have a task to do, there are 10 questions and i obviously need 10 answers :) I have done (attempted) some of them /not every yet/ but i wonder if there are any errors or any correction or improvements that could be made :) Thank you in advance! Question1: 1. (a)modify the addnames.php script to read in and store two fields of data – username and password (call your script adduser.php and call the table ‘passwords’). (b)modify matchname.php to identify when a username and password exists in the database table (call your script checkuser.php ). Answer: …

Member Avatar
Member Avatar
+0 forum 1

Hello guys ;) Im quite new to PHP and i run into a problem. I was given a PHP task to do and its got to be submited by 27th this month in my uni... unfortunately i was not attending any Web programming class as i was so into Java that i have forgot about whole world :( and now im kinda stuck. The coursework is: Use a text editor to make a comma delimited text file containing data of properties for sale with the following fields/columns: Postcode, Price(thousands), imagefilename, Visits (Eg: HA13TP, 250,house1.jpg, 3) 1. Display all property information. …

Member Avatar
Member Avatar
+0 forum 23

Hello there I have been given an assignment at Uni to write program (obviously thus im here hehe) The user (customer wishing to purchase a computer) should be able to login by typing his user name and password and pressing the “Login” button. The layout of this first screen of the program should look like the one displayed in Figure 1. Note, that the characters in the password box should not be displayed while the user is typing them. Asterisks (*) should be displayed instead. When the application frame is resized the login screen should still look as in Figure …

Member Avatar
Member Avatar
+0 forum 22

i'm having problems displaying XML. When i remove 3rd line i got error(that on line 5 is an extra bit, that is wrong...), and when i keep 3rd line i cant see anything when displaying it on website.. :( i'm not a XML pro so help would be appreciated [CODE]<?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/css" href="style1.css"?> <?xml-stylesheet type="text/xsl" href="style2.xsl"?> <title>Mathematics for computing</title> <author>This module should help us understand:</author> <contents> <chapter>Understand concept of Mathematics</chapter> <chapter>Be able to use Mathematics in programming</chapter> <chapter>Improve our logical thinking that will also help us when solving programming problem</chapter> </contents> <title>Web technology</title> <author>This module should help us …

Member Avatar
Member Avatar
+0 forum 2

when i run this in Dreamweaver (website preview) it works perfectly but as soon as i put it into FTP i got this ... [url]http://www.infinit0s.cba.pl/tutorial6/mathgame1.html[/url] here is the code [CODE]JavaScript / DHTML / AJAX Syntax (Toggle Plain Text) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Maths game</title> <script language="JavaScript"> var kNumberOfProblems = 10; var kTableIdForProblems = "practiceMathTableProblems"; var kTableIdForAnswers = "practiceMathTableAnswers"; var kTableIdForResults = "practiceMathTableResults"; var kMultiplication = 'x'; var kAddition = '+'; var kSubtraction = '-'; var kDivision = '\367'; var kNotAnswered = -1; var kBiggestOperand = Math.floor(Math.random()*101); var points …

Member Avatar
Member Avatar
+0 forum 1

when i run this in Dreamweaver (website preview) it works perfectly but as soon as i put it into FTP i got this ... [url]http://www.infinit0s.cba.pl/tutorial6/mathgame1.html[/url] here is the code [CODE]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Maths game</title> <script language="JavaScript"> var kNumberOfProblems = 10; var kTableIdForProblems = "practiceMathTableProblems"; var kTableIdForAnswers = "practiceMathTableAnswers"; var kTableIdForResults = "practiceMathTableResults"; var kMultiplication = 'x'; var kAddition = '+'; var kSubtraction = '-'; var kDivision = '\367'; var kNotAnswered = -1; var kBiggestOperand = Math.floor(Math.random()*101); var points = 0; var gStartTime = 0; var gProblemArray = …

Member Avatar
Member Avatar
+0 forum 1

i'm having problem displaying number of points scored in a game for every one right answer users scores 2 points... and i'm having little problem in displaying these points in a box below the game :( can any one help me out on that one thank you :) [CODE]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Maths game</title> <script language="JavaScript"> var kNumberOfProblems = 10; var kTableIdForProblems = "practiceMathTableProblems"; var kTableIdForAnswers = "practiceMathTableAnswers"; var kTableIdForResults = "practiceMathTableResults"; var kMultiplication = 'x'; var kAddition = '+'; var kSubtraction = '-'; var kDivision = '\367'; …

Member Avatar
Member Avatar
+0 forum 3

i'm having little problem here, i have got timer here that counts down from a set time, but what i want to do now is instead of having timer, i just want to make a counter so if(counter=10) stop the game, and not when time = 0 [CODE]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <SCRIPT LANGUAGE="JavaScript"> var time=45; var timesup=0; var started=0; function CountDown() { if(time>0) {document.math.timer.value=time; time=time-1; var gameTimer=setTimeout("CountDown()", 1000)} else if (time==0) {document.math.timer.value="0"; timesup=1; alert('Time's Up!'); document.math.firstnum.value=""; document.math.operator.value=""; document.math.secondnum.value=""; document.math.answer.value=""; } } function startgame() {if (started!=0) {alert('You've …

Member Avatar
Member Avatar
+0 forum 3

Hi i'm trying to create a drop down menu but there is a problem here is the website "www.infinit0s.cba.pl" it just shows hyperlinks and not the full drop down menu :(. I'm using Dreamweaver CS5 here is the SS of how the menu should look like "http://img412.imageshack.us/i/screenshotproblem.jpg/"

Member Avatar
Member Avatar
+0 forum 1

I dont know how to kill this JOptionPane pop out eveytime i do something... it just pops [CODE]Object[] options = {"Option 1", "Option 2"}; Component frame = null; int n = JOptionPane.showOptionDialog(frame, "Chose Game Option \n *Option 1 - Enter Secret Word\n *Option 2 - Random word selection from secret list", "Chose game mode", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, //do not use a custom Icon options, //the titles of buttons options[0]); //default button title[/CODE] Some lines below that i have this [CODE] private void TryLetterActionPerformed(java.awt.event.ActionEvent evt) { String letter = aLetter.getText(); int charPos = 0; if(n == JOptionPane.YES_OPTION) { String text = …

Member Avatar
Member Avatar
+0 forum 2

Hello, i have came across a problem when trying to create a hangman game. I want to read a String of letters inputed from keyboard and then i want someone else to guess this word(typical hangman rules). I have used this code. [CODE]InputStreamReader FindWord = new InputStreamReader(System.in); BufferedReader in = new BufferedReader(FindWord); String letter = aLetter.getText(); FindWord.indexOf(letter); int charPos = FindWord.indexOf(letter); if (charPos == 0) Char1.setText(letter); if (charPos == 1) Char2.setText(letter); if (charPos == 2) Char3.setText(letter); if (charPos == 3) Char4.setText(letter); if (charPos == 4) Char5.setText(letter); if (charPos == 5) Char6.setText(letter); FindWord.indexOf(letter, charPos+1);[/CODE] The problem is that its says that …

Member Avatar
Member Avatar
+0 forum 10

Hello i'm having a problem with a program. Let me tell you first what program should do. The program should allow the tutor to enter in the various marks which the students have been awarded, until the tutor enters in a mark exceeding 100. At this point the program should display a histogram. Each star represents a student who achieved a module mark in the range shown. 0-29 *** (3 students received a mark between 0-29) 30-39 ***** 40-69 ******** 70-100 **** 20 students in total.  As the tutor enters each mark, a counter should count the number of …

Member Avatar
Member Avatar
+0 forum 58

The End.