199,114 Archived Topics
Remove Filter ![]() | |
[CODE] package primecdesc; import java.util.Scanner; public class Primecdesc { public static void main(String[] args) { Scanner myScanner = new Scanner (System.in); int a,b=0,ctr=0, ktr=1; System.out.print("Enter a number: "); a = myScanner.nextInt(); while(b>=1001) { if (a%b==0) b++; ctr--; } /*for(b=1;b<=1001;b++) { if(a%b==0) ctr--; }*/ if(ctr==1) { System.out.println(a + " is a … | |
[CODE]#include <iostream> using namespace std; struct account { account(); int accountnum; float balance; float interestrate; }; account::account() { accountnum = 50; } struct account2 { account2(); account * data; void test(); }; account2::account2() { } void account2::test() { data->accountnum = 1000; } int main() { account test; account2 test2; cout … | |
| |
<%@ page import="java.sql.*" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body> <% String ans=" "; if(request.getParameter("correctAns")!=null) { ans=request.getParameter("correctAns").toString(); } Connection con = null; Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con = java.sql.DriverManager.getConnection("jdbc:odbc:sid"); Statement st = null; ResultSet qrst; ResultSet rs = null; String id=request.getParameter("id"); … | |
I get this error in my Java programme which coded by me according to a tutorial.I coded it to connect my Java App with MySql database.This is the code.[CODE]package Gui; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; import java.sql.SQLException; /** * * */ public class connectionconfig { private connectionconfig() … | |
Hello, im trying to make a program that opens up jpeg files one at a time and look at there brightness and then if its past a threashold moves the file to a "keep" folder if not moves it to a "varify" folder im new to C# so im not … | |
I want display 2nd cycle after sleeping 1st cycle time 1 second after that display 2nd ,3rd and so on.... I bold my thread code in above program.... [CODE] public class MainDrawCycle extends JPanel implements ActionListener ,Runnable { JButton button; JLabel lblclkValue,lbldispValue,lblTitle; JTextField textField; JScrollPane pane; JPanel panel; JFrame frame; … | |
hey i have written this code to make a GUI but it compile correctly but gives error at run time. the error is exception in thread main "java.lang.NullpointerException" at GUI.intGUI(GUI.java:22) at GUI.(init)(GUI.java :75) at GUI.main (GUI.java:79) the code is [CODE]import java.awt.*; import javax.swing.*; import java.awt.event.*; public class GUI { JFrame … | |
import java.util. *; import java.util. ArrayList; public class Module { private int moduleCode; private String classlist; private ArrayList<String>studentsEnrol; public Module(){ studentsEnrol = new ArrayList<String>(); } public void storestudent(String student){ studentsEnrol.add(student); } public String classlist(){ return classlist(); } This is a code i wrote, the code meant to store student in … | |
i need to know which is better? whether DataInputStream or BufferedReader or scanner? | |
Hello, everybody. I'm stuck on an assignment I've been given recently. Looks like I've missed many lectures in programming. Here's the thread. I'm just asking for some hints, really, I'd appreciate that. [B] The problem:[/B] Write a complete program with at least one example for using all interface functions of … | |
[CODE]class Mammal { String name = "furry"; String makeNoise() { return "generic noise";} } class Zebra extends Mammal { String name = "stripes"; String makeNoise() { return "bray";} } public class Zoo { public static void main (String[] args) { new Zoo().go();} void go() { Mammal m = new Zebra(); … | |
Hey everyone, been using this site for a lot of my programming needs, but is time I would appreciate some help. Just started assembly language and I am having trouble with a problem. The question: Write a program that will prompt the user to enter a number and then the … | |
Hi, i created the page which is display some information from database with some rules in the end of page i putted the command that it is show how many page that i have. so, i decide to add next and previous in the sides of page numbers and also … | |
Slot Machine I got all this so far !!! Nex is .. First build in support for writing output to an output file. 2 Make a copy of your existing program and modify the new program to be array based or to use functions or both. It does not have … | |
Hi! I would just like to know if its possible to give an linked image the ability to send the form instead of a submit button? Like in the example below: [CODE] <form method="post" action="Search.php"> <table id="search"> <tr> <td> Search: <input type="text" name="search" id="search" placeholder="Search for friends"/><td><a href="Search.php" action="Search.php"><img src="graphics/search.png" … | |
Hi, I have build my website with PHP and MySQL and when I was debugging I noticed a problem which I cannot find a way around it. Basically I have a search box on my website, which will search from a column that I have on MySQL database. Now I … | |
I have accepted an internship that involves re-writing a project written in "Clipper Summer of '87" in C#, and basically it's missing a couple source code files and I have no idea how to work with the database files it uses. I do know it uses something called "dBase III" … | |
I'm very much depressed with the following code. As for me, everything is correct. But the Goddamn code doesn't work. I've a html form with radio buttons and a hidden field. On clicking Submit, the form does not submit. Trying print_r($_POST) on the submitted radio button variable, it returns an … | |
I'm having problem to update the data into mysql database. for insert new data, it works nicely but if i want to update the existing data, it will hang my pc. even if i debug line by line, it shows like infinite loop. which part has gone wrong? i'm totally … | |
I'm starting from the bottom of XML and all I want to do is display the elements of one tag. You'll understand what I mean if you look at the code. [CODE]<table> <script type="text/javascript"> if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code … | |
Hello!! For my final year project, i would like to build decision support system that give suggestion to customer to build their house based on type of house and price. So, customer will select type of house that they like and also the budge money that they have. Then, the … | |
Hi all, this is my first thread here, but I've read your forum a lot as unregistered user. I've searched the web for a complete Javascript or some hint, but I didn't find an interesting script or article to implement what I've thought. There's a way to write text or … | |
Hi All, im in the process of creating a mini auction in vb.net, so far i have deisgned the pages and now im beginning to code, but im stuck on the Fileupload of the image, this is the first time i have used a file upload so im looking for … | |
hi, my table has following fields ForumPostsId(primary key),ForumPost,ParentPost parentpost can have 0(which means its parentpost) or ForumPostsId(which means its a chlid post related to parentpost) i need to generate a list which will the show parentpost and count of child post related to parent post Any suggestion!!!!!!!!! regards rajan | |
I need some help to bebug some C++ code. I can't see any obvious errors but my compiler reported 36 errors. I think they are all relating to the first error I'm getting from inside the State class. It says: "changes meaning of 'State' to 'class State' but I'm not … | |
Hii everyone.. i have wanted to create a TCP/IP Lan chat program in visual studio 2005. i am a newbie to it 2005. i have already created an interface for it but no codes yet. Attached are images of the client and the server. pls helpppppppppppppp | |
Need help guys.. I need to separate all labels from aspx & aspx.cs file to XML file but I getting this error Compiler Error Message: CS0029: Cannot implicitly convert type 'System.Xml.XmlNodeList' to 'string' here is my xml file [CODE=xml]<?xml version="1.0" encoding="iso-8859-1"?> <labels> <btn>Update</btn> </labels>[/CODE] and here is my aspx.cs file … | |
Hello ! I'm trying to edit and update and cancel in datagrid. Edit and cancel commands are working properly but at UPDATE i m getting this error.(Incorrect syntax near '12'). Please help me. my code is here.. [code] protected void DataGrid1_UpdateCommand(object source, DataGridCommandEventArgs e) { num = Convert.ToInt16(e.Item.Cells[1].Text.ToString()); TextBox t1, … | |
How will I be able to send the password to the user's email id, when he or she selects forgot password? It's a crucial part of my project, please let me know how can i retrieve it? | |
Hi i am looking for following output.I am just getting 0 for a,b,c,d,f. total no of grades Number of A's Number of B Numbers of C Number of D number of F [CODE]import java.util.Scanner; public class ExamScores { public static void main (String[]args) { String a; int count= 0; int … | |
hello, I am building a site where I want all links to partial page reload using xmlhttprequest and innerhtml. I have done this before, butI always had to have a seperate xmlhttprequest function for each link. So this time I am trying to write just one function, and have the … | |
Hi i am having a little trouble with my jquery tabs, for some reason it loads the first tab content, but when i select another tab the content is not displayed. When i try to go back to the first tab it doesnt load either. Here is the html [CODE]<div … | |
I am trying to per textchanged in a textbox call an isnumeric function. I cant seem to get it to work. function: [ Private Function IsNumericCheck(ByVal CheckVal As String) As String 'check for numeric values and return boolean If IsNumeric(CheckVal) = False Then Return False Else Return True End If … | |
Ok guys i am working on a program that will compute the distance in miles from Chicago or dallas(radio buttons)to specific destinations. The destination cities are in a selection list. The output should be the distance between the two cities, the time it would take to drive at 60 mph. … | |
I need to read one wide Charecter(wchar_t) from a file once but it says: "ambiguous overload for 'operator>>' in 'WER >> mont' The part that also confuses me is that it writes the Charecter just fine. It is only one Charecter not a string if that makes a difference. Thanks. | |
Here's the the question... 1. Declare an enumeration type consisting of the nine planets in their order by distance from the Sun (Mercury first, Pluto last). 2. Write a value-returning function that converts the name of a planet of the enumeration type declared in Step 1 into the corresponding string. … | |
â–ºWrite a class implementation for a class Student that contains the data members: 1. Data member for the student Name. 2. Data member for the student Number (ID). 3. Data member for the student Faculty. 4. Data member for the student Gender (M or F). 5. Data member for the … | |
Hey All! Can Any one help me in getting an idea what to make for a computer programming project? Thanks! | |
Hello forum, I want to write a simple code of two dices rolling for two players. The players can roll as many times as they want per turn. If they are matching numbers, the total is zero. If a person passes, it is passed on to the next player. Please … | |
[CODE]import java.util.Scanner; import java.util.Random; public class test { public static void main(String[] args) { Random rand= new Random(); // being able to use random object int[][] array = new int[3][9]; // print array in rectangular form for (int i=0; i<array.length; i++) { for (int j=0; j<array[i].length; j++) { int k … ![]() | |
i have jst started programing in java m beginer. m making gui which contains a two radio button a slider and a text message. although its compiling coreectly but it doesnot display any thing [CODE]import java.awt.*; import javax.swing.*; import java.awt.event.*; public class GUI { JFrame frame; JLabel coord; JRadioButton Man=new … ![]() | |
Hi, I don't really have a programming issue rather a artistic issue. Look at the following code of the front view an unfinished building. I'm trying to add a side view to the right or left. I just can wrap my mind on how it is supposed to look. [CODE] … | |
Hi All, I need to compare one file in each file in the folders, some sort of duplicate check through md5 hashcode that I've found in my google search. Here's the code of functions: [CODE]Public Function CompareFiles(ByVal FirstFile As String, _ ByVal SecondFile As String) As Boolean Return ReadFile(FirstFile) = … | |
Hi all, I'm trying to create a simple function in MS Visual Studio which would take a function and a range of values, divide that range into 500 equal steps, and barf out the results to a CLR richTextBox. The function looks like this: [code]void Form1::Range(double from, double to, double … | |
Hi, I created the class for converting decimal to binary numbers and I wish to make the Windows application but there's an error: [ICODE]E2285 Could not find a match for 'TForm1::TForm1()' [/ICODE] The source code: [CODE]//--------------------------------------------------------------------------- #include <vcl.h> #include<math.h> #pragma hdrstop #include "Unit1.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" TForm1 … | |
Please do help me!!! i have to validate date using date time picker such that u can't choose the date /month/year before you were born. | |
c++ I am making a game and decided to put in a bogus company animation thing, kinda like Blizzard does, but need to find a way to play the file that we made without going on in the code. ie it comes to the line to play the file (c:\evilsilver.avi) … |
The End.