Help Needed On A Program
Hey everyone, I recently started introduction to C and my professor gave us our first assignment and I have no idea where to start. I missed one day of class and I think it involves the material that I missed. So can you please read the instructions below and tell me where and how I should start? We are using Code:Blocks if you were wondering.
Introduction: Arupís Getting Married!!!
Arup got engaged this summer and now has been inundated with much more work than he anticipated in planning his wedding. He is in a bind and has decided that some C Programming skills could actually help him. In the following assignment, youíll write three programs to help him make some decisions for his wedding planning. Hopefully, your programs will save him some time so that he can spend enough time teaching classes and still have time leftover for some UCF football!!!
I post the PDF document online because It will look like crap if I copy and Paste it.
Do read our homework policy.
I have read the Homework policy. I was just asking for help to try to explain this to me, I don't want you to do the assignment. I hope you get what I'm trying to say.
I assume you have some kind of lesson book? Open the book to the front, read until you reach the part that lets your mind figure out what to do in this problem.
Maaan, that professor is brilliant! Giving just enough info in order to get the job done. I like that he/she gives no code for help. And the little story behind the exercise if nice too. :D:p
EDIT: So, what's your problem, young preProgrammer? :D
EDIT^2: I changed me mind, he/she calls Code::Blocks "compiler".
No we don't use a book, he just uses powerpoint presentation to teach.
My Problem is at first when I read it I was clueless on what i'm supposed to do. As I stated, I missed one day of class because I had a job interview during that time and I think I missed some key points that day. Could you please try to explain what he's asking for and give me some tips on how to do it.
I don't want you to give me the code line by line, it's just that I'm new to C and I just want to get good grades. I took a very basic programming in my freshman year in High School, we used Q Basic if you know what that is. But yea,
If you want and can, would you email me because I don't get notifications once someone responds to this thread.
#1... Read my signature ... 4 simple steps. You haven't even tried step 1.
Originally Posted by Perspolice1993
#2... Get a book 'cause you ain't gonna learn nothin' from powerpoint slides.
#3... Get a new teacher... one who actually knows about programming.
Yes, I read your signature. I agree with you 100%. Believe it or not I read it like 4 times already and I just don't know where to start.
Originally Posted by CommonTater
BTW could you please recommend a book to me? Some thing very effective and affordable. I have already spent over $500 on college books.
And to answer your last line, I can't get a new teacher, the deadline has passed to drop or swap the course. He is actually very intelligent, he graduated from MIT. It's like he just taught us 2+2=4 but now he's asking us to find the derivative of ln(9x+4g(x)).
Have you tried...oh, I don't know...talking to the professor or a TA about it? I mean, you are paying their salary to teach you. We get nothing out of this except satisfaction from the occasional student that actually wants to learn.
The TA is only available on thursday and tuesdays. He told us not to email him, email the TA. I have emailed him, but haven't received a response yet. I just don't want to wait till the last minute to do it. And I didn't have to pay for the class, I got full ride to the school.
So take one problem and analyze it. What's the first problem about? Fitting tables in a box, with room around each table. Well that's just a simple math problem. Work it out on paper first, until you understand what steps you need to do to solve that. When you can solve it on paper, break down the solution into steps, and see what you need to make that happen in C.
So... sit down with a pencil and paper and analyse the problem until you understand how to do it manually...
Then... working with your non-existent textbooks and your Compiler's documentation plan out how to solve the problem in code.
Next... write the actual code to calculate the seating.
Finally... test your program with different combinations of data to be sure it works.
There isn't a programmer on this planet who can write code to solve a problem he doesn't understand...
I highly doubt your teacher took you from 2+2=4 to the derivative of ln(9x+4g(x)). Maybe from 12+26=38 to 494+1377=1871. And besides, exercises that only cover what everybody already understands and can do without putting in any thought or effort are a waste of time (think how you would feel if your teacher actually asked you to do pages of single-digit addition problems). A big part of college and a CS degree is about you developing your analytic, problem solving and critical thinking skills, so you can tackle new, unknown problems, instead of just those that fit the template you've been taught.
We don't even see int main(void), let alone you attempting to get input from the user. This is interpreted by us as laziness and do-my-work-for-me-ness, whether or not that's what you meant. Furthermore, we aren't here to teach you. There are an ungodly amount of tutorials on C programming all over the internet if you do a quick search (we even have some here: Cprogramming.com - Programming Tutorials: C++ Made Easy and C Made Easy).
But you shouldn't even be trying to code anything yet, since it seems clear that you don't understand the problem. As Tater is wont to say, "There is no programmer anywhere who can code the solution to a problem they don't understand". You need to figure out how to solve this by hand first. Draw some pictures like in the assignment (graph paper may help here to keep things proportional). Look for patterns. What's the smallest room that can fit 1 table? What about the smallest room that can fit 1 table high by two tables wide? 3 tables wide? What about 2 tables high? 3? What happens if you make the room 1 foot wider? 2 feet? 3? How much do you need to increase the width or height by to ensure room for a new row or column of tables with room for seating? The assignment even gives you a sample problem with a correct answer. Work that out and don't stop until you get the correct answer, and know why and how your method works. Then, do several more practice problems with a pencil and paper.
When you figure out how to do this by hand, most of the code should "fall into place". I'm not saying it will write itself in 10 lines, but the code for the solution will be much more obvious at that point. If you're still stuck, then you can post back with your code and specific questions, and get much better help.
EDIT: Not only is he wont to say it, but he just did while I was writing this post!
For a book, C programming books are fairly easy to find and are very cheap, since the language itself has not been updated in a while.
Originally Posted by Perspolice1993
The book we are using in my class is: The C Programming Language 2nd ED. by Kernighan & Ritchie ISBN: 0-13-110362-8.
I would NOT recommend in purchasing that book from your school book store, nor would I recommend in purchasing a "new" copy. I would recommend a used copy, from a online site or a used book store in your area.
Also, I would double check to see if calculus is a prerequisite for your class. If it isn't then asking you to use/perform calculus is very unreasonable.
And if your TA is unavailable then go to the instructor. And at most schools it is standard policy to be available at the student's request. but remember they are humans and have a life outside of school. What that means is if their office hours do not work for you, then you can schedule another time outside of their hours to meet, example in the past I had a TA whoes office hours did not work with my schedule, a simple Email saying, due to other class scheduled I cannot go to your office hours, can we meet at such and such time (it also help to give your schedule), works almost all the time.
LOL... It's MY line and I'll use it as I see fit! :D
Originally Posted by anduril462