2,827 Posted Topics

Member Avatar for dgr231

[code=cplusplus] for(i=0;i<=4;i++) { cout << "Please enter a player's name:" << endl; cin.getline(player[players].name,30); if(player[0].name == "end") { cout << "Please enter at least one batter's name." << endl; cin.getline(player[players].name,30); } else if(player[players].name == quit && i != 0) { break; } cout << "Please enter this player's average:" << endl; …

Member Avatar for dgr231
1
157
Member Avatar for xfngrn13

[QUOTE=xfngrn13;942453]ahm sorry i wasn't able to post the whole code i was just trying to get the logic of the occurrences anyway ill post my whole code[/QUOTE] I don't know what you did when you posted, but it doesn't seem like you used code tags and I can't get your …

Member Avatar for VernonDozier
0
126
Member Avatar for iceskater2752

[QUOTE=iceskater2752;941507]Numbers whose sum of digits is divisible by 3 represent numbers divisible by 3. Write a program to verify this famous statement. Input a 5-digit integer n from the keyboard. Find the sum of the digits. Call it sum. Verify that either (a) both n and sum are divisible by …

Member Avatar for sneaker
0
143
Member Avatar for stella44

Class Intersect - You have no constructor written. You have no non-static class variables. You have a non-static method called [ICODE]getIndex[/ICODE] that refers to only static variables. You have this line: [code] Intersection inter= new Intersection(); [/code] which creates a new instance of a class that has no non-static variables …

Member Avatar for VernonDozier
0
151
Member Avatar for sdmahapatra

[QUOTE=sdmahapatra;940273][CODE]ike this : 3,13,23,33,43,53,63,73,83,93 ?[/CODE] yes like this.[/QUOTE] 30, 31, 32, 34, 35, ...?

Member Avatar for mrnutty
0
125
Member Avatar for sophie_kiu

[QUOTE=sophie_kiu;938573]question 1 : I know that c++ could write/ read excel file by changing it into csv format. however, if the content of a cell has a "," inside, then we may have problem when we are reading it as the content may be split into two parts. So how …

Member Avatar for Frederick2
0
577
Member Avatar for nuar046

[QUOTE=nuar046;939243]what i'm already know is just :know to use the control sequence of dev c++ :know to use the system csl of dev c++ know to choose the libarary of dev c+ that all.[/QUOTE] I don't know what any of these three things are and which is specific to Dev …

Member Avatar for nuar046
0
210
Member Avatar for amu25

[QUOTE=amu25;935587]hello! m new to java.i want to create an application that accepts length x width from combo box.there are 100 values.i want to draw a rectangle whose size will change for each value in a combo box depending on its length and width. which method should i use? can any …

Member Avatar for amu25
0
150
Member Avatar for underground111

You've posted no new code. You have no inheritance in the program and presumably still don't, so presumably you don't understand it yet. You can't do it without it. Your last several posts give no clue about what the problem is, so the only advice one can give is "find …

Member Avatar for mrnutty
0
1K
Member Avatar for Leniel

[QUOTE=Leniel;937250]The problem ask to enter numb of students up to 100. but the user enter let's say 10. how do i manage to do that in arrays. Sorry if is a bother but i'm a newbie lol.[/QUOTE] Two options. Declare an array statically with 100 elements (max elements) or ask …

Member Avatar for Leniel
0
115
Member Avatar for iamsmooth

I don't think you are going to find anything pre-written like that with getline or anything else. You want something that both reads in input AND searches for a string at the same time. I don't know of anything like that that exists, and I don't see anything like that …

Member Avatar for Duoas
0
324
Member Avatar for jake43

> I am new to c++ and i advice for this particular assignment. I new to programming. > > The instruction is to use while loop for the two output process and for loop for the other 2 output. Start with code tags and good formatting, as mentioned in your …

Member Avatar for VernonDozier
0
112
Member Avatar for Schwein

Code tags. Use them. > > Well for assignment 1, I have done the following. The problem is about displaying the output. It's some sort of messy, have no idea on how sorting it anymore. #include <iostream.h> main() { int cabin[5][5]={{200,210,225,300,235}, {250,465,343,255,344}, {233,333,453,268,365}, {200,325,400,333,222}, {200,160,642,674,358}}; char choose; int total[5][5]; int …

Member Avatar for VernonDozier
0
197
Member Avatar for jake43

[QUOTE=jake43;936674]I have an issue with this assignment, the instructor says that I use the brackets incorrectly that is why the program will not compile. Please provide feedback to correct program.[/quote] Rule 1 when debugging brackets issues. Use code tags. All spacing is stripped out otherwise. Rule 2 when debugging brackets …

Member Avatar for Salem
0
205
Member Avatar for smoore

First thing I noticed is that there is no README file. I downloaded the rar, decompressed it, and I see a bunch of java files and some directories. Presumably I'm supposed to type javac *.java from the command line and there is some main file I am supposed to run. …

Member Avatar for VernonDozier
0
312
Member Avatar for almostbob

1988 Presidential debate on SNL. Phil Hartman as Jack Kemp on how to balance the budget by giving 110%. [url]http://snltranscripts.jt.org/87/87kdebate.phtml[/url] [quote] Pat Schroeder: Please, gentlemen.. we'll get back to you later, let's turn to Jack Kemp. Jack, as much as anyone, you have been identified with supply-side economics. But have …

Member Avatar for GrimJack
0
159
Member Avatar for cougarclaws

My guess is that you are supposed to pass the string as an argument to the function or display the prompt outside of the function. Regardless, defining the two prompts inside the function seems wrong: [code] int validInput ( string prompt) { cout << prompt << endl; // get user …

Member Avatar for cougarclaws
0
185
Member Avatar for mandofl

[QUOTE=mandofl;934620] Also like how do you make a program return two pieces of data from the same player his name and number. I was thinking of trying to use the get highest, but how do u make it return not the points but the other info about the soccer player.[/QUOTE] …

Member Avatar for mandofl
0
7K
Member Avatar for 4101

[QUOTE=4101;935129]Creating Superclass and subclass. Both class should have 4 methods and the subclass should have additional properties/fields and a constructor. The subclass should have at least one method that overrides a method in the superclass. On another file is creating a manipulator where you use the subclass and all of …

Member Avatar for sneaker
0
105
Member Avatar for loozax

[QUOTE=sravan953;935179]Here, try this: [CODE]import java.io.*; class even_or_odd { static void check()throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); System.out.println("Please enter a number to check if it is even or odd: "); int x=Integer.parseInt(br.readLine()); if(x==0) System.out.println(x+" is even."); else if(x%2==0) System.out.println(x+" is even."); else if(x%2!=0) System.out.println(x+" is odd."); } } [/CODE] Modify …

Member Avatar for loozax
0
239
Member Avatar for Evil_genius82

What line gives the error? Highlight it in red or point it out some other way. Also, please give us something we can compile and run. In other words, the class that contains the Bubble Sort function, a main function, something that creates the JList and studentClass objects, stuff like …

Member Avatar for cgeier
0
223
Member Avatar for NicAx64

[QUOTE=NicAx64;932298] too sad I don't know it's the problem of the technology or problem of the school punishing system or school teachers. However is life is valuable more than technology ? [/QUOTE] The issue has nothing to do with technology. The trigger for both of these suicides was that the …

Member Avatar for josh2
0
282
Member Avatar for mathavan2009

[QUOTE=niek_e;935207]C++ is a language that you can use to write programs.[/QUOTE] That's the basics all right, but it was apparently enough to solve the OP's problem, so +rep all the way. You've earned it on this thread. Good job! :cool:

Member Avatar for VernonDozier
0
82
Member Avatar for Godstryke

[url]http://java.sun.com/javase/6/docs/api/java/lang/Character.html[/url] [url]http://java.sun.com/javase/6/docs/api/java/lang/String.html[/url] The above are links to the documentation for the String and Character classes. Like many things in Java, there are many ways to do something. Scroll down the list of functions in these classes and you'll find functions that: [LIST] [*]Split strings into several different strings using delimiters. …

Member Avatar for Godstryke
0
192
Member Avatar for bigbadbag33

Yes, definitely read the stickies regarding code tags and the rest of the rules. I explained code tags on two of your previous threads. Here, for the final time, is how to use them. [noparse] [code=JAVA] // Paste code here. Adds line numbers, preserves spacing, adds syntax highlighting. [/code] or …

Member Avatar for VernonDozier
0
91
Member Avatar for CTUBren

Code tags: [code=JAVA] paste code here [/code] 36,000 separate Random objects? public static void rollDice(){ Random rand = new Random(); die1[rollnumber] = rand.nextInt(6)+1; die2[rollnumber] = rand.nextInt(6)+1; }

