Posts
 
Reputation
Joined
Last Seen
Ranked #240
Strength to Increase Rep
+9
Strength to Decrease Rep
-2
91% Quality Score
Upvotes Received
122
Posts with Upvotes
115
Upvoting Members
72
Downvotes Received
12
Posts with Downvotes
9
Downvoting Members
9
22 Commented Posts
6 Endorsements
Ranked #299
Ranked #287
~501.59K People Reached
About Me

Enjoy helping beginners in C/C++ programming

Interests
Lots ... but mostly getting ready for soon return of Yeshua
PC Specs
64 bit Win 7 OS
Favorite Tags
c++ x 578
c x 182
input x 26
Member Avatar for <iostream>

Using several functions ... a function for each task ... could really help your program development ... and help elucidate the logic flow. // restaurant.cpp // #include <iostream> #include <string> // to keep code portable ... best not to use this // #include <windows.h> using namespace std; const string HEADER …

Member Avatar for Amiira ahmet
1
9K
Member Avatar for Luka_1

Once you get started coding in Python ... and get some feel for its (often very) simple coding style and power ... you may then want to DO many of your programming jobs in Python first ... and many of those, then ... may never get recoded in C++ :) …

Member Avatar for Adina_2
0
72K
Member Avatar for Mahnoor_1

If you were to google C++ file read / write you could find many code examples and articles to help ... ( also re. overloaded << and overloaded >> ) ... Here is a link with several file read / write examples ... You might like to take a look …

Member Avatar for Muhammad_251
0
4K
Member Avatar for Reverend Jim

I haven't checked in for a long time ... We are, for sure, living in the time, long foretold, of *Great Deception* ... see Matthew 24. The first thing I heard Trump say, back in 2016, was: *I was greedy for myself, but now I'm going to be greedy for …

Member Avatar for rproffitt
1
22K
Member Avatar for angbatangprog

You may get a few coding ideas from the related examples here: http://developers-heaven.net/forum/index.php/topic,2022.msg2680.html#msg2680

Member Avatar for Apoorva_2
0
6K
Member Avatar for Jack_9
Member Avatar for Bob

Hey @ Zain_4 ... Do you realize that it is *not* proper etiquette to *hijack* a thread? If you wish to ask a new question, please start a new thread ... and if you need programming help with an homework question ... you will NEED TO FIRSTLY show us the …

Member Avatar for JamesCherrill
3
52K
Member Avatar for luke_8

Firstly, you may like to note that you mentioned using a vector of characters, but your code uses C++ strings, which is probably what you really meant to say? Also, you need to lean to break up your program into 'jobs' ... and each job can be called by coding …

Member Avatar for David W
0
1K
Member Avatar for Name_1

Also ... in C++ you usually do NOT want redundant parameters in a class! For example, in a circle, if you know one of: radius, diameter, circumference, area you can calculate all the other ... And note that PI (pi) is a constant value defined as the ratio of the …

Member Avatar for David W
0
1K
Member Avatar for ReneeJA

Did you realize that you are taking in your 3 data elements twice? And that the 2nd 'take in' set of data ... over-write the first? Also ... do you realize that in math: For any value a, ( a - 0.18*a ) = a * (1 - 0.18) = …

Member Avatar for owlowl076
0
1K
Member Avatar for Tre Sivileo

Sometimes a table-lookup method is a nice way to handle problems like this. You might like to see the examples here: http://developers-heaven.net/forum/index.php/topic,134.msg709.html#msg709

Member Avatar for tinstaafl
0
299
Member Avatar for 고시퍼

You may like to try someting like this to get valid input and to prevent program crashing on accidental input of an invalid type. #include <stdio.h> #define ROWS 5 #define COLS 10 #define COST_PER_SEAT 150 /* Simple input of an integer... i.e. NO range checking done */ int takeInInt( const …

Member Avatar for David W
0
549
Member Avatar for can-mohan

You seem to have two distinct parts to your project: 1) Code and test a class String 2) Use that class (and perhaps some of its methods) to process lines of words. It may be helpful to start with part 2) and there, using the C++ string until 2) is …

Member Avatar for JamesCherrill
0
475
Member Avatar for naruto_2

Where in your code is the problem ... what lines ? What are the error messages? If you have a static method in class A you can call like this: A.yourAstaticMethod(anyArgsGohere...); Otherwise you need to firstly create an object of class A A a; // call default ctor... a.yourAmethod(anyArgsGoHere...);

Member Avatar for tinstaafl
0
390
Member Avatar for shalu_1
Re: c++

It is now past 17:30 EST ... and you will need to ask for an extension if you still need help with your school project ... In the future ... if you wish help at this very willing to help, help site, please firstly supply us with the code you …

Member Avatar for ddanbe
-1
378
Member Avatar for Jemone_1

@ Dean_5, are you a Java programmer? You said: > ... C++ doesn't allow string comparison via "==" ... Please take a look at: http://www.cplusplus.com/reference/string/string/operators/

Member Avatar for David W
1
377
Member Avatar for Roger_2

One quick way to handle this, that easily extends to 'integers' of any length, is to input your numbers as strings ... and then to code a function to increment each 'digit' in this string as proscribed ... with a carry term to the 'next left' digit for the case …

Member Avatar for Taywin
0
455
Member Avatar for David W

This thread will be an attempt to develope a SIMPLE (and good enough) class for beginning Java students, to ease their coding for valid and crash proof, user (Console type) input, (and also handle Console output.) We assume here that beginning students need not worry much, about obtaining the fastest …

Member Avatar for JamesCherrill
0
1K
Member Avatar for PulsarScript

Try these three files: 1st: import java.util.Scanner; public class Console { private static Scanner sc = new Scanner(System.in); public static void displayLine() { System.out.println(); } public static void displayLine(String s) { System.out.println(s); } public static String getString(String prompt) { System.out.print(prompt); String s = sc.nextLine(); return s; } public static int …

Member Avatar for PulsarScript
0
587
Member Avatar for Linzi c++

Is there a clue in the Dani user name that has a `C++` in it, as in: `Linzi c++` Maybe it's some kind of generic code ? So ... to answer the request about coding an input request: `int radius = takeInInt( "Enter your desired radius: " ); // 'takeInInt' …

Member Avatar for David W
0
338
Member Avatar for zzQwerty

As suggested above, you seem to be a bit confuzzed? Working with C++ binary files can be a little tricky, especially at the beginning. I'm not sure what you were supposed to do here, but here is a little demo class to show how one might append int values to …

Member Avatar for David W
0
436
Member Avatar for sarah_15

You could use some class methods to aid console string input as per here; https://www.daniweb.com/programming/software-development/threads/506093/java-output Also a class for Customer with methods and a class for Item with methods maybe each could have takeInInfo methods also ? Then all you need is a loop with in a loop as per …

Member Avatar for JamesCherrill
0
1K
Member Avatar for poloblue64

It is good for you to learn, as early as possible, some simple 'student type' ways to get numeric imput ... from a keyboard user, so that the running program will nor crash if invalid data was entered. The following little demo may help to get you started in that …

Member Avatar for David W
0
545
Member Avatar for poloblue64

Here is a little more general way one might handle a problem like this ... (the code also demo's using templates in C++.) // print_a_col.cpp // #include <iostream> using std::ostream; // set here what you need ... const size_t NUM_COLS = 4; // NOTE: below we pass in ALL parameters …

Member Avatar for David W
0
312
Member Avatar for JosesMelo

In C++, best NOT to use C type strings. Use C++ string instead. The C++ string will size itself to be the right size to hold your string and can be as big as available memory for a C++ string See: http://www.cplusplus.com/reference/string/string/ and: http://www.cplusplus.com/reference/string/string/max_size/

Member Avatar for rubberman
0
289
Member Avatar for taylor0934

I might start off with a very simple bottom up re-design with planes coming into a queue and departing from the same queue in fifo order ... with maybe something like ... ? struct Plane { int id; string from; string arrived; string to; string departed; } ; struct Gates …

Member Avatar for David W
0
1K
Member Avatar for sungilcool

I would start fresh and use a C++ typedef vector< vector < double > > Matrix; then code something, beginning like the following, to exploit the power built into C++ ... void takeIn( Matrix& mat ); Matrix& operator += ( Matrix& a, const Matrix& b ); Matrix operator + ( …

Member Avatar for tinstaafl
0
1K
Member Avatar for Eskindir_1

Maybe you want this? while(getline(infile,substance[index],',')) { // getline(infile,substance[index],','); // done above // infile >> molWeight[index]; } It is hard to tell what you want without some sample data file. Perhaps the following example of reading a csv data file might help? // fileReadWriteStudent_csv.cpp // #include <iostream> #include <iomanip> // re. …

Member Avatar for tinstaafl
0
7K
Member Avatar for glao

int q = 10; void fun(int *p) { *p = 15; // after this point, the 'int' at the address passed in holds 15 p = &q; // NOW ... p holds a different address, the address of global q printf("%d ",*p); }

Member Avatar for glao
0
227
Member Avatar for isla.rose.3

Or ... (sorry to be a little late getting back) ... you might like to see a type of 'table look up' solution approach .. that can reduce code bulk and streamline logic flow ... # examplePairsInList.py # def takeInFlt( msg ): ok = False flt = 0.0 while not …

Member Avatar for ashaa
0
3K