Notices

Overclockers Forums > Software > Programming Tips and Tricks
Programming Tips and Tricks
Forum Jump

help w/ cs program functions

Post Reply New Thread Subscribe Search this Thread
 
 
Thread Tools
Old 10-25-01, 04:08 PM Thread Starter   #1
KRIGGA
New Member



Join Date: Oct 2001

 
Question help w/ cs program functions


hey i need some help w/ my cs program.. if any of u kno these functions can u jus send me whatever u kno.. Thanks

1.)
write a function called fine which will accept an integer(represents a speed limit) and a real(speed car was going when speed was violated). The function returns the fine imposed(real). The fines are $20.00 if < 10 mph over the speed limit; $75.00 for 10-20 mph over the limit(inclusive); and $150.00 if >20mph over the limit. You may assume that the car was traveling in excess of the speed limit.

2.)
write a function called "fine" which will accept an integer, a real, and a Boolean as its arguments. The integer represents a speed limit, the real the speed a car was going when it violated the speed limit, and the boolean will be true if the car was in a "work zone" when the violation occurred. The function returns the fine imposed (a real). The fines outside a work zone is double the normal fine. You may assume the car was traveling in excess of the speed limit.

3.)
write a predicate function called "isInvalidGrade" which accepts an integer grade as its only argument. The function returns true if the grade is invalid, and false otherwise. Valid grades are in the range 0 through 100 inclusive.

4.)
write a function called "warningValue" which accepts three integer grades as its arguments. The function either returns the integers -1, 2, or 1, based on the validity of the grades and their average if they are valid. The function is to return -1 in the case that any of the grades is invalid; 1 if the averageof the grades is 80.0 or above, and 2 if the average is below 80.0

5.)
write a predicate function called "firstBetter" which accpets two real, integer pairs as its arguments(in order real, integer, real, integer). Each pair represents the cost of a number of units of a particular item, and the number of units offered for that price. The function is to reurn true if the first pair represents a better "deal" (lower cost per unit) than the second pair. It is also to return true if the two "deals" are the same. It is only to return false if the second is actually the better of the two. You may assume that the kind of unit is the same for both pairs.
KRIGGA is offline   QUOTE Thanks
Old 10-25-01, 10:57 PM   #2
engjohn
Senior Member

 
engjohn's Avatar 

Join Date: Dec 2000
Location: SoCal

 
From what I understand this is for one of your classes at school?!?

If so, I do not think that we should write the functions for you...

You could show us what you have and we would be happy to
help but I believe that you need to learn this stuff, NOT just have
someone hand it to you...


Just my 2 pennys

If you need help, I will be more than happy...

__________________
<--- Dave and My Girlfriend in Atlanta, Ga at the Ritz Carlton!!! Yahoo!! (I took the PIC!!)

und KEINE EIER!!!
My Heatware
engjohn is offline   QUOTE Thanks
Old 10-25-01, 11:18 PM   #3
Ridenow
Sneaky Moderator

 
Ridenow's Avatar 

Join Date: Apr 2001
Location: Springfield, IL

 
I am going to agree with engjohn on this. If you have a specific question or need help debugging feel free to ask, but you are never going to learn if we give you all the answers.

__________________
Forum Moderator
Ridenow is offline   QUOTE Thanks

Post Reply New Thread Subscribe


Overclockers Forums > Software > Programming Tips and Tricks
Programming Tips and Tricks
Forum Jump

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Mobile Skin
All times are GMT -5. The time now is 03:17 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
You can add these icons by updating your profile information to include your Heatware ID, Benching Profile ID or your Folding/SETI profile ID. Edit your profile!
X

Welcome to Overclockers.com

Create your username to jump into the discussion!

New members like you have made this the best community on the Internet since 1998!


(4 digit year)

Why Join Us?

  • Share experience
  • Max out your hardware
  • Best forum members anywhere
  • Customized forum experience

Already a member?