1,359 Posted Topics

Member Avatar for Mistyz

Start by declaring a class named `Rectangle`. Write a constructor (an `__init__()` method) that accepts arguments `self`, `length` and `width`, and assign the latter two to `self.length` and `self.width` inside the constructor.

Member Avatar for ZZucker
0
544
Member Avatar for TizDeath

OK, I'll admit that the assignment is not well written at all. Still, it is not that difficult to work out the intended design, I think. Let's go over what you need to do: * Declare and initialize an array of `String`s; * Open the file for reading; * Read …

Member Avatar for Schol-R-LEA
0
218
Member Avatar for HiHe

Actually, tuples are mainly used by the Python language itself, for certain types of operations where lists would too slow, or where the immutability of tuples is helpful. For example, multiple return values are actually passed as a tuple, which can either be assigned as a single value or 'unpacked' …

Member Avatar for vegaseat
0
684
Member Avatar for Tayler_1

First off, you should be made aware that the forum software does not by default maintain the formatting of code; in order to get the code to stay formatted, you need to enter it using the 'CODE' button at the top of the editing window, else manually indent it by …

Member Avatar for Tayler_1
0
1K
Member Avatar for schroaus

I would start by adopting more consistent indentation practices; as it is, you're all over the place with your indentation. I'll try to get the code indented suitably for you so we can see where things actually lie. program TICTACTOE; {$APPTYPE CONSOLE} uses SysUtils; var Win,SaveMove,MoveTaken: Boolean; Board: Array [1..3,1..3] …

Member Avatar for Schol-R-LEA
0
3K
Member Avatar for ashdane.beckford

First, please do not post new questions in existing threads someone else started, unless they are directly relevant to the discussion in the thread. Starting a new thread is much beter. Second, be careful not to double post when you submit your messages. Third, please try to be as clear …

Member Avatar for Schol-R-LEA
0
113
Member Avatar for hmx7

