Jump to content

Does anyone know C? Need halp pls


Reformed epTic

Recommended Posts

Gatorade: Well What you do is you break it down like this
Gatorade: 1. Any names entered into the scanf are saved into an array
Gatorade: 2. You use a function to get the size of the array and save that number
Gatorade: 3. You make a function to iterate through the array n times where n starts off as 1 and goes up to a max of 15
Gatorade: 4. Inside that function with the loop I just mention you make ANOTHER loop that goes through and checks the length of the current array item for it's length and compares that to the n from the previous loop
Gatorade: 5. Once the full array.size - 1 has been gone through for n you do n++ and output how many times you found names of that length
Gatorade: 6. This completes one cycle of the inner loop and you step back out to the outer loop and increment by 1. Repeat till outerloop is done
Gatorade: 7. You basically do the same thing again in a different function only for the alphabet thing
Gatorade: 8. Finally you set up the main function just to call these two functions with appropriate spacing as well as the scanf for the first part feeding into the array
Gatorade: *************************************************************************************
 

 

Thats what he needs to do if anyone has the energy to look at his code. Unless he already has a set number for the array size then he can make that a global variable and skip that step

Edited by Sugarfoot
Google™ likes this
Link to comment
Just now, Sugarfoot said:

Gatorade: Well What you do is you break it down like this
Gatorade: 1. Any names entered into the scanf are saved into an array
Gatorade: 2. You use a function to get the size of the array and save that number
Gatorade: 3. You make a function to iterate through the array n times where n starts off as 1 and goes up to a max of 15
Gatorade: 4. Inside that function with the loop I just mention you make ANOTHER loop that goes through and checks the length of the current array item for length and compares that to the n from the previous loop
Gatorade: 5. Once the full array.size - 1 has been gone through for n you do n++ and output how many times you found names of that length
Gatorade: 6. Once you have walked through the inner loop and outer loop till desired you complete that function
Gatorade: 7. You basically do the same thing again in a different function only for the alphabet thing
Gatorade: 8. Finally you set up the main function just to call these two functions with appropriate spacing as well as the scanf for the first part feeding into the array
Gatorade: *************************************************************************************
 

 

Thats what he needs to do if anyone has the energy to look at his code. Unless he already has a set number for the array size then he can make that a global variable and skip that step

Hold up. This sounds like a hw assignment. Am i doing your hw @7th Ward Charizard

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...