🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.comp.lang.learn.c-c++
Article #719

please help me with this problem

#719
From: cyberian bear
Date: Wed, 14 Jul 1999 00:00
54 lines
3201 bytes
i have written program which collects marital status and income of 5 people
and computes their tax. in this prog i had to use a for loop and array.
basically i got most of it but when i execute it asks me for marital status
of first person than his income tehn it skips over marital status of second
person and goes straight to his income, the same happend with 3rd 4th 5th
person. if any1 could please tell me wehre my mistake is i would be very
greatefull to You
Paul

/*Filename:tax604.c
program which calculates taxes paid for 5 people */
 #include<stdio.h>
 int index;
 char marital_stat[5];
 float income[5];

 main()
 {
 introduction();
 getting_the_info();
 }


 /*The following are functions used in this program*/
/*-------------------------------------------------------------------------*
/
introduction()
{printf("\t\t\t\tTAX PROGRAM\n\t\t\t   BY \n\n");
printf("\t\t\t\tINSTRUCTIONS:\n");
printf("\t\t     1.ENTER ANNUAL SALARY FOR A PERSON.\n");
printf("\t\t     2.ENTER MARITAL STATUS OF A PERSON.\n");
printf("\t\t\t   3.REPEAT WHEN PROMPTED.\n\n");
 return;
 }

/*------------------------------------------------------------------------*/
getting_the_info()
{ index=1;
for (index=1; index<=5; index++)
{printf("\nPlease enter the marital status of person # ");
printf("%d ==>", index);
 scanf("%c", &marital_stat[index]);
printf("\nPlease enter income of person # ");
printf("%d ==>", index);
scanf("%f", &income[index]);
}
 return;
}

--
http://www.geocities.com/Pentagon/Barracks/5529/frame-controls.html

-- 
comp.lang.c.moderated - moderation address: clcm@plethora.net
Technical Details
Message-ID: <clcm-19990714-0004@plethora.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 114a87,488b53d56236ec72,start
X-Google-Attributes: gid114a87,public
X-Google-Thread: f4614,488b53d56236ec72,start
X-Google-Attributes: gidf4614,public
X-Google-Thread: 10f67c,488b53d56236ec72,start
X-Google-Attributes: gid10f67c,public
X-Google-Thread: 1014db,488b53d56236ec72,start
X-Google-Attributes: gid1014db,public
X-Google-Thread: 100850,488b53d56236ec72,start
X-Google-Attributes: gid100850,public
X-Google-Thread: 114592,488b53d56236ec72,start
X-Google-Attributes: gid114592,public
X-Google-Thread: 106434,488b53d56236ec72,start
X-Google-Attributes: gid106434,public
X-Google-Thread: 1111a3,488b53d56236ec72,start
X-Google-Attributes: gid1111a3,public
From: "cyberian bear" <pgb204@hotmail.com>
Subject: please help me with this problem
Date: 1999/07/14
Message-ID: <clcm-19990714-0004@plethora.net>
X-Deja-AN: 501084265
X-Old-trace: typhoon.nyu.edu 931409174 128.122.237.21 (Thu, 08 Jul 1999 00:46:14 EDT)
Approved: clc@plethora.net
X-Priority: 3
X-Mimeole: Produced By Microsoft MimeOLE V5.00.2314.1300
X-Complaints-To: abuse@plethora.net
X-Trace: ptah.visi.com 931988073 205.166.146.1 (Wed, 14 Jul 1999 16:34:33 CDT)
Organization: New York University
X-Msmail-priority: Normal
NNTP-Posting-Date: Wed, 14 Jul 1999 16:34:33 CDT
Newsgroups: alt.comp.lang.learn.c-c++,comp.lang.c,comp.lang.c.moderated,comp.lang.objective-c,fj.comp.lang.c,fj.lang.c,it.comp.lang.c,pl.comp.lang.c,relcom.comp.lang.c-c++
Originator: clcm@plethora.net (Comp Lang C'Moderated)