The problem you are having is three-fold. First, you are using the same names (`student_name`, `School`, and `Majors`) for both classes, and for the parameters to the to `Student_Track.__init__()`. Second, you are using the names of the classes in your print statement, rather than names of the instance variables (which …

Member Avatar for hmx7
0
170
Member Avatar for princess.ferolino.1

Displaying color is something which is system-dependent; there are no standard C++ libraries which have any concept of colors. What operating system (e.g., Windows, Linux, MacOS) is this running under? Which compiler are you using? Are you using the system routines (if any) or a platform-independent third-party library such as …

Member Avatar for cambalinho
0
248
Member Avatar for MONTS
Member Avatar for Seldar
0
196
Member Avatar for Tewhano

I've tested your code (with GCC running under Code::Blocks) and found it to work, which indicates to me that the menu.txt file isn't in the same directory executable. Add the following test to you code right after the `open()` call: if(inData.fail()) { cout << "Could not open menu file. Stopping."; …

Member Avatar for Tewhano
0
134
Member Avatar for cwarn23

> So basically I need to know for the gcc compiler, how did they manually set the ones and zeros in accordance to the execution environment when you need to know how the execution envirment executes binary. Just as a matter of note: strictly speaking, the GCC C compiler *doesn't* …

Member Avatar for Schol-R-LEA
0
381
Member Avatar for andrew mendonca

Believe you misunderstood Ddanbe's point, I am afraid. The issue he was pointing out was not the use of the `switch()` statement; that was fine. The problem is that the variable you are testing, `symbol`, is never getting set to a usable value. You need to read in `symbol` after …

Member Avatar for Schol-R-LEA
0
151
Member Avatar for JamieVern

OK, the description is a bit intimidating, but it's also very detailed. You just need to follow the instructions and it should be fine. Given that, can you tell us what you are having trouble with? It would also help if you could post your existing code, so we can …

Member Avatar for Schol-R-LEA
0
210
Member Avatar for Rawan_92line

Well, the instructor's hint at the bottom definitely seems to be the place to start, really. I would pick the `Individual` class first, as it is the simpler of the two; it's really little more than [POD](http://en.wikipedia.org/wiki/Plain_old_data_structure), with no methods other than maybe getters and setters. The `Factory` class is …

Member Avatar for Rawan_92line
0
257
Member Avatar for reverend818

Being the evil little Schemer that I am, I would like to mention a bit of a diversion in the form of a [lecture on Netwon's Method as written in a completely different language](http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-001-structure-and-interpretation-of-computer-programs-spring-2005/video-lectures/2a-higher-order-procedures/), using methods which would be difficult (though perhaps not impossible) in C++. You can find the …

Member Avatar for mike_2000_17
0
389
Member Avatar for jessicaphillips

Please do not post offers of this sort here, especially in threads more than four years old. If you really feel an overwhelming need to help people cheat on homework, fine, that's your problem, not ours. If you want Freelancer.com, you know where to find it.

Member Avatar for Schol-R-LEA
1
655
Member Avatar for nhrnjic6

First off, don't forget to `delete` all memory allocated using `new`. Second, if your intent is to print out the table, then you don't actually need the array at all, as `Array[x]` will always equal `x + 1` anyway. Third, as things are now, you are printing a single entry …

Member Avatar for Schol-R-LEA
0
280
Member Avatar for Mafiamanandre

Perhaps we should start by asking: 1. do you know how to compare two numbers, so that you can get the larger of the two? 2. Do you know what an array is, how to declare an array in VB.Net, and how to get an element from an array? 3. …

Member Avatar for Schol-R-LEA
0
159
Member Avatar for krystosan

To run a program or script that isn't in a path directory, you need to give at least a relative path to the file: $ ./filterList This tells bash where to find the script in question.

Member Avatar for krystosan
0
807
Member Avatar for Saurav Akolia

If it is at all an option, I would recommend replacing Dev-C++ with [Code::Blocks](http://www.codeblocks.org/), a more up to date IDE with a similar interface and using the current version of GCC as it's default compiler. Not only does it avoid the problem you describe by keeping the console window open, …

Member Avatar for Moschops
0
138
Member Avatar for redkowloon

Can you show us what you have done on this project yourself so far? While we are happy to help you solve your problems, we will not simply hand you an answer without some effort on your part. To quote the DaniWeb community rules: >**Do** provide evidence of having done …

Member Avatar for Schol-R-LEA
0
217
Member Avatar for sathya.N

First off, the statement makes no sense. What are 'manets'? What sort of trust calculations are used for them? Why do you need such calculations? And most of all, what have you done so far on the problem yourself? After a bit of searching, I am assuming you are referring …

Member Avatar for Schol-R-LEA
0
102
Member Avatar for deep.chanda1

Before I get into your actual code, I have a few comments and suggestions to make. First off, get rid of Dev-C++ and get [Code::Blocks](http://www.codeblocks.org). Dev-C++ hasn't been updated in eight years, and the version of MinGW/GCC that comes with it is equally dated. You could update the version of …

Member Avatar for Saurav Akolia
0
410
Member Avatar for Spider_14

I think there is some confusion about the nature of operating systems going on here. That is natural, as much of the OS is hidden from view, while most of the things people think of as being part of the OS are actually separate programs (or at most sub-sections of …

Member Avatar for Assembly Guy
0
420
Member Avatar for xTurK

Well, fortunately, all you really need to do is change your `System.out.print()` calls to `.append()` calls on your `StringBuilder`: StringBuilder motCache = new StringBuilder(nombreLettres); for (i = 0; i < nombreLettres; i++) { motCache.append('.'); } (I hope that 'mot cache' is the correct phrasing for 'hidden word'...) You can then …

Member Avatar for xTurK
0
323
Member Avatar for logicslab

Could you please clarify what it is you need for us? It sounds as if you are having difficulty with the input itself. Is that correct? Assuming that this is the case, then there are a few options you can choose. The simplest of these is to use [`scanf()`](http://www.cplusplus.com/reference/cstdio/scanf/) to …

Member Avatar for logicslab
-1
377
Member Avatar for Ms

Does your professor require you to write your own Stack class? If not, then the `java.util.Stack` class would solve your issues right there. OTOH, stacks are easy enough to implement yourself; any linear data structure which allows you to add and remove an element from the same end (that is, …

Member Avatar for Schol-R-LEA
0
273
Member Avatar for kanagamani

Could you explain the question a bit better, please? It isn't clear just what you are looking for, especially what you mean by 'execute first'. That last part sounds like your professor's instructions to you rather than a part of the question. I assume you are asking, how would you …

Member Avatar for vegaseat
-1
128
Member Avatar for 123pythonme

The problem is that you are calling the `is_divisible()` function, and then, on a separate line, testing whether `True` is true, which will always be the case. What you want to do is call the function as part of the `if:` clause itself: primes=[] for n in range(2, N+1): if …

Member Avatar for vegaseat
0
581
Member Avatar for illyaizevielvon.einzbern

It may also help to read up on [indent style](https://en.wikipedia.org/wiki/Indent_style) (also called [brace style](http://www.catb.org/~esr/jargon/html/I/indent-style.html)) to help clarify the issue at hand. There are several ways to format C++ code, all of which have their advantages and disadvantages; the most important things are that you use a style that is widely …

Member Avatar for ikel
0
280
Member Avatar for DamianPrinze

First off, we don't do other people's homework for them. Second, we don't do other people's homework for them. And third, ***we don't do other people's homework for them***. Sensing a pattern here yet? No one here will simply hand you a solution on a silver platter. If you show …

Member Avatar for minimee120
0
2K
Member Avatar for Jalaishaa

Can you be a bit more specific about what is actually happening, then? Simply saying, 'This is not helping' gives us little to go on. #include <stdio.h> int main(void) { int n, prod, even; prod = 1; n = 30; for(even = 2; even < n; even += 2) { …

Member Avatar for Jalaishaa
0
182
Member Avatar for Andy90

I think you'll need to clarify things a bit before anyone can give you a helpful answer. Is your question about how you would call this function in general, or specifically about the difference between calling it in C and calling it in C++? I ask because, in most cases, …

Member Avatar for Schol-R-LEA
0
229
Member Avatar for Bhavya scripted

Oh dear, not this argument again :( It seems as if this argument flares up every three months or so, and frankly, it is purely a waste of effort. Let's first define our terms: a *programming language* is a language is capable of describing a sequence of actions for a …

Member Avatar for Bhavya scripted
0
232
Member Avatar for sagngh8

I have to agree with the consensus that as a practical skill, assembly language is not very useful. I would, however, argue that knowing something of assembly programming in general does help you understand some of the things going on inside of a compiled program, especially if you dig into …

Member Avatar for mathematician
0
788
Member Avatar for kalo150

The problem is that, just as with division, taking the modulo of a number by zero is undefined; what you are actually getting is a division by zero exception, as internally, both division and modulo (or rather, strictly speaking, remainder) are calculated using the same assembly instruction. Thus, this is …

Member Avatar for Schol-R-LEA
0
102
Member Avatar for RounaqJJW

Congratulations on finishing it, though once again, more detail on how you fixed it would have been appreciated. Also, just as a friendly reminder: when you do finish with the issue at hand, please mark the thread as closed, so that everyone knows you've solved the problem. TIA.

Member Avatar for Schol-R-LEA
0
978
Member Avatar for LokiSoliman

Hint: assuming that your iterator variable is `i`, try using `i += 2` instead of `i++`. In other words, for (i = 2; i < final_value; i += 2) This will step you two values at a time istead of just one.

Member Avatar for Ancient Dragon
0
164
Member Avatar for pwolf

I would mention *[Structure and Interpretation of Computer Programs](http://mitpress.mit.edu/sicp/full-text/book/book.html)* as a good starting place, but it's a controversial sugestion; on the one hand, it does an admirably job of covering programming in the small, starting from the ground up and moving alll the way through several complex topics. On the …

Member Avatar for john alternate
0
377
Member Avatar for mukulnimker7751

**mukulnimker7751**: would you mind explaining the problem in greater detail, i.e., the circumstances in which you need to access the server this way? It would be much easier to help you if we had a better idea of what is actually going on; as things are we can only answer …

Member Avatar for mukulnimker7751
0
232
Member Avatar for MasterHacker110

Questions about OS development are a bit outside the usual range for this forum; you might want to try the OS Dev forums at [OSDev.org](http://www.osdev.org), as they are experts in the subject. Note that you need to tread lightly there, as they are rather rough with newcomers and do not …

Member Avatar for Schol-R-LEA
0
204
Member Avatar for CCHIndiaStore

> Asking "What's the best programming language?" is much like asking "What's the best airplane?" - it entirely depends upon what you want to do with it. As Nelson-sensei once wrote, it is in some ways closer to asking, "What's the best religion?" Programmers often commit themselves to their tools, …

Member Avatar for mike_2000_17
-3
370
Member Avatar for GeekPlease

How hard it will be depends on just how ambitious you are, and what languages and tools you intend to use. Is there a specific type of game you are considering learning how to make? As for where to find information, well, [GameDev.net](http://www.gamedev.net/page/index.html) is probably a good resource, as it's …

Member Avatar for kal_crazy
0
213
Member Avatar for JoeD1

Your second (output) loop has an inner loop that looks to have been intended to iterate through the five test values; however, you then unrolled that loop, making the inner loop unnecessary. The solution is either to eliminate that inner loop altogether: for (int a = 0; a < grades.length; …

Member Avatar for stultuske
0
282
Member Avatar for fenri90

Several of us can help you, but you'll need to post what you've done so far. To quote [DaniWeb's forum rules](http://www.daniweb.com/community/rules): > Do provide evidence of having done some work yourself if posting questions from school or work assignments. As I said, we will provide assistance. We won't hand you …

Member Avatar for Schol-R-LEA
0
851
Member Avatar for HUSSEINI

> give me ur email id and i will send it to u within 3 days Please, please, *please* don't post this sort of thing. Aside from the use of SMS-speak, and the fact that you are directly offering to help someone **cheat**, asking for someone's e-mail address is both …

Member Avatar for sanjulovers
0
731
Member Avatar for iraklakis

A few things to take note of: * First off, this code appears to be C, not C++. Perhaps one of the moderators can move it over to the correct forum? * There are two back-quote characters on line 13 that don't belong there. * Variable-length arrays have to have …

Member Avatar for iraklakis
0
235
Member Avatar for DarrelMan

**DarrelMan**: Did you mean to post this in the C forum? While it is certainly possible to write a shell in C++, most OS courses use vanilla C for such projects. If you *are* using C++, then you ought to be able to use the overloaded equality operator to compare …

Member Avatar for DarrelMan
0
195
Member Avatar for m_ishwar

Uhm, all that `return` does is end the function. Since `command` is optional, not required, simply omitting the `command` keyword argument would do the trick. OTOH, if you think you absolutely need a function there (e.g., as a placeholder), you can use something like this: def empty_command: pass Which has …

Member Avatar for Schol-R-LEA
0
223
Member Avatar for daino

Assuming that you are creating a new file, then the simplest solution is just to name the file `testfile.html` to begin with: std::ofstream FileOne("c:\\testfile.html"); The C++ file I/O works the same no matter what the file extension is; a 'text file' is just a stream of bytes which is interpreted …

Member Avatar for daino
0
1K

The End.