Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 12-16-2004, 09:44 AM   #1
BackToMine
Confirmed User
 
Join Date: Nov 2004
Posts: 541
C Programmers: 10min job for you

I've got an assignment to hand in tommorow for my software solutions module and I havn't started it

It's nothing more than loops and if/else statements and won't be more than 70 lines!

You'll be paid via PayPal $30

If you're interested post below and I'll paste the spec
BackToMine is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-16-2004, 10:13 AM   #2
BackToMine
Confirmed User
 
Join Date: Nov 2004
Posts: 541
bump
easy money for a quickie
BackToMine is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-16-2004, 10:14 AM   #3
colpanic
Confirmed User
 
Join Date: May 2004
Location: San Diego, CA
Posts: 1,007
Lazy bastard!

I'll do it for $100 though
__________________
I like ducks.
colpanic is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-16-2004, 10:16 AM   #4
BackToMine
Confirmed User
 
Join Date: Nov 2004
Posts: 541
Quote:
Originally posted by colpanic
Lazy bastard!
Yup, I missed most of the C lectures.

Quote:

I'll do it for $100 though
Wow, its a no-brainer, actually it might insult a good C programmer because its that easy

I'm a Python programmer so it'll take me 10mins to do
BackToMine is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-16-2004, 10:19 AM   #5
Femme Fa'tale
Confirmed User
 
Join Date: Nov 2004
Location: U.S.
Posts: 541
Let me see the specs ...
Femme Fa'tale is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-16-2004, 10:21 AM   #6
BackToMine
Confirmed User
 
Join Date: Nov 2004
Posts: 541
Quote:
Implement a program to calculate charges for long-distance telephone calls according to the following scheme.

The regular charge is £1.50 for the first three minutes (or part thereof) and 30p for any minute after the first three. Rates are reduced during certain times of the day according to the following table:

Starting Time Monday to Friday Saturday and Sunday
Before 8am 40% discount 60% discount
8am to 6pm (inclusive)Regular rate 60% discount
After 6pm 40% discount 60% discount

The input to the program is to consist of the day on which the call was begun, the starting time of the call and the end time of the call. No call is to be greater than ten hours duration.

The day is to be indicated by using a key letter: (M)onday, T(u)esday, (W)ednesday, (T)hursday, (F)riday, S(a)turday, (S)unday.

The times are to be entered to the nearest minute using a 24 hour clock format. Each time should consist of two parts - hours and minutes. Midnight is 00 hours 00 minutes. 1:35pm is represented as 13 hours and 35 minutes.

The program is to display the day of the week as a full name, the call duration in minutes and the total charge.

The program should execute in a loop and so consideration must be given to how the processing requirements are to end.

Complete the program by including a summary analysis which will determine the total number of calls made, the total duration of the calls and the total cost of the calls.
BackToMine is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-16-2004, 10:31 AM   #7
Femme Fa'tale
Confirmed User
 
Join Date: Nov 2004
Location: U.S.
Posts: 541
I don't think it will take 10 min to do it... Do you have the formula for the day of the week and time?
Femme Fa'tale is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-16-2004, 10:36 AM   #8
BackToMine
Confirmed User
 
Join Date: Nov 2004
Posts: 541
Quote:
Originally posted by Femme Fa'tale
I don't think it will take 10 min to do it... Do you have the formula for the day of the week and time?
How much longer would you reckon?

It's a simple prog and this is the marking criteria:

Quote:
1) Correctly defines day of week
2) Correctly defines duration and charge
2a) Simple time differences
2b) End minutes < start minutes
2c) End hour < start hour
3) Correctly incorporates an appropriate control loop
4) Correctly calculates and displays summary totals
5) Input validation
BackToMine is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-16-2004, 10:42 AM   #9
Femme Fa'tale
Confirmed User
 
Join Date: Nov 2004
Location: U.S.
Posts: 541
I made a program before :

Input: Birthdate >>> Output : day of a Week you were born

and

Time (in DOS)

I think the formula will help you...
Femme Fa'tale is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-16-2004, 10:50 AM   #10
BackToMine
Confirmed User
 
Join Date: Nov 2004
Posts: 541
It's the C syntax I have to get used to that I don't have time for tonight.

I think it'll work like this:

1) User inputs day via letter eg. M for monday, T for tuesday etc.
2) User inputs start time in 24hr format eg. 13:20
3) User inputs end time in 24hr format eg. 13:34
4) Program calculates cost based upon table for discounts
5) Displays total cost, the day and call length

6) Asks whether to loop, if so then back to step1
7) Calculates total summary analysis with no# of calls and total call durations and total cost of all calls
8) Finished
BackToMine is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-16-2004, 11:19 AM   #11
colpanic
Confirmed User
 
Join Date: May 2004
Location: San Diego, CA
Posts: 1,007
Certainly not hard, but still an hour or two if you want it to be pretty.

You are right though, in Python or Ruby it would be a lot quicker

Really not worth it for 30 bucks though, seriously.
__________________
I like ducks.
colpanic is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-16-2004, 11:22 AM   #12
Danny
Confirmed User
 
Join Date: Apr 2002
Location: Canada
Posts: 198
Hit me up on icq I may know someone who would be willing to do it for you...
__________________
- Danny
ICQ# 9770313
Danny is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-16-2004, 11:25 AM   #13
BackToMine
Confirmed User
 
Join Date: Nov 2004
Posts: 541
OK, if it'll cost more then I'll drive over to my classmate tonight and steal his code

Thank god its not supposed to be in ASM
BackToMine is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-16-2004, 11:29 AM   #14
Femme Fa'tale
Confirmed User
 
Join Date: Nov 2004
Location: U.S.
Posts: 541
Check this out ... just add a function for total calls , how much and how many min ...

http://www.informatics.susx.ac.uk/co...solution2.html

Note : Calling Time may vary in the computer you are using ...
Femme Fa'tale is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-16-2004, 01:19 PM   #15
Danny
Confirmed User
 
Join Date: Apr 2002
Location: Canada
Posts: 198
Still waiting to hear from you. Got bored and got it finished for you already... icq 9770313
__________________
- Danny
ICQ# 9770313
Danny is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-16-2004, 01:51 PM   #16
romaninsh
Registered User
 
Join Date: Aug 2003
Posts: 39
Code:
#include <stdio.h>
#include <stdlib.h>

int starting_min;
int ending_min;
int min;
char d;

int mpm;

int hour_cost(){
        int cost;
        int weekend;
        int discount;
        if(mpmhahahaha0){
                // first minute
                cost=150;
        }else if(mpm<3){
                // 2nd or 3rd minute
                cost=0;
        }else{
                cost=30;
        }
        mpm++;

        // apply discounts
        weekend = (dhahahaha'a' || dhahahaha'S');

        if(weekend){
                discount=60;
        }else{
                if(min<8*60)discount=40;
                else if(min<=18*60)discount=0;
                else discount=40;
        }
        cost=cost-cost*discount/100;
        return cost;
}

int main(){
        char d;
        int m,h,m2,h2;
        int cost;
        while(scanf("%c %d:%d %d:%d",&d,&h,&m,&h2,&m2)){
                starting_min = h*60+m;
                ending_min = h2*60+m2;
                
                printf("%d - %d\n",starting_min,ending_min);
                mpm=0;cost=0;
                for(min=starting_min;min<ending_min;min++){
                        cost+=hour_cost(min);
                }
                
                printf("%.2f\n",(float)cost/100);
        }
        return EXIT_SUCCESS;
}

Try this out. I don't have much time, so i did only quick tests. It took me 17 minutes, btw ;))



hit me up if you need any help.
__________________
A proud developer of ChokerTraffic and TTT-C (ICQ: 266-606-026)
romaninsh is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-16-2004, 01:57 PM   #17
romaninsh
Registered User
 
Join Date: Aug 2003
Posts: 39
oh, board messed up the code..

you can download it here:
http://romans.adevel.com/cd.c

romans
__________________
A proud developer of ChokerTraffic and TTT-C (ICQ: 266-606-026)
romaninsh is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-16-2004, 01:58 PM   #18
jawanda
Confirmed User
 