Member Avatar for CTUBren
0
120
Member Avatar for loozax

[QUOTE=loozax;934483]can some1 give me an example of sorting and merging an 10 inputted integers?!using java array..[/QUOTE] Google it. "merge sort java code" would be a good search term. Here's a link to an earlier thread of yours where I commented and provided some links. Read them. Same applies here. You …

Member Avatar for BestJewSinceJC
0
72
Member Avatar for Evil_genius82

When you mix tabs and spaces, the indentation often ends up looking terrible when you post. A tab is 8 spaces here. I always covert to spaces before posting. [code] //----------------------here i assumed the end of the sorting was and i could return sorted data to JList [/code] This is …

Member Avatar for VernonDozier
0
155
Member Avatar for IQLion

[QUOTE=IQLion;933788]Can you tell me please what method should I use and how.[/QUOTE] Even if you fix the switch statement, executable code like switch statements need to be located inside of a function/method/constructor of some type. Your switch statement is just floating around inside your class, so even if you fix …

Member Avatar for PopeJareth
0
173
Member Avatar for Godstryke

I'm fairly rusty/ignorant on Map and how it works behind the scenes when you use "put" and "get". If you were comparing two strings manually and iterating through some Collection, I'd suggest you use this function (compareToIgnoreCase): [url]http://java.sun.com/javase/6/docs/api/java/lang/String.html#compareToIgnoreCase(java.lang.String[/url]) on each member of the Collection. However, there's also an easy solution …

Member Avatar for Godstryke
0
1K
Member Avatar for bigbadbag33

