Duki 552 Nearly a Posting Virtuoso

What about our constitutional rights as Americans? If we start eroding our rights, some day we'll end up like the British :D.. then our fate will be no different from that in 1984. If guns were illegal, the killer could have still bought one off the black market.. or used one of millions of other lethal weapons...

I'm pretty sure our forefathers didn't intend to shoot a deer with a fully automatic machine gun... or a hand gun even. The major influence for allowing guns was for hunting purposes... i seriously doubt anyone expected a hand gun in every american home.

And yeah sure they could buy guns or whatever off the black market... that's like saying oh well lets make heroin and cocain legal because people can get it anyways!! yeah!!

http://www.nationmaster.com/graph/cri_mur_wit_fir-crime-murders-with-firearms
Look at #4 where guns are legal.
Look at #20 ... jbennet? This seem accurate?

Like christina said, if anyone has watched bowling for columbine it explains gun control so much more than we can.

How are you people going to sit there and say guns are not the problem... how can you really think the death toll wouldn't drop dramatically if hand guns and automatic rifles were outlawed?! I say keep the hunting rifles and do away with everything else... You can't stop the problem, but you can support the solution.

Duki 552 Nearly a Posting Virtuoso

so who's go?

Duki 552 Nearly a Posting Virtuoso

i did

Duki 552 Nearly a Posting Virtuoso

hm, how did you get 5.48 x 10^6 instead of x 10^3?

Duki 552 Nearly a Posting Virtuoso

I got 5,484.375 J and 1 310.79708 calories ?

christina>you commented: hey cutie.. it's me again. yay! i love you mucho grande. +4
Duki 552 Nearly a Posting Virtuoso

probably right, i just knew they weren't completely foreign... =\

Duki 552 Nearly a Posting Virtuoso

meh, i like the small font for everything else... just reading larger fonts makes it easier. impo

Duki 552 Nearly a Posting Virtuoso

Yeah... i really do like the small font on everything else though. Larger fonts just tend to improve readability.

Duki 552 Nearly a Posting Virtuoso

Hm, I don't mind it though users with smaller monitors may have a scrolling issue. I find it to be easier on the eyes myself.

I think a lot of it is just the change of it... give it a week or so and then if people complain maybe it's a problem... I agree, it sort of feels akward, but I'm sure once I get used to it, I will appreciate the change.

Duki 552 Nearly a Posting Virtuoso

Ok, nevermind. I got it working, it was actually always working. It was just a human calculation error on my behalf. Thanks.

Duki 552 Nearly a Posting Virtuoso

Hm... well it's supposed to determine the taxes due according to certain circumstances. does that help?


i put in single, 14999, and .01 into pention and should get $1252.35 due, but instead i get 1402.35

Duki 552 Nearly a Posting Virtuoso

This program works unless I input 's' for marital status. Does anyone see my logic error?

#include <iostream>
#include <iomanip>

using namespace std ;

void getData ( int& numChild , double& grossSalary , double& penPay , char& maritalStat ) ;
double taxAmount ( int& numChild , double& grossSalary , double& penPay , char& maritalStat ) ;
int main()
{
    int numChild ;

    double grossSalary ;
    double penPay ;
    double taxPay ;

    char maritalStat ;

    getData ( numChild , grossSalary , penPay , maritalStat ) ;
    taxPay = taxAmount ( numChild , grossSalary , penPay , maritalStat ) ;

    cout << fixed << showpoint << setprecision(2) ;
    if ( taxPay < 0 )
    {
        cout << "Tax Owed:  $0.00" << endl ;
    }
    else
        cout << "Tax Owed:  $" << taxPay << endl ;

}

