🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: please help me with this problem

#721
From: John Smith
Date: Thu, 15 Jul 1999 00:00
73 lines
3945 bytes
I have been trying to figure out this problem for over 4 hours now, and I
cannot figure it out.  The nearest I can figure out is that maybe it has
something to do with the way that the program is trying to handle the char
type array, and beyond that I cannot get anywhere.  Even though I have not
gotten to working with pointers yet (that is next chapter for me) I thought
that I might try playing with that.  But not really knowing what I am doing,
by just skimming the chapter, I can't figure out it that is the right route.


cyberian bear <pgb204@hotmail.com> wrote in message
news:clcm-19990714-0004@plethora.net...
> 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

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

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 114a87,488b53d56236ec72
X-Google-Attributes: gid114a87,public
X-Google-Thread: 10f67c,488b53d56236ec72
X-Google-Attributes: gid10f67c,public
X-Google-Thread: 114592,488b53d56236ec72
X-Google-Attributes: gid114592,public
X-Google-Thread: f4614,488b53d56236ec72
X-Google-Attributes: gidf4614,public
X-Google-Thread: 1111a3,488b53d56236ec72
X-Google-Attributes: gid1111a3,public
X-Google-Thread: 1014db,488b53d56236ec72
X-Google-Attributes: gid1014db,public
X-Google-Thread: 100850,488b53d56236ec72
X-Google-Attributes: gid100850,public
X-Google-Thread: 106434,488b53d56236ec72
X-Google-Attributes: gid106434,public
From: "John Smith" <someone@microsoft.com>
Subject: Re: please help me with this problem
Date: 1999/07/15
Message-ID: <clcm-19990715-0007@plethora.net>
X-Deja-AN: 501464725
X-Old-trace: 15 Jul 1999 00:33:47 -0500, 205.245.9.110
Approved: clc@plethora.net
References: <clcm-19990714-0004@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 932071003 205.166.146.1 (Thu, 15 Jul 1999 15:36:43 CDT)
X-Msmail-priority: Normal
NNTP-Posting-Date: Thu, 15 Jul 1999 15:36:43 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)