Code tags. Please use them. What errors do you get? I see some obvious ones regarding the variable names. public void setPrice( double price ) { price = ( price < 0.0 ) ? 0.0 : price; } public double getPrice() { return price; } public String toString() { return …

Member Avatar for VernonDozier
0
98
Member Avatar for sfgal

[quote] I created a program to read in the file and one that will sort from a string array. [/quote] I assume you mean "function", not "program" here. Please post the functions, or at least the sort function. My guess is that you need to write your own [ICODE]compare[/ICODE] function …

Member Avatar for sfgal
0
170
Member Avatar for DaBunBun

[QUOTE=DaBunBun;932457]Are you saying to use a different variable type? Or are you saying to type cast it? If its the first, I want to get the length of a pointer thats being passed. Edit: Forgot to say, thanks for the help. Normally I'd use a vector like that, except in …

Member Avatar for tux4life
0
163
Member Avatar for Anon17

[QUOTE=Anon17;932371]Hi. I have a function which checks for a placement of a substring in a buffer after recieving it over TPC. It checks for the value up until a '&' appears in the string (As the value can be any length). However, my program crashes if the packet has no …

Member Avatar for Anon17
0
168
Member Avatar for hell04

[QUOTE=hell04;930654]Q: Write a program that will determine if a number is even. The program should ask for a number, say X and printout whether "X is even" or " X is not even". This program must use a method with the signature "public static boolean isEven(int i)".[/QUOTE] OK, I wrote …

Member Avatar for hell04
0
125
Member Avatar for xiikryssiix

Post with line numbers so we know what lines 95 and 112 are: [noparse] [code=cplusplus] // code here [/code] [/noparse] [code=cplusplus] #include <iostream> #include <iomanip> #include <string> using namespace std; const int nScores = 6; // function to sort scores int compare(const void*pa, const void* pb) { const int& a …

Member Avatar for Salem
0
62
Member Avatar for amit

[QUOTE=deepak1234u;608464]Pls some one help me for making a java project on the topic "inventory management system"[/QUOTE] Start a new thread. This one was useless enough four years ago. Let it die and never rise again. Start a new thread, but before you do, read the rules about showing effort before …

Member Avatar for praveenkonduru9
0
285
Member Avatar for jessejamesjjr

[QUOTE=jessejamesjjr;930683]can any one help me find info on modular programming and how to understand it's functions? any links to go to?[TEX][/TEX][/QUOTE] Try googling "modular programming".

Member Avatar for ahmadabdullah
0
131
Member Avatar for majestic0110

[QUOTE=majestic0110;931487]Hi all, I hope you are well. I am trying to explain some code to a friend : [CODE]StringConcatenate StringConcatenate1 = new StringConcatenate(); StringConcatenate1.stringConcat(); [/CODE] I said that this code creates an object "StringConcatenate1 " of type StringConcatenate and executes method stringConcat() (which is from class StringConcatenate()) on object StringConcatenate1. …

Member Avatar for majestic0110
0
204
Member Avatar for jko2326

Code tags. makes it easier to read: [noparse] [code=cplusplus] // paste code here [/code] or [code] // paste code here [/code] [/noparse] Why do you have two separate while conditions here and where is each supposed to start and end? Stick some brackets in there to make it more obvious. …

Member Avatar for VernonDozier
0
322
Member Avatar for _dragonwolf_

[QUOTE=_dragonwolf_;931428]Ok, here is what I have for my compareDates() function in my class: [CODE] int Date::compareDates(int m, int d, int y) { if((month < m) || (day < d) || (year < y)) cout << "This date comes before previous valid date." << endl; else if((month == m) || (day …

Member Avatar for VernonDozier
0
114
Member Avatar for _dragonwolf_

[QUOTE=_dragonwolf_;929878][COLOR="Red"]It will read the number values of the months and convert it to the string value[/COLOR]. However, I also need it to read in the string value of the month and display the string value of the month. The program will read until it reaches a string value and then …

Member Avatar for _dragonwolf_
0
107
Member Avatar for sotvisal

Java-specific BB Code. [code=JAVA] paste code here [/code] Non-Java-specific BB Code. [code] paste code here [/code] class FindString { public static void main(String arg[]) { Scanner ob=new Scanner(System.in); String st="I am a student, you're also a ."; String search; String st2=""; String st3=""; int i,c=0; System.out.println(st); System.out.println("Enter your word to …

Member Avatar for harsh2327
0
115
Member Avatar for kz07

[QUOTE=Asafe;930441]No, to [I]test[/I] use isupper() or islower() .[/QUOTE] Depends on what you're testing. In this case, to test whether a character is 'b' or 'B', use toupper or tolower: [code] char someChar = 'b'; if (toupper (someChar) == 'B') { cout << "It is either a 'b' or a 'B'."; …

Member Avatar for SeeTheLite
0
109
Member Avatar for gangsta gama

[QUOTE=gangsta gama;927720]Hello all, I have been programing for a year or two and i dont get vectors. I have seen them with numbers but can someone give me an example of vector.erase with letters? like for an RPG: like sword, axe, armor. Then have them chose what they want to …

Member Avatar for Nick Evan
0
139
Member Avatar for chatgro
Re: help

> I was Writing a code to connect data base and add the following code to my action.java Connection connection=getConnection("UserBook","UserBook123","catalog","localhost"); String sql="select BookName from book"; PreparedStatement ps=null; ps=connection.PreparedStatement(sql); ResultSet set=ps.executeQuery(); while(set!=null&&set.next()) { System.out.println(set.getString("BookName")); } connection.close(); > the error i get is "The method PreparedStatement(String) is undefined for the type Connection" …

Member Avatar for VernonDozier
0
100
Member Avatar for anumitadas

I explained here that you need to to post the pattern in code tags or else all the spacing gets stripped out, as well as how to do it. [url]http://www.daniweb.com/forums/thread206645.html[/url] You also need to post your code in code tags. [noparse] [code=JAVA] // paste code here [/code] [/noparse]

Member Avatar for VernonDozier
0
84
Member Avatar for anumitadas

[QUOTE=anumitadas;929150]Plz Help me to print in [B]java [/B] a b a b c b a b c d c b a b c d c b a b c b a b a[/QUOTE] All spacing gets stripped out when you don't use code tags! [noparse] [code] // paste pattern here …

Member Avatar for VernonDozier
0
311
Member Avatar for MonicaClare

[QUOTE=axeeffect2002;929512]@moderator Please delete the post #7, where I've given the java code. Thanks.[/QUOTE] axeeffect2002, don't worry about it. We know you are trying to help. Just try to keep peter_budo's post in mind in the future. Everyone has a different style and gives advice differently. It's fine to give code, …

Member Avatar for puneet88
0
188
Member Avatar for shaneera

Code tags. Read Salem's links regarding how. What exactly do you want? Add some cout statements for "delete" and "edit" to the menu above. No one is going to go through your first post without line numbered C++ code tags. [code=cplusplus] paste code here [/code] You need to ask a …

Member Avatar for crunchie
0
197

The End.