Over the summer I've tried to learn Obj-C but it didn't work out. Last month I tried learning Java but I just don't understand it. I want to learn to program but I can't get it through my head. All of the programming books show you how to write the language, but NOT how to use it! The programming examples are all very basic. They don't show you how to develop complex programs that actually do anything useful! I need help! I want to learn to program!
[Red Lions] Coding Help Desk |
|
Oct 1, 2014 02:56 PM
(This post was last modified: Oct 1, 2014 03:01 PM by Water Aura.)
(Oct 1, 2014 12:10 PM)Walt.Jun10r Wrote: I have an API that was posted on here for Tagged.com So i decided I was going to make a small bot taht would make the Tagged experience way easier ;). I don't think you'd be getting any help from them as apparently they didn't accept anyone that knew .NET (I applied [not using shitty .NET]) Though I think you have to access the page and save the cookies as a text then you can carry on the cookies. Anyways good luck. - Not trying to inspire any hate, but you didn't accept Pillows? A shame. (Oct 1, 2014 12:57 PM)Cyber Saint Wrote: In your opinion, what's the best general use programming language? Personally I would learn a scripting language -> programming language Cause scripting languages are easier to understand and it's fun to play with until you get to the hardcore stuff ;) -Help from someone that's not in specialist ;). (Oct 1, 2014 02:52 PM)-Slurpee- Wrote: Over the summer I've tried to learn Obj-C but it didn't work out. Last month I tried learning Java but I just don't understand it. I want to learn to program but I can't get it through my head. All of the programming books show you how to write the language, but NOT how to use it! The programming examples are all very basic. They don't show you how to develop complex programs that actually do anything useful! I need help! I want to learn to program! Personally I suggest you to explore for yourself. Don't rely on examples that long, read libraries/apis for the pre-conditions and post-conditions thus letting you learn what it does. ![]()
Oct 1, 2014 05:26 PM
(This post was last modified: Oct 1, 2014 05:35 PM by SIM-2015410.)
(Oct 1, 2014 02:56 PM)Water Aura Wrote: I don't think you'd be getting any help from them as apparently they didn't accept anyone that knew .NET (I applied [not using shitty .NET]) I know. NET and I am about to help him. I am sorry you didn't get accepted, and you are welcome to help here regardless, if you want to. (Oct 1, 2014 02:52 PM)-Slurpee- Wrote: Over the summer I've tried to learn Obj-C but it didn't work out. Last month I tried learning Java but I just don't understand it. I want to learn to program but I can't get it through my head. All of the programming books show you how to write the language, but NOT how to use it! The programming examples are all very basic. They don't show you how to develop complex programs that actually do anything useful! I need help! I want to learn to program! Perhaps you should try python. It is quite a good language for beginners. Once you get your head around he language, you can move on by yourself, because no book can each everything. Just find an idea for a project and start working on it. If you find something you don't know, just have a search on Google, or even ask for help here with specifics. But the best thing to do is just try. (Oct 1, 2014 12:57 PM)Cyber Saint Wrote: In your opinion, what's the best general use programming language? I would be inclined to suggest Java. Java is a write once run anywhere language, and can be used when coding android apps, desktop software and applets, so it is definitely a general purpose language. (Oct 1, 2014 12:10 PM)Walt.Jun10r Wrote: I have an API that was posted on here for Tagged.com So i decided I was going to make a small bot taht would make the Tagged experience way easier ;). I believe that you should be able to pass the cookie container to other functions, etc, or merely read the values contained in the cookies and pass them as strings. Do you understand how the api code actually works? Once you understand it, you can more easily modify it. The code displayed is simply code to set HTTP headers of a Web request, in order to interact with the webpage.
Oct 1, 2014 07:35 PM
(This post was last modified: Oct 1, 2014 07:43 PM by Vegas.)
So, my first inquiry begins:
I'm making a program (Beginning C) for the billing segment of a voip phone provider that accepts input for a customer number, purchased payment plan and amount of hours used. It then verifies that the input is entered validly, and calculates their monthly bill and also says how much they would have saved if they had gone with package B (if they used package A) or C (if they used package B) I'm getting pretty comprehensive with the fundamentals of C and Java but we're just scratching the surface on pointers and case/switches, so I have to incorporate those. This is where my variable pointers for the equations would come in, but I'm not really comfortable with them yet. I could really use some pointing in the right direction for calculating these different inputs to make the invoice. I've worked this out so far but I'm not totally sure on the syntax of my pointers either: Code #include <stdlib.h>I'm also not getting an opportunity to input anything for the Package char A/B/C, hence the comments on the final input statement (currently debugging to no avail)
Oct 1, 2014 07:55 PM
(This post was last modified: Oct 1, 2014 08:37 PM by SIM-2015410.)
(Oct 1, 2014 07:35 PM)Vegas Wrote: So, my first inquiry begins: Ok, this is quite a long question so I will do my best to work through it. I will edit my post as I go. If you are confuded about pointers, let me provide a quick explanation: * is used to declare a pointer. A pointer holds the ADDRESS of another variable in memory, not its value. & is used to get the address of a variable in memory, in order to store it in a pointer, or reference the memory location directly (like in the scan statement). But in this scan statement, we are passing pointers, so they already hold the address and we don't need to use & when the pointer is used as a variable, it stores the memory location, so printf( custNo ); will print out the memory location, whereas printf( *custNo ); will print out the value. I rewrote your code, working solution below. I have no idea what the charges are supposed to be so I just wrote different calculations in each plan, but I will explain any parts you don't understand to you: Code #include <stdlib.h>I guessed that the reason why the 2nd input was being skipped, was that it thought it already had input - from the first statement. So I just added a random scan statement in before that to catch this extra unwanted input, and it worked fine.
Awesome! This is a bit easier to understand now. I mean it's going to take some getting used to for me to just be second-nature with pointers but I get the point I think. I really like how you set up the verification condition of { if !(customerInfoVerifications) }, I would never have thought of that.
First question: I'm not familiar with what you're using here: system("PAUSE"); Not something we've gone over and I can't seem to find it in my notes but I'll look it up right now. Anyway, what does it do for this particular program? Lastly, I'm guessing that to calculate the amount a customer would have saved with another package is going to need something along the lines of like { if (inputHours > hoursPackageA) ... } and then adding up the charge for overage (.08 / minute) on top of the original charge, right? That's the most efficient way I could think of doing it, but it's still kind of new to me just plugging a mathematical scenario into a code.
Oct 2, 2014 01:11 AM
(This post was last modified: Oct 2, 2014 01:16 AM by SIM-2015410.)
(Oct 2, 2014 01:02 AM)Vegas Wrote: Awesome! This is a bit easier to understand now. I mean it's going to take some getting used to for me to just be second-nature with pointers but I get the point I think. I really like how you set up the verification condition of { if !(customerInfoVerifications) }, I would never have thought of that. System("PAUSE"); just makes the program stop at the end, with "press any key to continue..." so that it doesn't close straight away. I just added it because my compiler closes the program straight away without it. Maths and code go hand in hand. Certainly, just plug the maths straight in. Code is logical, and so once you know what to do in your head, just write it in the code :) Cost at 0.08 per minute: Code double minutes = 60 * hours;(Oct 2, 2014 01:18 AM)hellomen Wrote: Great a one-thread based stackoverflow... Certainly working out for me c: Thanks Mesh, this has shed a good amount of light on my project. (Oct 2, 2014 01:28 AM)Vegas Wrote: Certainly working out for me c: 1 based on a thousand is not what I meant with "I don't think its gonna workout" Therefor you could just have posted a help thread or used google, pretty sure its asked before, therefor you even could've asked it at stackoverflow. (Oct 2, 2014 01:11 AM)SIM-2015410 Wrote: System("PAUSE"); just makes the program stop at the end, with "press any key to continue..." That's windows specific though. A better way to do it would be getchar() although I'm guessing Vegas is programming on Windows so it doesn't matter much anyway. Just sayin' yo. (Oct 2, 2014 09:22 AM)ObscureCoder Wrote: That's windows specific though. I know, as I stated, I just added it in for my own compiler. He can remove it if he wishes, I didn't mean for my solution to his issue to be fully copied, just used as a guide.
I'm still working on this same assignment (with the calculating of internet package costs) and have made some progress both in understanding and, well... progress.
Still, this is pretty intimidating. I can work out most of it but I keep running into more errors that I don't understand. Pointers are slowly becoming comprehensible to me, though they need much reinforcement. I really appreciate all the help I've received so far. I'm going to hit the tutoring lab for programming tomorrow, but it's only open for like an hour on Fridays. If someone finds some time tonight and can make a session on skype or whatever to help me out, I'd love some more assistance. This is a doozie l: Spoiler (Click to View) (Oct 2, 2014 10:45 PM)Vegas Wrote: If someone finds some time tonight and can make a session on skype or whatever to help me out, I'd love some more assistance. This is a doozie l: PMed you regarding this, Hope I can help 🤝 |
|
|




![[Image: eBxEg.gif]](https://i.imgur.com/eBxEg.gif)
![[Image: 1dd1c0065c50534bef569f8902593cd1.png]](https://i.gyazo.com/1dd1c0065c50534bef569f8902593cd1.png)
![[Image: 5d531add9a89984a560c7fc41917327d.png]](https://i.gyazo.com/5d531add9a89984a560c7fc41917327d.png)