Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Need some help with my c++ code

Name: hopless new guy 2008-02-22 22:47

for some reason it wont give the error message if the hours are over the monthly hours



#include <iostream>
#include <iomanip>
#include <cctype>
#include <cstring>
using namespace std;

int main()
{
    char pack;
    double bill, hour;
    int max_hours;
    const int SIZE=50;
    char month[SIZE];


//format bill
    cout << showpoint<<fixed<<setprecision(2);


    // menus
    cout << "Please select one of the three subscription packages."<<endl;
    cout << "Avaliable Packages: a, b, c"<<endl;
    cout << "Package: ";
    cin >> pack;
    cout <<endl;

    cout << "How many hours of access are used? :";
    cin >> hour;
    cout << "What is the month?: ";
    cin >> month;
   

       

//max hours per month
    if (strcmp("january", month))
        {
        max_hours = 744;
        }
        else if (strcmp("february", month))
        {
        max_hours = 672;
        }
        else if (strcmp("march", month))
        {
        max_hours = 744;
        }
        else if (strcmp("april", month))
        {
        max_hours = 720;
        }
        else if (strcmp("may", month))
        {
        max_hours = 744;
        }
        else if (strcmp("june", month))
        {
        max_hours = 720;
        }
        else if (strcmp("july", month))
        {
        max_hours = 744;
        }
        else if (strcmp("august", month))
        {
        max_hours = 744;
        }
        else if (strcmp("september", month))
        {
        max_hours = 720;
        }
        else if (strcmp("october", month))
        {
        max_hours = 744;
        }
        else if (strcmp("november", month))
        {
        max_hours = 720;
        }
        else if (strcmp("december", month))
        {
        max_hours = 744;
        }

    else
    {
        cout << " Not a valit input. Check the spelling and case."<<endl;
    }


//calculation and bill output
    switch (pack)
    {
        case 'a':
            if (hour > max_hours)
            cout <<"Can not exceed montly hours"<<endl;

            else if (hour >= 10)
            {
                bill = 9.95 + (2.00*(hour - 10));
                cout << "The bill for "<<month<<" is: $"<<bill<<endl;
            }
            else
            {
                cout << "The bill for "<<month<<" is $9.95"<<endl;
            }
            break;

        case 'b':
            if (hour > max_hours)
            cout <<"Hours can not exceed monthly hours"<<endl;

            else if (hour >= 20)
            {
                bill = 14.95 + (1.00*(hour - 20));
                cout << "The bill for "<<month<<" is: $"<<bill<<endl;
            }
            else
            {
                cout << "The bill for "<<month<<" is $9.95"<<endl;
            }
            break;

        case 'c':
                cout << "The bill for "<<month<<" is $19.99"<<endl;
    }






    return 0;
}

Name: Anonymous 2008-02-22 22:52

We're not here to do your homework for you. We are here to mumble impotently about satori and LISP.

Go fuck a tire iron.

Name: hopless new guy 2008-02-22 23:01

it was worht a shot

*proceeds to tire iron fucking

Name: hopless new guy 2008-02-22 23:03

#include <iostream>

int main()
{
  cout << "Disregard that I suck cocks ";
  return 0;
}

Name: Anonymous 2008-02-22 23:34

lol

Name: Anonymous 2008-02-22 23:39

>>4
forgot std

Name: Anonymous 2008-02-23 0:46

>>6
Wait, better use a namespace. Allows there to be more blackspaceNIGGERSPACE thus allowing diversity.

Name: Anonymous 2008-02-23 10:13

>>4
MORE LIKE (display "Disregard that I suck cocks ") AMIRITE YOU FUCKING SEEPLES FAGGOT!!!11!!!!!

Name: Anonymous 2008-02-23 10:51

>>8
I lol'd for no reason.

Name: Anonymous 2008-02-23 10:52

In Haskell, we have an action that automatically adds a newLine after printing a string. How satori is that?

Name: Anonymous 2008-02-23 11:18

>>10
As satori as Java itself.

Name: Anonymous 2008-02-23 11:51

fukken troll, man strcmp

Name: Anonymous 2008-02-23 12:12

>>11
YAHT

Name: Anonymous 2008-02-23 12:21

TBHT

Name: Anonymous 2008-02-23 12:22

cout << cin >> cout>>cin<<cout>><<<><><><><><<<<<<<<>>>>>>>>><><><><><><X

printf > *

Name: Anonymous 2008-02-23 18:11

printf(%d%d%oo%o%%%%%%%%%%oo%o%o%%oo, uuuu,u,u,,,,o);

cout>>>*

Name: Anonymous 2008-02-23 21:26

cout << " Not a valit input. Check the spelling and case."<<endl;

Fix your spelling mistakes BEFORE posting your code to [spoiler]/prog/[spoiler].

Name: Anonymous 2008-02-23 21:27

>>17

Aw shit, I just failed hard.

Name: Anonymous 2008-02-23 21:36

>>18
the game

Name: Anonymous 2008-02-23 22:32

>>19
failure implementation of the game.

Name: Anonymous 2008-02-24 9:19

>>18
WHAT YOU'RE NO EXPERT PROGRAMMER

Name: Anonymous 2008-02-24 11:46

THIS IS MADNESS!

Name: Anonymous 2008-02-24 16:53

>>22
NO, THIS IS /Prog/

Name: Anonymous 2008-02-24 16:59

>>23
I think you mean /prog/

Name: Anonymous 2008-02-24 17:00

>>24

I think you should GTFO/STFU

Name: Anonymous 2008-02-24 17:18

>>25
NO U!

Name: Anonymous 2008-02-24 18:05

Fuck. Now /prog/ is getting faggots from /b/. Great.

Name: Anonymous 2008-02-24 19:18

anticudder

Name: Anonymous 2008-02-24 19:22

>>27
Or maybe faggots from /r9k/. I knew that advertising /prog/ in that thread would bring only fail. Thanks, you all expert the gamerammers.

Name: Anonymous 2008-02-25 20:46

>>29
hi, what BBCODE compiler do you use. i have a project due tomorrow and i can't find a good one

Name: Anonymous 2009-03-06 8:48


The same time so   we can devote   it to something   at its declaration   for many reasons   40 to suspect   that by default   with the support   provided by EMACS   overcomes the problems   only arise once   you start making   more complex small?

Name: Anonymous 2009-03-06 9:14

The forced indentation of   the code a   factor of 5   gets evaluated twice   Apart from that   god damn lisp   game tutorial oh.

Name: Anonymous 2009-03-06 10:36

the point you no   matter how stupid   it sounds It.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List