void getData ( int& numChild , double& grossSalary , double& penPay , char& maritalStat )
{
    int x ;

    cout << "Marital Satus [M/S]:  " << flush ;
    cin >> maritalStat ;

    if ( maritalStat == 'm' || maritalStat == 'M' )
    {
        for ( x = 0 ; x < 1 ; x++ )
        {
        cout << "Number of children under the age of 14:  " << flush ;
        cin >> numChild ;
        if ( numChild < 0 )
        {
            cout << " --  ! INVALID INPUT !  --" << endl ;
            x = -1 ;
        }
        }
    }

    cout << "Gross Salary  --[ if married, enter combined salary ]-- :  $" << flush …
Duki 552 Nearly a Posting Virtuoso

thanks infarction. I would use this, but we havn't gone over any limits and are just studying namespaces this chapter. Thanks though =)


I'll just go with it, thanks dragon.

Duki 552 Nearly a Posting Virtuoso

ah dang, didn't see musical... GREASE ALL THE WAY!!! WOOO

joshSCH commented: dude, props for having the same birthday as me.. just one year earlier -Josh +2
Duki 552 Nearly a Posting Virtuoso

I also got 14.72N..

word? well... even if we're wrong, at least I won't feel as bad now. :mrgreen:

Duki 552 Nearly a Posting Virtuoso

Hey guys, here's the question I'm asked.

a.
Define an enumeration type, triangleType, that has the values scalene, isosceles, euilateral, and noTriangle.

b.
Write a function, triangleShape, that takes as parameters three numbers, each of which represents the length of a side of the triangle. The function should return the shape of the triangle.

c.
Write a program that prompts the user to input the length of the sides of a triangle and outputs the shape of the triangle.

Here is my code:

#include <iostream>

using namespace std ;

enum triangleType { scalene , isosceles , equilateral , noTriangle } ;
triangleType triang ( double , double , double ) ;

int main()
{
    double a ;
    double b ;
    double c ;

    int shape ;

    cout << "Side 'a' length:  " << flush ;
    cin >> a ;
    cout << "Side 'b' length:  " << flush ;
    cin >> b ;
    cout << "Side 'c' length:  " << flush ;
    cin >> c ;

    shape = triang ( a , b , c ) ;
    switch (shape)
    {
    case 0:
        cout << "Triangle Shape:  Scalene" << endl ;
        break ;
    case 1:
        cout << "Triangle Shape:  Isosceles" << endl ;
        break ;
    case 2:
        cout << "Triangle Shape:  Equilateral" << endl ;
        break ;
    case 3:
        cout << "Triangle Shape:  -- No Shape --" << endl ;
        break ;
    }

    return 0 ;
}

triangleType triang ( double a , double b , double c )
{

    triangleType …
Duki 552 Nearly a Posting Virtuoso

hey guys, could someone explain why you include string::size_type or string::npos? What do these do?

Duki 552 Nearly a Posting Virtuoso

comedy yo

christina>you commented: add to my rep! :) -christina +3
Duki 552 Nearly a Posting Virtuoso

meh, i probably did something wrong... i got 14.7N

if someone gets the right answer, will you post the equation you used? Haven't really done this yet... just basic single object friction movement.

Duki 552 Nearly a Posting Virtuoso

I still don't see your logic for using the input file anyway. Look, this is going to be an infinite loop because you never advance inp:

while ( !inp.eof() )
    {

What might be more useful is to pass the outfile as a parameter, as you need that to print out the information to file.

I don't understand =/

The grades are going to be read from an input file in the following format:

f 3.4
f 2.5
m 2.8
f 4.0
m 3.8

I'm also getting this error:

.\Programming Exercise 4.cpp(56) : error C2784: 'std::basic_istream<_Elem,_Traits> &std::operator >>(std::basic_istream<_Elem,_Traits> &,std::basic_string<_Elem,_Traits,_Alloc> &)' : could not deduce template argument for 'std::basic_istream<_Elem,_Traits> &' from 'std::ofstream'

at line 56 (post #1)? This error shows up like 50 times in the same spot...

Duki 552 Nearly a Posting Virtuoso

4 * 4 = 16

Duki 552 Nearly a Posting Virtuoso

so a stopwatch that ticks past 31 seconds isn't proof? I don't get it...

joshSCH commented: -Josh +2
Duki 552 Nearly a Posting Virtuoso

i would probably take over the world... somehow

Duki 552 Nearly a Posting Virtuoso

i personally think the universe being created 30 seconds ago is a ridiculous thought... that's like that professor and his students who claimed they figured out how to divide by 0... i mean c'mon... there's a fine line between brilliant and mad.

Duki 552 Nearly a Posting Virtuoso

sigh*... what a newb

Duki 552 Nearly a Posting Virtuoso

Ok, so here are the rules:

-Keep the questions very basic (PHYS 101 & 102); this is, afterall, a computer forum.
-Wait for confirmation that your answer is correct before posting your question.
-If 24 hours passes and still no confirmation, post a new question to keep the game going.


** Please follow the rules! **

I'll start:

Question:

A car (mass = 1100kg) is traveling at 32 m/s when it collides head-on with a SUV (mass = 2500kg) traveling in the opposite direction. In the collision, the two vehicles come to a halt. At what speed was the SUV traveling?

joshSCH commented: Thanks, great game idea -Josh +2
Duki 552 Nearly a Posting Virtuoso

well, cisco controlls 95%+ of the internet backbones which is why I would strongly suggest Cisco certifications. Any serious company will go with cisco equipment.

Net+ is only the simple foundations of networking. I haven't taken my Net+ yet, though I plan on it this summer... the only studying I've done is cisco netacad semesters 1 and 2, and my instructor said it shouldn't be a problem to pass. What that tells me is Net+ is only 1/6 the knowledge of a CCNP.

Personally, I prefer CompTIA exams because it's a once passed always passed... but I guess the vendor specific certs are the ones that really make a difference in pay.. which is why it makes since that it's manditory to take update tests.

Duki 552 Nearly a Posting Virtuoso

It shows the error at line #35 (in main).

#include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
using namespace std;

// initializes count of females, count of males, female GPA sum, and male GPA sum
void initialize(int & fCnt, int & mCnt, double & sumFemaleGPA, double & sumMaleGPA) ;
// opens input & output files; sets output to fixed-showpoint-precision2
void openFiles(ifstream & inF, string iNam, ofstream & outF, string oNam) ;
// adds male and female grades; produces sum of each
void sumGrades ( ifstream & , double & , double & , int & , int & ) ;
// finds male and female averages
void averageGrade ( double & sumFemale , double & sumMale , int & mCnt , int & fCnt , double FemaleAvg , double MaleAvg ) ;
// prints relative results
void printResults ( double & sumFemale , double & sumMale , int & mCnt , int & fCnt , double FemaleAvg , double MaleAvg ) ;

int main()
{
    int fCnt ;
    int mCnt ;

    double sumFemaleGPA ;
    double sumMaleGPA ;
    double MaleAvg ;
    double FemaleAvg ;

    string inName = "inputTxt.txt";
    string outName = "no07out.txt";
    ifstream inp;                // input file stream variable
    ofstream outp;                // output file stream variable

    initialize( fCnt , mCnt , sumFemaleGPA , sumMaleGPA ) ;
    openFiles( inp, inName, outp, outName ) ;
    sumGrades( ifstream & inp , sumFemaleGPA , sumMaleGPA , fCnt , mCnt ) ;
    averageGrade( sumFemaleGPA , sumMaleGPA , fCnt , mCnt , FemaleAvg , MaleAvg ) …
Duki 552 Nearly a Posting Virtuoso

>Is there a way I can cin Mon, skip char, cin Day, skip char, cin Year ?
Too complex for cin , way easier with getline() . Just use it to grab the entire line, and then parse out the numbers in between the tokens (perhaps use strtok ?)

this sounds great, how do you use strtok?

my current string code:

string line ;
    getline ( cin, line ) ;
    int length = line.length () ;
    if (length != 10)
    {
        cout << "--  !! Invalid Date !!  ---  !! Terminating Program !!  --" << endl ;
        return 1 ;
    }
Duki 552 Nearly a Posting Virtuoso

fixed all the <>'s.

Now i'm getting an error in the same sumGrades function saying:

1>.\Programming Exercise 4.cpp(35) : error C2275: 'std::ifstream' : illegal use of this type as an expression

Duki 552 Nearly a Posting Virtuoso

>I'm getting an error in the sumGrades function saying 'inp' is undeclared.
You need to pass it as a parameter to the function, because 'inp' is a local variable in main().

[edit]

Actually, your logic is kind of confusing. Why do you need to check an input file's eof status when you never read anything from it?

[/edit]

You've also got a couple of places where you got the operators >> and << mixed up. Remember: the carrot things always point to where you want the data to go.

Ah, I mess those <> things up sometimes! thanks!

As for the logic I'm using... We're just learning userdefined functions and I've no clue how to use them with iofstreams. If I pass the parameter, I will not have to open the file again correct? How do i pass that sort of parameter to allow the program to read the file?

*edit
new sumGrades function... what is wrong with this form?

void sumGrades ( ifstream & inp , double & sumFemaleGPA , double & sumMaleGPA , int & mCnt , int & fCnt ) 
{
    double x = 0 ;
    char ch ;

    cin << ch ;
    while ( !inp.eof() )
    {
        if ( ch == 'f' )
        {
            cin >> x ;
            sumFemaleGPA += x ;
            fCnt++ ;
        }
        else if ( ch == 'm' )
        {
            cin << x ;
            sumMaleGPA += x ;
            mCnt++ ;
        }
        else 
            outp << endl << "!! Invalid …
Duki 552 Nearly a Posting Virtuoso

Hey, I'm working on another program for class which is to determine the day of the year given the date the user inputs.

The date will be input in the xx-xx-xxxx format. Is there a way I can cin Mon, skip char, cin Day, skip char, cin Year ?

How would you suggest initializing the variables given this type of input?

Duki 552 Nearly a Posting Virtuoso

Hey everyone,

I'm working on this program for class but I'm getting an error in the [I]sumGrades[/I] function saying 'inp' is undeclared. Could someone give me a hand?

#include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
using namespace std;

// initializes count of females, count of males, female GPA sum, and male GPA sum
void initialize(int & fCnt, int & mCnt, double & sumFemaleGPA, double & sumMaleGPA) ;
// opens input & output files; sets output to fixed-showpoint-precision2
void openFiles(ifstream & inF, string iNam, ofstream & outF, string oNam) ;
// adds male and female grades; produces sum of each
void sumGrades ( double & , double & , int & , int & ) ;
// finds male and female averages
void averageGrade ( double & sumFemale , double & sumMale , int & mCnt , int & fCnt , double FemaleAvg , double MaleAvg ) ;
// prints relative results
void printResults ( double & sumFemale , double & sumMale , int & mCnt , int & fCnt , double FemaleAvg , double MaleAvg ) ;

int main()
{
    int fCnt ;
    int mCnt ;

    double sumFemaleGPA ;
    double sumMaleGPA ;
    double MaleAvg ;
    double FemaleAvg ;

    string inName = "inputTxt.txt";
    string outName = "no07out.txt";
    ifstream inp;                // input file stream variable
    ofstream outp;                // output file stream variable

    initialize( fCnt , mCnt , sumFemaleGPA , sumMaleGPA ) ;
    openFiles( inp, inName, outp, outName ) ;
    sumGrades( sumFemaleGPA , sumMaleGPA , fCnt , mCnt ) ;
    averageGrade( …
Duki 552 Nearly a Posting Virtuoso

what? No one had anything to say about my month-old article? What if they really did find the remains of jesus? What would christianity do then?

http://time-blog.com/middle_east/2007/02/jesus_tales_from_the_crypt.html?iid=chix-digg

The fact of the matter is, Jesus was burries in a borrowed tomb... they very well may have found the tomb of Jesus, but there were a number of bodies inside the same tomb. Sometimes, people try to prove points without doing a little research first... :rolleyes:

Duki 552 Nearly a Posting Virtuoso

Jesus did not design Christianity. It was designed around him -- after the fact.

yeah, ok.. that made since... :rolleyes:

Rest of the paragraph: Excellent timeline. Thank you, that was extremely interesting. Still, this information does not prove accuracy. It proves they read the books and compiled them into what is known ultimately as "The Bible". Everyone that helped with the compilation lived centuries after the fact. And, of course, just because something is written doesn't make it true.

The events in the Bible are more historically accurate most historical writings..

The manuscript authority of the New Testament is over twenty thousand, compared to the second place Iliad with roughly six-hundred and fifty. Furthermore, within the text of the Iliad manuscripts are over seven hundred lines in question or contradiction, which is close to five percent. Remarkably, in the New Testament manuscripts, out of all twenty thousand, only forty lines are in question. This is an astounding one half percent! At the time of the writings of the New Testament, people were still alive who witnessed the life of Jesus and his crucifixion. The writings of Christ were circulating during the time of his death, and could certainly be confirmed or denied credibility. When writing, the apostles would even turn the tables not only saying, “We saw this…” or “We heard that…” but also, “You heard about these things… You saw them.” If any false statements or inaccuracies existed, they would have surely been brought into light. The …

Duki 552 Nearly a Posting Virtuoso

Well I think it was very well written.. perhaps the author was a little biased though lol.. The essay does provide evidence that the new testament may have existed, but It still has not been 100% verified..

.. and the new testament does not actually prove anything, jesus may have existed.. but who's to say that he wasn't some crazy schizophrenic or something? None of his miracles have been proven, and there is not enough evidence to truly know anything about him.

Just because I favor the New Testament doesn't make my research methods biased ... It may seem that way because the paper was focusing on the New Testament, but I assure you my research and documentation are accurate.

Duki 552 Nearly a Posting Virtuoso

josh, have you read my document I attached? 60% of the questions people are asking are answered in it.

The entire New Testament was written within 70 years of Jesus's death.

Duki 552 Nearly a Posting Virtuoso

it's just annoying to have 99.9 show up instead of 100.0 :sad:

Duki 552 Nearly a Posting Virtuoso

Didn't the loving creator create the single organism that eventually evolved into us? I for one don't have a problem with this idea. ;)

If by organism you mean adam and eve, then sure... me either :)

I'm not aware of any historical evidence that disproves the credibility of the Bible. You may want to take a look at my reasearch paper, as it is an in-depth look at historiagraphy as applied to The New Testament.

Duki 552 Nearly a Posting Virtuoso

Have a good Easter everyone, 45 minutes left until a nice 4 day weekend. :mrgreen:

Nice hot day, cold beer, going to be good.

glad you get a hot day :sad: it's around 30 here.

Duki 552 Nearly a Posting Virtuoso

I tried 100x1024 and then I added 2MB because I figured this would happen, as it has happened before. Is there a more accurate number of MB in a GB (i.e. 1024.859)?

Duki 552 Nearly a Posting Virtuoso

well, i'm sorry if you feel like you're being attacked... you're not. Personally, I'm doing this because I care about your soul, as does God. Try not to close your mind around me being an ignorant extremist for false religion... just please think about the whatifs, just like in every theory discussed; all began with a whatif.

I'm going to bed, but I'll reply more tomorrow. Josh, I'm praying for you... not praying, "OH HOLY MIGHTY GOD ON HIGH, SMITE THIS IGNORANT FOOL WHO DENIES YOUR THRONE!! GRAB HIM AND SHOW HIM YOUR PRESENCE OH GREAT CREATOR!!"... no... I will simply be praying that God allows you to have an open mind to whatif there is a Father who cares for you... if you focus, you can feel his prensence; for the sake of theory, try it? Sleep well.

night all.

*i'm 19

Duki 552 Nearly a Posting Virtuoso

Calm down dude, I didn't catch it the first time either.

sorry, just aggitated... everything that is said, including from you, a post is made from him trying to prove it wrong or unlikely... =/

what was that about open mindedness?

Duki 552 Nearly a Posting Virtuoso

Yea, I'm saying the patients who prayed probably felt more confident then those who did not. Even if they did not know about it, the fact is that those who believe in god usually have a greater will to live. They think god will help them, and so they feel self-assured... Which is the whole purpose for christianity, to make people feel more important and confident about themselves.

ok... they didn't pray... other people prayed for them... read the post before replying plz... how would they not be aware that they were praying??

says nothing about one half being religious and the other not being...

Duki 552 Nearly a Posting Virtuoso

We're going to format a drive, but what is exactly a GB in MB?

we put in the values for the partitions and it comes out to like 99.9GB instead of 100GB

Duki 552 Nearly a Posting Virtuoso

yea.. I highly doubt it had anything to do with religion. It's too hard to do an experiment like that b/c of all the variables involved. The people who prayed probably felt more confident, and maybe had a better chance at survival...

exactly the reason i put in the part saying the patients did not know

Duki 552 Nearly a Posting Virtuoso

I actually heard of a research project one group did with patients... they had peopel pray for one half and the other noone prayed; the patients were unaware of this.

I can't recall the exact outcome, though I know there was a very significant difference in the two groups; the prayed-for patients did much better is certain areas... i wish i would have researched it more.

Duki 552 Nearly a Posting Virtuoso

I've been asked this many times, and there are two oppinions on this. I choose the later oppinion, as it is most accurate according to the scriptures.

1) they are forgiven because of ignorance (like a baby)

2) that is why the bible says to go out unto all the nations proclaiming the Word.. it's our job as christians to tell those people about Christ


*didn't mean to answer for tina :P

Duki 552 Nearly a Posting Virtuoso

True statements, there have been instances when cancer has receded without a known cause. However, the key word in this is "known." For all we know, it's due to process not yet discovered. Or, it could be very much due to God.

Evolution has actually been critical in understanding HIV/AIDS.

You're right, a process not yet discovered could have coincidentally cured someone of cancer the same week she was prayed for. ;)

Duki 552 Nearly a Posting Virtuoso

Hehe, well as most philosophers agree, logic cannot describe a divine being. So yes, it would be 'illogical" ;)

And I'm pretty sure infinity does exist.

Would you rather believe that you lived in paradise, or in hell? Simply because you believe in something does not simply make it true.

And secondly, why can't you believe in both? I know I sure do.

i do believe in both, just not to the extent that you do. :mrgreen: