Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 11th, 2008, 2:15 AM   #21
Ghost
Man Bear Pig Hunter
 
Ghost's Avatar
 
Join Date: Jul 2005
Location: NorCal, USA
Posts: 295
Rep Power: 4 Ghost is on a distinguished road
Re: need someone to write me a programme

$99.98 and I'll even send you a picture of someone's mother.
__________________
People who click "images" that end with .exe shouldn't have computers.
Ghost is offline   Reply With Quote
Old Aug 15th, 2008, 6:28 PM   #22
Kriss
Newbie
 
Join Date: Apr 2004
Posts: 25
Rep Power: 0 Kriss is on a distinguished road
Arrow Re: need someone to write me a programme

Because this was a good task to take on for a person very new to programming, I decided to give it a go. Critisism is always welcome

//Copyright (c) 2008, Kriss <mikemikeoscarAyahoo.com>
//
//Permission to use, copy, modify, and/or distribute this software for any
//purpose with or without fee is hereby granted, provided that the above
//copyright notice and this permission notice appear in all copies.
//
//THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
//WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
//MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
//ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
//WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
//ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
//OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
//
using System;

namespace Leisureclub
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            int IsMember = 0;
            double CheckAge;
            double GetPrice;
            
            Functions f = new Functions();

            while (IsMember != 3)
            {
            IsMember = f.CheckValidMember();
             if ( IsMember != 3)
                {
                    CheckAge = f.CheckAge();
                
                switch (IsMember)
                {
                case 1:
                    GetPrice = f.CalculatePriceMember(CheckAge); 
                    Console.WriteLine("The price is EUR{0}", GetPrice);
                    break;
                case 2:
                    GetPrice = f.CalculatePriceNonMember(CheckAge);
                    Console.WriteLine("The price is EUR{0}", GetPrice);
                    break;
                case 3:
                    System.Environment.Exit(0);
                    break;
                default:
                    Console.WriteLine("Error of some sorts, exiting");
                    break;
                }
                }
            }
                
        } 
        
    } 
    
    class Functions
    {
        public int CheckValidMember()
        {
            int IsMember;
            Console.WriteLine("\n1. Member\n2. Not Member\n3. Exit\n");
            Console.Write("Enter choice: ");
            
            IsMember = Convert.ToInt32(Console.ReadLine());
            
            if (IsMember == 1)
                return 1;
            else if (IsMember == 2)
                return 2;
            else if (IsMember == 3)
                return 3;
            else
                return 4;
        } // 
        
        public double CheckAge()
        {
            double CheckAge;
            Console.Write("Please enter your age: ");
            CheckAge = Convert.ToInt32(Console.ReadLine());
            return CheckAge;
        } 
        
        public double CalculatePriceMember(double Age)
        {
            double price; 
            
            if ( Age >= 31 )
                price = 3.5;
            
            else if ( Age <= 30 )
                price = 7.5;
            
            else if ( Age >= 18 )
                price = 7.5;
            
            else 
                price = 0;
            
            
            return price;
        } 
        
        public double CalculatePriceNonMember(double Age)
        {
            double price;
            
            
            if ( Age >= 31 )
                price = 5.5;
            
            else if ( Age <= 30 )
                price = 10;
            
            else if ( Age >= 18 )
                price = 10;
            
            else 
                price = 0;
            
            return price;
                
        } 
    } 
    
}

ps. the license is more of a joke aimed towards the original poster
__________________
Rock on!
Kriss is offline   Reply With Quote
Old Aug 17th, 2008, 5:44 PM   #23
crawforddavid2006
Expert Programmer
 
crawforddavid2006's Avatar
 
Join Date: Apr 2005
Location: Not sure yet
Posts: 582
Rep Power: 0 crawforddavid2006 is an unknown quantity at this point
Send a message via AIM to crawforddavid2006 Send a message via MSN to crawforddavid2006
Re: need someone to write me a programme

Critisism:

You didnt charge them to do it.
You did it for them and it was homework, therefore they didn't learn anything.

Yup, that's all the critisism i have for you.
__________________
Quote:
Originally Posted by DaWei View Post
Well, it's better than Pen Islands url....;)

crawforddavid2006 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ashars antivirus programme in c errors help dragosam C 8 Nov 18th, 2007 5:46 AM
if it exists use it? or write it? rwm C++ 8 Aug 21st, 2007 3:00 AM
How much can a C++ programme extract from a .txt file? Ade C++ 14 May 4th, 2006 6:46 AM
First Python Programme: Fibonacci Finder UnKnown X Python 2 Dec 15th, 2005 6:19 PM
Trying to write jsp files to MySql Database reubenfields Java 1 Apr 14th, 2005 9:51 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 6:49 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC