comp.lang.ada
 help / color / mirror / Atom feed
From: Cheryl Earnest <cherie@labyrinth.cftnet.com>
Subject: Help!
Date: 1996/10/01
Date: 1996-10-01T00:00:00+00:00	[thread overview]
Message-ID: <3250AE4D.100191BB@labyrinth.cftnet.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 228 bytes --]

Can someone please help me with the attached program.
I think that my problem has to do with the gross_pay 
variable.

I just can't see what the problem is.  The Compilation error is
"invalid paramater in call"

Thanks,

Cherie

[-- Attachment #2: cherieprog2.adb --]
[-- Type: text/plain, Size: 3138 bytes --]

--Cheryl Earnest (cherie) 593-48-8506
--Intro to Computer Science Lab
--Assignment 2 Due: September ?

with Text_Io; use Text_Io;

procedure cherieprog2 is
	package flt_io is new Float_Io(Float);
	package int_io is new Integer_Io(Integer);
	package boolean_io is new enumeration_io(Boolean);

	name: String(1..30);
	length: Integer;
	hours_worked: Float;
	hourly_rate: Float;
	dependents: Float;
	union_member: Character;
	union_dues: Float;
	federal_tax: Float;
	social_security: Float;
	gross_pay: Float;

	procedure gross(hours_worked, hourly_rate: in Float; gross_pay: out Float) is
		overtime: Float;
		regular: constant := 40.0;
	begin
		if hours_worked > regular then
			overtime := hours_worked - regular;
			gross_pay := ((hours_worked * hourly_rate) + (overtime * 1.5 * hourly_rate));	
		elsif hours_worked <= regular then
			overtime := 0.0;
			gross_pay := (hours_worked * hourly_rate);
		end if;
	end gross;			

	function tax(gross_pay, dependents: Float) return Float is
        begin
                if gross_pay > 150.0 then
                        return(gross_pay - (13.0 * dependents));
                elsif gross_pay <= 150.0 then
                        return(0.0);
                end if;
	return(0.0);
        end tax;	

	function ssecurity(gross_pay: Float) return Float is
        begin
                if gross_pay > 150.0 then
                        return(0.052 * gross_pay);
                elsif gross_pay <= 150.0 then
                        return(0.0);
                end if;
	return(0.0);
        end ssecurity;

	function union(gross_pay: Float) return float is
        begin
                return(0.0675 * gross_pay);
        end union;

	procedure net(gross_pay, federal_tax, social_security, union_dues: Float) is
		net_pay: Float;
	begin
		put("Net pay = $");
		net_pay := gross_pay - federal_tax - social_security - union_dues;
		put_line(net_pay, AFT=>2,EXP=>0);
	end net;

begin
	put("Enter employee name:  ");
	get_line(name, length);
	new_line;
	put("Enter hours worked: ");
	get(hours_worked);
	new_line;
	put("Enter hourly rate:  ");
	get(hourly_rate);
	new_line;
	put("Enter number of dependents:  ");
	get(dependents);
	new_line;
	put("Is the employee a Union member? (Y/N):  ");
	get(union_member);
	gross_pay := hours_worked * hourly_rate;
	new_line;
	new_line;
	put("************************************************");
	put("Payroll status for ");
	put(name(1..length));
	new_line;
	gross(hours_worked, hourly_rate, gross_pay);
	put("Gross pay = $");
	put(gross_pay,AFT=>2,EXP=>0);
	put("Federal tax = $");
	federal_tax := tax(gross_pay, dependents);
	put(federal_tax,AFT=>2,EXP=>0); new_line;
	put("Social Security = $");
	social_security := ssecurity(gross_pay);
	put(social_security,AFT=>2,EXP=>0); new_line;
	if union_member = 'Y' then
		put("Union dues = $");
		union_dues := union(gross_pay);
		put(union_dues, AFT=>2,EXP=>0); 
		new_line;
	elsif union_member = 'N' then
		put("No Union dues"); 
		new_line;
	end if;
	net(gross_pay, federal_tax, social_security, union_dues);
	new_line;
	new_line;
	put("************************************************");
end cherieprog2;	 

             reply	other threads:[~1996-10-01  0:00 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-10-01  0:00 Cheryl Earnest [this message]
1996-10-01  0:00 ` Help! Samuel Tardieu
1996-10-01  0:00   ` Help! Larry Kilgallen
1996-10-01  0:00   ` Help! Keith Thompson
1996-10-01  0:00 ` Help! John Herro
1996-10-02  0:00   ` Help! Jean-Etienne Doucet
1996-10-03  0:00     ` Help! John Herro
1996-10-03  0:00       ` Help! John Herro
  -- strict thread matches above, loose matches on Subject: below --
2003-02-24 11:44 Help! Paul Gregory
2003-02-24 13:08 ` Help! Preben Randhol
2003-02-24 13:10   ` Help! Preben Randhol
2001-10-17 14:34 HELP!!!!!! F
2001-10-17 16:10 ` HELP!!!!!! Chris M. Moore
2001-10-17 18:17   ` HELP!!!!!! Jeffrey Carter
2001-10-18  7:10   ` HELP!!!!!! F
2001-10-18  8:11     ` HELP!!!!!! Martin Dowie
2001-10-18 16:57       ` HELP!!!!!! Jeffrey Carter
2001-10-17 17:31 ` HELP!!!!!! tmoran
2000-08-31  0:00 HELP!! Michele De Rosa
2000-08-31 12:20 ` HELP!! Pascal Obry
2000-08-31 12:23 ` HELP!! Ken Garlington
2000-03-24  0:00 Help!! Paul Moran
2000-03-24  0:00 ` Help!! Pascal Obry
1999-11-21  0:00 Help? Matthew Lawrence
1999-11-21  0:00 ` Help? David C. Hoos, Sr.
1999-11-22  0:00 ` Help? Robert Dewar
1999-11-22  0:00 ` Help? John English
1999-11-22  0:00 ` Help? Riyaz Mansoor
1997-06-10  0:00 HELP!!!!!! Luke Holden
1997-05-24  0:00 help! oliver white
1997-04-28  0:00 Help!! UserID
1997-04-29  0:00 ` Help!! Michael F Brenner
1997-03-16  0:00 HELP! Dominic Mailhot
1997-03-17  0:00 ` HELP! Jon S Anthony
1997-03-18  0:00   ` HELP! Jon S Anthony
1997-03-18  0:00   ` HELP! Robert Dewar
1997-03-18  0:00 ` HELP! Robert Dewar
1996-11-02  0:00 HELP!!! Aaron H
1996-03-27  0:00 HELP!!! ~ AnTY ~
1990-09-23 13:52 Help! Ken McCook;SCDQ;
1990-09-25 16:23 ` Help! Michael Feldman
1990-09-26 16:27 ` Help! Andy DeFaria
1990-09-26 19:26 ` Help! Andy DeFaria
1990-08-31 20:21 HELP! "Thomas H. Stripe  255-4472", 513
1990-09-05 16:27 ` HELP! Edward Falis
1990-07-07  7:23 Help !!!! 1LENDL
1990-01-24  1:26 Help! Rowan D. Stevens
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox