David W's Profile User Rating: ***--

Reputation: 281 Architect
Group:
Authors
Active Posts:
1,969 (0.81 per day)
Joined:
20-September 08
Profile Views:
22,354
Last Active:
User is offline Private
Currently:
Offline

Previous Fields

Country:
CA
OS Preference:
Windows
Favorite Browser:
FireFox
Favorite Processor:
Intel
Favorite Gaming Platform:
Who Cares
Your Car:
Chevrolet
Dream Kudos:
1225

Latest Visitors

Icon   David W is off-line ...

Posts I've Made

  1. In Topic: Breaking the loop with enter

    Posted 1 Mar 2015

    Since you are using C++, why not just a C++ string for your input and getline?

    Then, you could have easy code like this:

    // exitLoopIfEnterPressed.cpp //
    
    #include <iostream>
    #include <string>
    
    using namespace std;
    
    
    int main()
    {
        for( ; ; )
        {
            cout << "Enter a line of text (or press 'Enter' to exit) : ";
            string line;
            getline( cin, line );
            if( line.size() == 0 )
            {
                cout << "Exiting loop now ...\n";
                break;
            }
            // else if reach here ...
            cout << "You entered: '" << line << "'\n";
            
            // can now convert C++ string to C string  ... if a C string needed //
        }
    }
    
  2. In Topic: Columns and Rows for Loops

    Posted 27 Feb 2015

    Hint:

    How are your numbers stored?

    1) All in one long int array of 24 numbers?

    or ...

    2) In a 2D array with 6 rows and 4 columns in each row?

    If stored as in 2) above ...

    can you code for an output loop like this:

    //for each row in twoDimArray
    {
       //for each col in (each) row
       {
          //print out number in that col followed by a space
       }
       // ok finished with this row ... so ...
       //print out a new line char now // go to a new line //
    }
    
    



    Edit:

    Oops ... I just noticed:

    Quote

    My objective is to print multiples of 4 that are less than 100 in a 4 by 4 format.


    So you are going to generate the numbers yourself, as you go ...
    So ... could do something like this:

    for( int i = 4; i < 100; i += 4 )
    {
       // print i followed by a space
       // if i % 16 == 0 print a newline char // i.e. go to to a new line
    }
    
    
  3. In Topic: How do I record multiple inputs for 2 orders on 2 different registers?

    Posted 27 Feb 2015

    You need to re-read the 'problem' ...

    Quote

    Write a c++ program that does the following:
    Create a Register class that can store all of the receipts
    for the day and the totals for that register.


    So ... each cash-register STORES each order (could use a struct for each order.)

    Thus ... could use a vector of struct to hold all orders for each cash-register
    also could have a member to track the running dollar sum of orders so far.

    Does this look familiar?
  4. In Topic: simple doubt on basic sorting in c++

    Posted 14 Aug 2014

    01	#include<iostream.h> // use #include <iostream>
    02	#include<conio.h>    // don't use this to keep code portable
    03	void main()          // the standard is int main() ... i.e. main returns an int
    04	{
    05	   clrscr();            // don't use this or any parts of conio.h for the aabove mentioned reason
    06	   int a[6],k,i,j,temp;
    07	   cout << "Enter 6 numbers : " << endl ;
    08	   for(i=0;i<6;i++)
    09	   {
    10	      cin >> a[6]; // 2 BIG errors here ... but both fixed by changing 6 to i
    11	   }
               // ...
    
    


    just to get you started ...


    Also ... you may want to do some web research until you 'see' how a bubble sort works ...?

    It is really easy and obvious ... 'when you see it' .
  5. In Topic: Help on Class and Client Program

    Posted 30 Jul 2014

    Take a simple example:

    int a = 5, b = 6, c = 7, d;

    // this is ok and will compile:
    d = a + b + c;

    // this is NOT ok and will NOT compile:
    d + a = b + c; // bad line // why ? //


    You had tried above ...

    Quote

    double GiftWrap::calcTotal(double subtotal, double tax)
    {
        double total;
        subtotal + tax = total;
        return total;
    }
    
    

My Information

Member Title:
DIC supporter
Age:
67 years old
Birthday:
June 29, 1947
Gender:
Location:
Toronto Ontario Canada
Interests:
The events that lead up to the soon return of Yeshua (Jesus) ... and being ready
Full Name:
David Wayne Zavitz
Programming Languages:
Basic
6502 Assembly
Comal
C++
HLA (High Level Assembly)
Pascal
C
Python
Sqlite3

Comments

Page 1 of 1
  1. Photo

    Invincible-99 Icon

    29 Jun 2012 - 06:10
    Oh, sorry!
    That link doesn't work.
    http://i48.tinypic.com/34qqrg3.jpg
  2. Photo

    Invincible-99 Icon

    29 Jun 2012 - 06:06
    Hi!
    [IMG]http://i48.tinypic.com/34qqrg3.jpg[/IMG]
  3. Photo

    Anarion Icon

    24 Jun 2012 - 13:44
    Regards to you, awesome friend! ;)
  4. Photo

    v0rtex Icon

    07 Jun 2012 - 03:04
    Thanks for the link! Why would u advise I look at HLA?
  5. Photo

    caleb123 Icon

    22 Jun 2010 - 19:37
    Would you like to be my website designing buddy? If you do, you can email me at cheryman22@yahoo.com
    You and I can give each other tips and answer question to make us both better at designing websites.
  6. Photo

    skyhawk133 Icon

    08 Jun 2010 - 09:43
    Great to have you David! Thanks for the kind comment.
  7. Photo

    xxxpriya Icon

    20 Feb 2010 - 21:25
    thanx a lot david
Page 1 of 1