"A poopy seed bagel..."
Actually, the many bagel shops here are always looking for a new flavor!
gross. :P
"A poopy seed bagel..."
Actually, the many bagel shops here are always looking for a new flavor!
gross. :P
A poppy seed bagel with salmon cream cheese and turkish coffee.
For a brief second, I read that as "A poopy seed bagel..."; HA!
Cold can of Sierra Mist
hardees breakfast #8- Frisco sandwich (substited bacon instead of ham, egg, cheese, and sower dough bread (yum)), hashbrowns and a drP
nevermind, got it. Didn't have it in the activated area.
I'm trying to get totCust and totRev which are declard in videoBonanzaForm to show up in the summaryForm.textboxes
I have them declared as friends; i've even tried assigning me.textbox.text = "1"
and nothing shows up still when I click the Summary button (in videoBonanzaForm).
I open the summary form with summaryForm.showDialog()
Public Class summaryForm
Private Sub videoLabel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles videoLabel.Click
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
Me.Text = videoBonanzaForm.totCust
End Sub
Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
Me.Text = videoBonanzaForm.totRev
End Sub
Private Sub okButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles okButton.Click
Me.Close()
End Sub
End Class
So, I've ordered two separate books for studying C#, and am sending them both back. One was Murach's C# 2005 and the other is Illustrated C# 2005 by Daniel Solis. Neither of them were written the way I like to learn; I prefer a textbook style of learning with exercises and whatnot (and preferably some color), neither of which gave me that. I've ordered my 3rd book and hope it's better than these have been. The book I got this time is Programming C#, Fourth Edition by Oreilly.
Anyone have good experience with any of these books?
bacon egg and cheese biscuit and a large DrP from Hardees.
Even the first question makes no sense...
The entire thing is rigged to produce low scores, as is to be expected from something obviously produced by a leftist idiot.
agreed.
though, i did get a 1, and that's pretty accurate :P. I may have accepted anything <=4
No more controller talk; how bout them graphics
but i want to initialize it with the data stored in myArray
alright cool. so i added this to my code:
char init [ 10 ] ;
CharPair c ( 10 , init ) ;
for ( int j = 0 ; j < 10 ; j++ )
cout << c [ j ] << endl ;
and now I get this output:
Ñ
╥
u
╕
╨
§
B
10
A
B
Illegal index value.
Press any key to continue . . .
Hey guys. I need to add a constructor that takes an int argument, sz, and an array of char of size sz. I then need the constructor to set the first sz members of the private dara array (myArray) to the sz members of the argument array of char.
Here's what I've got so far; I'm not sure how to call the object (i.e., CharPair ( 10 , x [ ] ) )
#pragma once
#include <cstdlib>
#include <iostream>
using namespace std ;
class CharPair
{
public:
CharPair ( ) ;
CharPair ( int ) ;
CharPair ( int , char [ ] ) ;
void outSize ( ) ;
char& operator[] ( int index ) ;
private:
char myArray [ 100 ] ;
int size ;
} ;[/code][/code][code][code=c++]#include "prob4.h"
CharPair::CharPair ( ) : size ( 10 )
{
for ( int i = 0 ; i < size ; i++ )
myArray [ i ] = '#' ;
}
CharPair::CharPair ( int sz )
{
for ( int i = 0 ; i < sz ; i++ )
myArray [ i ] = '#' ;
}
CharPair::CharPair ( int sz , char test [ sz ] )
{
for ( int i = 0 ; i < sz ; i++)
test [ i ] = myArray [ i ] ;
}
void CharPair::outSize ( )
{
cout << size << endl ;
}
char & CharPair::operator []( int index )
{
if ( index < size && index …
Christina and I are eating white-trash/dog chow/any other crazy name. It was fun to make but is more fun to eat :)
thanks guys! i had an awesome birthday. Got a 360-elite from mom, halo 3 from my brothers, and a bluetooth moto earpiece from christina (which comes in handy sooo much at work and on the road).
I LOVE BIRTHDAYS!!!
Forgot about josh though :( Happy belated birthday!
it is. It is awesome! They included two new gametypes, Zombies and VIP. Everyone should know what zombies is but VIP is where someone on your team is the VIP and the other team gets more points for killing them, or you are more powerful when you're standing next to them.
As far as the cinemas, I love them. I'm all about the story line; the more movies the better. The game play is freaking incredible too. The graphics are so amazing; granted, i've only seen them in HD.
Ok, I got it but not sure I did it the most efficient way:
bool operator < ( const Rational & r1, const Rational & r2 )
{
if ( r1.den < 0 && r1.num > 0 && r2.den > 0 && r2.num > 0 )
return true ;
else if ( r1.den > 0 && r2.den < 0 && r2.num > 0 && r1.num > 0 )
return false ;
if ( r1.num * r2.den < r2.num * r1.den )
return true ;
else
return false ;
}
Ok, I know how to check inequalities for postitive rational numbers:
if ad < cb then a/b < c/d
but what do I do if b or d is negative?
Oh, ok. Thanks!
:self-esteem lowered by 2 points:
Problem # 2; here's my header file:
#pragma once
#include <iostream>
using namespace std ;
class Rational
{
public:
Rational ( int , int ) ;
Rational ( int ) ;
Rational ( ) ;
void normalize ( ) ;
friend ostream & operator << ( ostream & os , const Rational & r ) ;
friend istream & operator >> ( istream & is , const Rational & r ) ;
private:
int num ;
int den ;
} ;
Rational::Rational ( int x , int y ) : num ( x ) , den ( y )
{ /*Body intentionally empty*/ }
Rational::Rational ( int x ) : num ( x ) , den ( 0 )
{ /*Body intentionally empty*/ }
Rational::Rational ( ) : num ( 0 ) , den ( 0 )
{ /*Body intentionally empty*/ }
ostream & operator<< ( ostream & os , const Rational & r )
{
os << r.num << "/" << r.den ;
return os;
}
istream & operator >> ( istream & is , const Rational & r )
{
char x ;
is >> r.num >> x >> r.den ;
if ( r.den == '0' )
{
cout << "Division by '0' impossible - Exiting program" << endl ;
exit ( 1 ) ;
}
return is;
}
At line 36 I added the word const and now when I run the program it waits about 2 seconds and says Process is terminated due to StackOverflowException and craps out
Could somone give me a hint as to why my division by 0 check doesn't work?
istream & operator >> ( istream & is , Rational & r )
{
char x ;
is >> r.num >> x >> r.den ;
if ( r.den == '0' )
{
cout << "Division by '0' impossible - Exiting program" << endl ;
exit ( 1 ) ;
}
return is;
}
x should be the '/' symbol
Hey guys,
I have spiceworks setup on our servers at work and need to setup some dns record to give them friendly names. Right now, we access the helpdesk via server:9000 in a web browser, but I would like to make the access name something along the lines of server/helpdesk.
any help?
Roger.
// 0801.cpp
#include <iostream>
#include <cstdlib>
#include <cmath>
using namespace std;
//Class for amounts of money in U.S. currency.
class Money
{
public:
Money( );
Money(double amount);
Money(int theDollars, int theCents);
Money(int theDollars);
const Money percent ( int percentFigure ) ;
double getAmount( ) const;
int getDollars( ) const;
int getCents( ) const;
void input( ); //Reads the dollar sign as well as the amount number.
void output( ) const;
private:
double dollars; //A negative amount is represented as negative dollars and
double cents; //negative cents. Negative $4.50 is represented as -4 and -50
int dollarsPart(double amount) const;
int centsPart(double amount) const;
int round(double number) const;
};
const Money operator +(const Money& amount1, const Money& amount2);
const Money operator -(const Money& amount1, const Money& amount2);
bool operator ==(const Money& amount1, const Money& amount2);
const Money operator -(const Money& amount);
/************************
operation overloading declaration data for ch8.prob1
************************/
bool operator < (const Money & amount1 , const Money & amount2 ) ;
bool operator > (const Money & amount1 , const Money & amount2 ) ;
bool operator <= (const Money & amount1 , const Money & amount2 ) ;
bool operator >= (const Money & amount1 , const Money & amount2 ) ;
/******************************************************************/
#include "prob1.h"
int main( )
{
Money yourAmount, myAmount(10, 9);
cout << "Enter an amount of money: ";
yourAmount.input( );
cout << "Your amount: ";
yourAmount.output( );
cout << endl;
cout << "My amount: ";
myAmount.output( );
cout << endl;
/************************
Test data for …
Is the printing to a file/Word part of the assignment or just so you can print it out and turn it in?
1. I need it to sort descendingly, not ascendingly.
try rethinking this part of your code:
if( score[i] < score[j] )
{
...
}
how does the compiler know what the value of 'i' is here:
string names[3] = {"John","Anne","Mary"};
int score[i];
At the bottom of the thread, since you're the creator, you will see a link that says "Mark thread as solved."
Thanks!
you are using integers, so the program drops all fractions. percentFigure / 100 is 0 for all values of percentFigure less than 100. Change data types to float and it will work as you expected.
I had already tried this. It's still not outputting anything other than 0. However, I just tried doing 100/100 * dollars to see if it would work and it did output the correct answer for that equation. Where else should I have changed the int to double?
I've narrowed it to here somehwere (i think)
dollars = dollars * ( percentFigure / 100 ) ;
hey guys. the following code should return a percentage of the current values of the object. I keep getting 0 returned. If this isn't enough code let me know.
Money test = ourAmount.percent ( 10 ) ;
test.output ( ) ;
const Money Money::percent ( int percentFigure )
{
return ( percentFigure / 100 * dollars + percentFigure / 100 * cents ) ;
}
void Money::output( ) const
{
int absDollars = abs(dollars);
int absCents = abs(cents);
if (dollars < 0 || cents < 0)//accounts for dollars == 0 or cents == 0
cout << "$-";
else
cout << '$';
cout << absDollars;
if (absCents >= 10)
cout << '.' << absCents;
else
cout << '.' << '0' << absCents;
}
I made my mom a mother's day card in 3rd grade.
post more jokkesss!!! :)
I know this is a little late, but if you live in the US, switch to law and join the money making crowd. In your present technical field you will always be just a peon competing with low paid labor from India or China.
#1
I always like to go by something one of my favorite teachers said to me; if you do what you love you'll never work a day in your life. If computers is what someone is interested in, you think they would rather begin a career in law for a few extra bucks? I wouldn't.
#2
The surplus in attorneys is ridiculous right now. My Economics teacher has a degree in law and said he is making more as a college professor working 20 hours a week, 30 weeks a year than if he were working as an attorney 40hr/week 50weeks/yr. That says something.
I thaught you already did? Doesnt it use it for swapfile? thats what my old-school Xbox1 does?
No, something beyond that I think. This is just hear-say, but I was told to be sure to get the one with the hard drive because they're going to be doing something funky with the way games are played and it will require the hdd.
a peppermint :)
alright i'll try that. thanks!
I honestly don't understand overloading operators at all. Something about the left hand side and right hand side being different and whatnot... it's all a big blur right now. I read about 30 pages of my c++ text and finally just gave up, deciding to go to bed and try again tomorrow.
Maybe if you or someone else gets time, you could briefly explain how they work? I know that's a big question to ask, so if you can't no worries, i'll figure it out eventually.
see ya tomorrow.
I heard eventually you'll have to have the harddrive to play the games, which is why I'm going to go ahead and get the Elite. If you do get the 20GB and you find it's not enough, they have the 120 replacement with a kit for transfering the data from the 20GB to the 120GB, but it's ~$180
I'm not that worried about not having an HD player in it, since I A) have a freaking sweet monitor with my computer and B) rarely get enough time to plan and watch a movie. In contrast, I'll have tons of 15-30 minute opportunities to play my games in HD :)
I think 360 is best out right now; yeah PS3 might have better graphics, but there's like 1.5 good games.
my appologies.
What is it exactly that you're looking for?
Could someone possibly post a brief explanation of the differences between member and nonmember operator overloading?
I was just thinking... if someone were to write a C++ tutorial on nothing but operator overloading and friends... that would be kick A; i would add them to my buddy list even.