1,362 Posted Topics

Member Avatar for Vikram Sehgal

Do you really mean along the x axis, and changing their y position some amount per second? We don't solve problems here, we help you with your solution. Write some code, ask some questions.

Member Avatar for Vikram Sehgal
0
313
Member Avatar for DUB1799

`cin >> "Enter number"; ` You cannot do input to a literal string. You need a variable as the right hand side of the extraction operator (>>), like: int num; cin >> num; int rolls; cin >> rolls; You don't necessarily need to follow an input statement with an output …

Member Avatar for vmanes
0
1K
Member Avatar for Emma_3

First, you're not reading in the name, you go straight to SSN. So input will hang up right there, seeing characters that don't match int type. Second, once you get past the name, SSN with dashes won't go into the int field, either. Nor will the hours, which have a …

Member Avatar for Moschops
0
283
Member Avatar for jhender4880

I don't think the .ignore( ) is needed after 36 or 40, only after the last extraction operation before the loop goes back to getline. So only at line 52.

Member Avatar for tinstaafl
0
2K
Member Avatar for DS9596

In both cases the output is just one single "ok", you are displaying just the literal text you see there. The declarations of the int or the char have no effect on the following output statements. Is there more to your problem that what you're showing?

Member Avatar for Ancient Dragon
0
429
Member Avatar for SW-ENG mohamed

Posting thrice doesn't get you extra credit. First show us some attempt to solve the problem, then we'll help you with your difficulties.

Member Avatar for Kristian_2
0
169
Member Avatar for Praveen_10

"goto loop" ??????? Why not just write a loop? You can easily wrap your code in a do...while structure

Member Avatar for David W
0
380
Member Avatar for Bendez Thyna

From your code, I'm assuming the matrix will be filled completely, so ROWa is a valid limit on number of rows to search. If the size you search for can be in any position in a row, the best you're going to be able to do is return the row's …

Member Avatar for Bendez Thyna
0
218
Member Avatar for nathan.pavlovsky

To add. The program did not read the last line twice, it failed to read anything in the last attempt and the previous values were used again. Two ways to correct this. My preferred way is to use the input as the loop condition. If the input succeeds, there is …

Member Avatar for vmanes
0
371
Member Avatar for thanh.truong.1272

As a general approach, I would start by iterating through the map completely, displaying the words of length 1. Then go though again, looking for length 2 words, etc. As you make a pass, keep track of the longest length that exists, when you display the words of that length, …

Member Avatar for uonsin
0
565
Member Avatar for s11109753
Re: HELP

A - We don't do your work for you. You write code, tell us what problems you have, we'll help you work it out. B - You also need to give a problem statement that is comprehensible.

Member Avatar for vmanes
0
130
Member Avatar for DS9596

It would help if you told us what errors you were getting and what lines they seem to appear on. For that matter, if you would look at your compiler error messages closely, they point you to the several things you need to fix just to get it to compile. …

Member Avatar for StuXYZ
0
5K
Member Avatar for diafol

> what exactly is the difference between a doll and an action figure? they are both representations of people with which the child can act out various activities. Is putting a SWAT vest on a GI Joe fundamentally different than putting a cardigan on a Barbie? OK, let's compromise and …

Member Avatar for iamthwee
0
467
Member Avatar for Brittany_1

Also, if you intend to get firstname lastname in one string input, you'll need `getline()` `cin >> a_string; `will store just one word's worth of content, stopping at the space between name parts. `getline( cin, a_string );` will read everything till the newline. In line 24, if you want to …

Member Avatar for vmanes
0
252
Member Avatar for Mart_webber

If that is the way the assignment was given, then the only real way to go about it is to first use if/else branching to put the purchase into some discrete cagetory. Then write the switch to use the category value. As AD put it it, this really is an …

Member Avatar for Mart_webber
0
166
Member Avatar for It tech

First show some work. Then we'll help you with specific problems. The two groups of functions you are aske to replicate are really pretty simple. Your biggest task is to actually instantiate the strings.

Member Avatar for David W
0
339
Member Avatar for c.bordelon

between lines 32 and 33 you need to keep a separate running sum of each tellers' total days. It looks like you were planning for `total` to be that sum.

Member Avatar for vmanes
0
615
Member Avatar for AnnYzz

[quote]test plans, desk checks and dry runs. [/quote] "Desk checks" - there's a term you don't hear enough anymore. And to get students to do such - unheard of! Narue's comments are spot on. If students (and real life programmers, as well) would spend more time checking, tracing, double checking …

Member Avatar for diafol
0
388
Member Avatar for glamiex

Lines 24-26 leave you with the value of number 2 as the correctanswer, but that value is not what you get from dividing number1 / number2 If you want to ensure that n1 and n2 result in an even division (no remainder) you'll probably have to generate them in a …

Member Avatar for vmanes
0
233
Member Avatar for ravi_14

Where is it written? If you follow up the chain of library files, you'll come to: yvals.h Which has the line: `#define _STD_BEGIN namespace std{` Most every library file, after its #include statements, leads off with: `_STD_BEGIN` (at least that's where it exists in MS Visual C++)

Member Avatar for vmanes
0
533
Member Avatar for Elharts

Lines 10 and 11 do nothing. Lines 12 and 13, you are doing integer division of integers that are as yet uninitialized. Then in 15 you do input to the variables that should hold the resulting fractional value. Your if statements make no sense. Where you should be going is …

Member Avatar for vmanes
0
497
Member Avatar for Ancient Dragon

It doesn't look like the publisher put out a legit ebook. For a 2001 edition, ebook versions weren't so common.

Member Avatar for mike_2000_17
0
172
Member Avatar for Sifiso21031085

Thus far, I have no faith in the electronic voting as presently implemented. There are too many demonstrated instances of faults in the systems, whether intentional or not. The lack of reliable and verifiable audit trails makes them suspect. We have enough voter fraud in the USA with the various …

Member Avatar for mike_2000_17
0
595
Member Avatar for veedeoo

Not all of those are so dumb, when you consider the context and time. > Women may not drive in a house coat. > > This is insane, what is the difference between a house coat and a church coat? IQ LEVEL : 2 A house coat is a robe, …

Member Avatar for jwenting
0
200
Member Avatar for cazmere

AD, what you asking for the shares? As to coding, what kind? C, C++, Morse, Genetic, Crypto? (I apologize, I couldn't help myslelf.)

Member Avatar for rubberman
0
89
Member Avatar for prashantsharmazz

Well, that was a moderately annoying website. But I'll play along. > Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. > > So far, the Universe is winning. > --Rick Cook

Member Avatar for mike_2000_17
0
527
Member Avatar for (Z!Z!)

For the problem you have, your output function needs to be set up like your ShowData(). You'll have to decide how you want to write the data to the file. You could write all the names, then all the data, by rows. Or you could write a name, then all …

Member Avatar for (Z!Z!)
0
203
Member Avatar for BboyTurok1990

In line with AD's comment, you can readily get your indenting cleaned up by selecting the code (ctrl-a) then, while holding the control key down, press K and then F. That would show that the last closing } in your code is indented two levels.

Member Avatar for vmanes
0
239
Member Avatar for Pyler

Putting it in a readable form: void foo(int i) { if(i>1) { foo(i/2); foo(i/2); } cout<<"#"<<endl; } I don't see where a 7 results, regardless of input. This function doesn't really do anything other than waste time and memory. What's your real question?

Member Avatar for vmanes
-1
222
Member Avatar for debasisdas

[QUOTE=sneekula;696891]There is ample evidence that work can be enjoyable, and that indeed, it is often the most enjoyable part of life.[/QUOTE] I enjoy work. I can watch people do it all day long. ;)

Member Avatar for James_28
8
17K
Member Avatar for mell.mattingly

In both the distance( ) functions above, you pass in a miles(driven) paramenter, then do an input action to that value. The general concept should be that the user of an instance of your car supplies that value to the car object, through that parameter, and the car just makes …

Member Avatar for Iworlock
0
854
Member Avatar for rron17

Counting to infinity is not possible, with a computer or not, unless you are Chuck Norris. To use the printf( ), you'll need to include <cstdio>. You'll need to either write the prototype for your gotxy(), or move the funtion to be before main(). It looks a little more fun …

Member Avatar for vmanes
0
160
Member Avatar for kenneth.leonida

