: hey everyone,
: i have an assignment for a class in college, and i have to write a
: pascal program, but the last time i did anything in pascal was
: probably 10 years ago, so i really dont remember much...
: so anyway, this program has to calculate the cost of a phone call
: after you enter the length of the call. so, you have to enter the
: number of minutes and the number of seconds as variables (i think).
: the cost of one minute is 1.22.
: if anyone has any ideas, or if anyone would be so kind as to write
: the program :))), i would be very grateful, and you would save me
: from failing the class :)
Just do the math.
If Minutes and Seconds are entered separately then
Cost := 1.22 * (Min + (Sec / 60.0)) ;
Presumably the variables are declared as
Cost : real ;
Sec : integer ;
You need to be certain that the expression on the right evaluates as a real. I'll leave that up to you.