- Upvotes Received
- 3
- Posts with Upvotes
- 3
- Upvoting Members
- 3
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 2
33 Posted Topics
This is part of the Shape Hierarchy so it should help you get started... [CODE] public class Shape { } public class Shape2d extends Shape { } public class Shape3d extends Shape { } [/CODE]
Hope this will help you get started.... [CODE] import java.util.Scanner; import java.util.StringTokenizer; public class Test { public static void main(String[] args) { String input; Scanner s = new Scanner(System.in); int count = 0; System.out.print("Enter a sentence: "); input = s.nextLine(); StringTokenizer t = new StringTokenizer(input); while(t.hasMoreTokens()) { count++; String word …
I'm sure if you typed it into Google you would find an answer.
I am trying to implement a live support chat application where users can chat with customer service for support or general information. I'm having problems trying to figure out how to go about implementing it. I was thinking the best way would to be to use servlets to pass the …
what do you mean by c++ software?? I'm assuming that you are looking for a c++ compiler/IDE?
move Scanner keyboard = new Scanner (System.in); inside the loop
JGrasp is not a compiler it is an IDE. I would recommend Eclipse. Its free, has lots of support, and lots of available plugins. [url]http://www.eclipse.org/[/url]
[CODE=java]for( int i = 3; i < 41; i++) { if((i%5)== 0) { System.out.println(i); } } [/CODE]
There are a bunch of different ways to accomplish that. Below is one of the easier ways. Just overload the getDay method and pass it a number of days in advance to get. [CODE=java] public class Day { private String day; //Default Constructor public Day() { setDay("Sun"); } //constructor with …
Apache POI will allow you to read Microsoft Word documents. [url]http://poi.apache.org/[/url]
There a a bunch of different solutions. One being[CODE] char name[5][50]; for(int i=0; i<5; i++) { char buffer[50]; cin.getline(buffer, 49); buffer[strlen(buffer)] = '\0'; strcpy(name[i], buffer); } for(int i=0;i<5;i++) { cout << name[i] << endl; }[/CODE] but you should look in to using std::string instead
It depends on the type of sort and data that is being used.
Add a linked list object to your course info class. Then in the course info constructor create the linked list object. Then use that linked list when adding courses in the addCourse function.
Check out the api documentation on buffered reader. [url]http://java.sun.com/javase/6/docs/api/java/io/BufferedReader.html[/url] Here is a site with a simple tutorial. [url]http://www.java2s.com/Tutorial/Java/0180__File/Readsatextfileanddisplaysitlinebyline.htm[/url]
It isn't assigning an object to equal a pointer. It is creating a pointer that points to a block of memory that has been allocated on the heap to hold the data in the struct. name* nn; // declares a pointer to point to a name struct nn = new …
This should help you out [url]http://doc.trolltech.com/4.4/qtsql.html[/url]
You have to many * in this.length=(double)(Math.sqrt((x2-x1)**2+(y2-y1)**2));
[CODE] double Average (int ary[] , int numStudents) { double total = 0; for (int i =0; i < numStudents; ++i) { total += ary[i]; } return (total / numStudents); } [/CODE]
What part are you confused on? How to implement it or the code to use?
You're missing a header file where the definition of binary_search is add #include <algorithm>
An easier approach to testing if the number is even is to use the modulus operator % [code] int num = 10; if(num % 2 == 0) { cout << "even"; } else { cout << "odd"; } [/code] You should also look up some information on if statements because …
You might want to check out [url]http://www.dancrintea.ro/doc-to-pdf/[/url] and [url]http://poi.apache.org/[/url]
Can't do much without seeing the code....
There are a few different ways to do it but this would be the easiest. [CODE] while (inFile.hasNextLine()) { int sum = 0; String name = inFile.next(); for(int i=0; i<5; i++) { sum += inFile.nextInt(); } float avg = sum / 5.0f; System.out.println("The average for " + name + " …
could you post the code to the "student.h" file
Use the accessor functions of the classes instead of trying to access the class members directly. For example: instead of using L.add[i].author use L.add[i].getAuthor()
You are printing the ASCII value stored in the char lowOutput and highOutput! [CODE] void Priority::service(Queue &low, Queue &high) { char lowOutput; char highOutput; cout << "Service: "; while(high.count != 0) { highOutput = high.takeAway(); cout << highOutput << " "; } while(low.count != 0) { lowOutput = low.takeAway(); cout …
you could do something like this but not sure its what you are looking for... [CODE] String input; Scanner s = new Scanner(System.in); do { System.out.print("Would you like to continue (yes or no): "); input = s.nextLine(); while(!input.equals("yes") && !input.equals("no")) { System.out.println("Error: Invalid input!"); System.out.print("Enter yes or no: "); input …
[QUOTE=Ciganjo;794928]hi im having alot of trouble with this particular code the idea is to read text from a file and print it on screen, i have done that. Next i needed to ouput the longest word onto the screen, this i have done also The bit im stuck with: I …
The End.
h3xc0de