#include <iostream> int main() { std::cout << "Hello, would you like to ask a question?" << std::endl; return 0; }

Member Avatar for vmanes
0
163
Member Avatar for xNeverx

You are using { } to contain your logical conditions, when you should be using ( ) Your second block looks like it should have the time of day test as an if, not else if. You have a loop at the end to keep doing the calculation, but no …

Member Avatar for ddanbe
0
177
Member Avatar for learner_new

even with the return statement moved to the end of the function, the line `cout << arr1;` will not display the array contents. You need to walk through the array, displaying each element's value one at a time. It is left as an exercise for the OP to explain what …

Member Avatar for shaykhhamza
0
301
Member Avatar for Dương_2

Google is your friend. Try the first link that comes up: http://lmgtfy.com/?q=online+tutorial+c%2B%2B

Member Avatar for vmanes
0
99
Member Avatar for mpid

1. Please read the stickies above about how to ask questions here. You must show some work, ask direct questions about problems you encounter. 2. Your question does not really make a lot of sense, it seems to contradict itself in regards to what to do with the ith digit.

Member Avatar for vmanes
0
67
Member Avatar for jainasamiento

Try stating it in words: if sales are less than 20000, commission is 4% otherwise, if sales are less than 40000, commission is 6% otherwise, if sales are less than 50000, commission is 7% otherwise, commission is 9% With this, you can create a flowchart with 3 decision shapes. Remember, …

Member Avatar for David W
0
267
Member Avatar for Za3mi

I would research the development environment I'm using to see if it directly supports opening images. What sort of images (jpg, bmp, tiff?). Determine what you want to do with the image. Display it? Just determine information about the image? Do modifications to it? Convert it to another format? You …

Member Avatar for Za3mi
0
916
Member Avatar for Emma_3

You don't need the while loop. Just decrememt postion as the loop does, then do the divide and modulus and ... voila. Well, that works when the position given is actually within the number. Do you need to handle the case of user asking for 7th position of a 3 …

Member Avatar for vmanes
0
1K
Member Avatar for blazemadej

You are processing all the inputs in the while loop. Then you one time write a value to output. Only the last data from the input reading gets stored. I'd restructure to open the output file right after you've opened and tested the input file. Then after each input line …

Member Avatar for blazemadej
0
178
Member Avatar for Mazi007

You need to show us some work. Perhaps you should also provide more detailed specs on what you're trying to do. Code indentation can have several variations in the approach one takes - what are your guidelines?

Member Avatar for Moschops
0
81
Member Avatar for PulsarScript
Member Avatar for fortranlover

Muhammad, you should start by opening your own thread, not piggybacking on another, unrelated one. Secondly, read the sticky at the top of this forum section where you'll see we don't do your homework for you. You write some code, post it and ask questions about problems you have with …

Member Avatar for vmanes
0
232
Member Avatar for man.chester.581

If you want to do Windows programming at the API level, I'd pick up Petzold's "Programming Windows". It's a bit dated now, but it digs into the innards like nothing else.

Member Avatar for glenwill101
0
300
Member Avatar for gabrielcastillo

I'm with the Rev on not feeling kindly disposed to those who appear to be English speakers writing badly. Trying to decipher a text-speak query is a pain. I often think the non-English speakers often do a better job of communicating. I have seen Google Translate do pretty credible job …

Member Avatar for Reverend Jim
0
235
Member Avatar for ashishkadam0220

As long as we're giving all sorts of answers, how about for(int i = 0, j = len-1; i < len/2; i++, j--) { temp = str[i]; str[i] = str[j]; str[j] = temp; }

Member Avatar for Ancient Dragon
0
312
Member Avatar for acmarshall

I'm confused by the assignment statement. You cannot directly pass a column from the 2D array to the sort functions. You can, and you are, passing rows from the array. Also, your loop in main sorts a row with the bubble sort, then sorts that row again using selection - …

Member Avatar for vmanes
0
206
Member Avatar for chubbyy.putto

Did you sort the list after it was generated? If you generated 200 random numbers in the range of 1-30, you should expect about 6 or 7 of each value to occur. Even in your set or 30 values, you will get duplicates.

Member Avatar for DavidB
0
156
Member Avatar for Ancient Dragon
Member Avatar for jwenting
0
200

The End.