Join Date: Feb 2003
Posts: 6,040
Quote:
Originally posted by romaninsh
Code:
#include <stdio.h>
#include <stdlib.h>

int starting_min;
int ending_min;
int min;
char d;

int mpm;

int hour_cost(){
        int cost;
        int weekend;
        int discount;
        if(mpmhahahaha0){
                // first minute
                cost=150;
        }else if(mpm<3){
                // 2nd or 3rd minute
                cost=0;
        }else{
                cost=30;
        }
        mpm++;

        // apply discounts
        weekend = (dhahahaha'a' || dhahahaha'S');

        if(weekend){
                discount=60;
        }else{
                if(min<8*60)discount=40;
                else if(min<=18*60)discount=0;
                else discount=40;
        }
        cost=cost-cost*discount/100;
        return cost;
}

int main(){
        char d;
        int m,h,m2,h2;
        int cost;
        while(scanf("%c %d:%d %d:%d",&d,&h,&m,&h2,&m2)){
                starting_min = h*60+m;
                ending_min = h2*60+m2;
                
                printf("%d - %d\n",starting_min,ending_min);
                mpm=0;cost=0;
                for(min=starting_min;min<ending_min;min++){
                        cost+=hour_cost(min);
                }
                
                printf("%.2f\n",(float)cost/100);
        }
        return EXIT_SUCCESS;
}

Try this out. I don't have much time, so i did only quick tests. It took me 17 minutes, btw ;))



hit me up if you need any help.
You are the shit, Roman!

If anyone needs any php, javascript, or other programming done I highly recommend you write down Romans ICQ number right now. His prices are great and his work is top notch.
jawanda is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-16-2004, 02:00 PM   #19
Femme Fa'tale
Confirmed User
 
Join Date: Nov 2004
Location: U.S.
Posts: 541
missing output ?
Femme Fa'tale is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-16-2004, 02:32 PM   #20
BackToMine
Confirmed User
 
Join Date: Nov 2004
Posts: 541
Quote:
Originally posted by romaninsh

you can download it here:
http://romans.adevel.com/cd.c

That's excellent romans!

In fact had my ICQ been working, you were just the person I would have contacted since I saw your ICQ number when logging into Chokertraffic admin page!

All I need now is to add some comments to the code and do the proper documentation (pseudo code, Jackson Structure Diagrams, test plans, etc.) and I'm done!

If you want the $$ then reply with your PayPal address

Quote:
Originally posted by Femme Fa'tale
missing output ?
Seems to work here, enter "M 13:22 13:29" when it executes.
BackToMine is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-16-2004, 02:33 PM   #21
BackToMine
Confirmed User
 
Join Date: Nov 2004
Posts: 541
Quote:
Originally posted by Danny
Still waiting to hear from you. Got bored and got it finished for you already... icq 9770313
Sorry I didn't get into contact with you, my ICQ hasn't been working for some strange reason and have been meaning to fix it.
BackToMine is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-16-2004, 02:38 PM   #22
Femme Fa'tale
Confirmed User
 
Join Date: Nov 2004
Location: U.S.
Posts: 541

Good for you man !
Femme Fa'tale is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-16-2004, 02:40 PM   #23
BackToMine
Confirmed User
 
Join Date: Nov 2004
Posts: 541
Quote:
Originally posted by Femme Fa'tale
Good for you man !
Thanks for trying to help
BackToMine is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-16-2004, 02:53 PM   #24
romaninsh
Registered User
 
Join Date: Aug 2003
Posts: 39
Quote:
Originally posted by BackToMine

If you want the $$ then reply with your PayPal address

Sorry, i don't have PayPal account, only epassporte. The task was interested, so i did it for fun.

romans
__________________
A proud developer of ChokerTraffic and TTT-C (ICQ: 266-606-026)
romaninsh is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-16-2004, 02:56 PM   #25
BackToMine
Confirmed User
 
Join Date: Nov 2004
Posts: 541
Quote:
Originally posted by romaninsh
Sorry, i don't have PayPal account, only epassporte. The task was interested, so i did it for fun.

romans
That's cool then, I'll be sure to mention your name if anyone wants any C/PHP work done on gfy
BackToMine is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.