This forum is in archive mode. You will not be able to post new content.

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - KoubaK

Pages: [1]
1
Projects and Discussion / Re: Programing Help
« on: May 09, 2013, 11:27:28 PM »
Thanks guys... Once I'm done with my other classes I will use the free time to try to actually code the entire program.

2
Projects and Discussion / Re: Programing Help
« on: May 09, 2013, 11:15:23 PM »
ande, since I cannot use a boolean (just because it has not been covered in class yet).
would introducing Found back into the pseudo work?
Code: [Select]
Declare K As Integer
Declare Found As Integer
Set Found = 0
Set K = 0
For (K = 0; K < Count; K++)
  If State[K] == "Texas" Then
    Write Names[K]
    Set Found = 1
  End If
End For

If Found == 0 then
    Write "No family members reside in Texas."
end if

3
Projects and Discussion / Re: Programing Help
« on: May 09, 2013, 10:58:06 PM »
Rav3n, so it should look something like this:
Code: [Select]
Declare K As Integer
Set K = 0
For (K = 0; K < Count; K++)
  If State[K] == "Texas" Then
    Write Names[K]
  Else
    Write "No family members reside in Texas."
  End If
End For
 

4
Projects and Discussion / Re: Programing Help
« on: May 09, 2013, 10:39:52 PM »
Rav3n, good point... Thanks
So if I apply a For loop instead of the While... this is what I have in mind.
Code: [Select]
Declare K As Integer
Set K = 0
For (K = 0; K < Count; K++)
  If State[K] == "Texas" Then
    Set Found = 1
  End If
  Set K = K + 1
End For

Now, if the above works... how I get the data to display?
Do I simply invoke " Names[K] " ???

5
Projects and Discussion / Re: Programing Help
« on: May 09, 2013, 09:37:10 PM »
I went back to my textbook and I actually found my answer after some (okay, a lot of!!!) reading... I think the below will perform my task :D
Code: [Select]
Declare Index As Integer
Declare Found As Integer
Set Index = 0
Set Found = 0
While (Found == 0) AND (Index < Count)
  If State[Index] == "Texas" Then
    Set Found = 1
  End If
  Set Index = Index + 1
End While
If Found == 0 Then
  Write "No Family members reside in Texas."
Else
  Write "Following family members reside in Texas: "
  Write Names[Index - 1]
End If

6
Projects and Discussion / Re: Programing Help
« on: May 09, 2013, 08:32:18 PM »
you already keeping track of the count, use a for loop to compare the "state[count]" variable with the word "Texas" if it finds it then display the name variable "Names[Count]"

what language you will code in ?

Rav3n, would the following be correct then?
Quote
For (State[Count] = 1; State[Count] == Texas; State[Count++])
  Write "The following family members live in Texas: "
  Write Names[Count]
End For

Well, this is my intro to programming, but if I get the time I will try to use Phyton or C+ so I can learn the language in the process.

7
Projects and Discussion / Re: Programing Help
« on: May 09, 2013, 06:31:51 PM »
Do you want someone to code it? Or just help you finish it? or what? I dont understand at all

I need someone to help me finish it. I'm having a hard time figuring out how to get he information to display only those who live in the state of Texas.

8
Projects and Discussion / Re: Programing Help
« on: May 07, 2013, 08:14:54 PM »
I will help you to finish your program as soon as I finish all of my unfinished programs :D

Hahahaha Okay... I shall wait :D in the meantime, if someone else has the time, that would be awesome.

9
Projects and Discussion / Re: Programing Help
« on: May 07, 2013, 05:21:16 PM »
It's really not a language at all, it is a pseudocode.
This is for a class I'm taking...

10
Projects and Discussion / Programing Help
« on: May 07, 2013, 05:03:40 AM »
Hey guys, so I recently started my Programing course, because I suck at it!
We are
designing a program that will allow a user to input a list of your family members along with their age and state residency. Once the data is inserted into the script, the average age of the entire family would need to be displayed to the user. Once the Age is displayed, the names of those who live in the state of Texas would be listed.

Below is what I got so far... can anyone help me get this finished up.

Quote
//Main Module - Declare Variables
Declare Names[50] As String
Declare Ages[50] As Integer
Declare State[50] As String
Declare MemberName, Residency As String
Declare MemberAge, Count As Integer
Declare AgeAvg As Float
Call Welcome_Message module
Call Input module
End Program

//Input module - request necessary inputs
Set Count = 0
Write "Enter a family member's name; Enter * when done."
Input MemberName
While MemberName != "*"
  Set Names[Count] = MemberName
  Write "Enter this family member's age: "
  Input MemberAge[Count]
  Set Ages[Count] = MemberAge
  Write "Enter this family member's state of residency: "
  Input Residency
  Set State[Count] = Residency
  Set Count = Count + 1
  Write "Enter a family member's name or * when done."
  Input MemberName
End While(MemberName)
Call Age_Average module
Call Texas_Residents module

//Age_Average module - This submodule will produce the average family age
//and display it to the user.
Declare Sum As Integer
Declare K As Integer
Set Sum = 0
Set K = 0
//The While loop below will get the sum of all ages
While K < Count
  Set Sum = Sum + Ages[K]
  Set K = K + 1
End While
//The below computes the age average and set its corresponding value to the variable.
Set AgeAvg = Sum/Count


//Texas_Residents module - This submodule will determine which family
//members reside in Texas and display their names.
If State == "Texas" Then
  Write "The following family members live in Texas: "
  Write Names[50]
Else
  Write "No family member lives in Texas."
End If

Pages: [1]


Want to be here? Contact Ande, Factionwars or Kulverstukas on the forum or at IRC.