The Way to Programming
The Way to Programming
Here you go
#include#include using namespace std; // function and declaration of variables float cal_area(float height, float length) { // when the function is called it will return the result of height multiplied by length return (height * length); } // function and declaration of variables float cal_cost(float area, float cost) { // when the function is called it will return the result of area multiplied by cost return (area * cost); } float vari_cal (float variation) { return (variation/100); } int main() { int option; float height,length,Area,Cost; float variation; cout<<"Hello welcome to paint a room\n\n"; cout<<"Please enter the height of room --> "; cin>>height; while(height < 4 || height > 6) { cout << "Height must be between ( 4 - 6)" << endl; cout<<"Please enter the height of room --> "; cin>>height; } cout<<"Please enter the lenght of the walls --> "; cin>>length; while (length < 2 || length > 15) { cout << "Length must be between ( 2 - 15)" << endl; cout<<"Please enter the height of room --> "; cin>>height; } Area = cal_area(height, length); cout <<"\nArea of room is --> "< "; cin>>option; if (option == 1) { Cost = cal_cost(Area, 1.0); cout<<"\n\nThe cost of painting the room is --> "< >variation; while(variation < 2 || variation > 5) { cout << "Error in variation ( 2 - 5).." << endl; cout<<"Please enter cost variation %"; cin>>variation; } float Cost_with_variation = vari_cal(variation) + Cost; Cost = cal_cost(Area, 1.5); cout << "Cost with variation --> " << Cost_with_variation << endl; } else if (option == 2) { cout<<"\n\nThe cost of painting the room is --> "< >variation; while(variation < 2 || variation > 5) { cout << "Error in variation ( 2 - 5).." << endl; cout<<"Please enter cost variation %"; cin>>variation; } Cost = cal_cost(Area, 1.5); float Cost_with_variation = vari_cal(variation) + Cost; cout << "Cost with variation --> " << Cost_with_variation << endl; } else if (option == 3) { Cost = cal_cost(Area, 1.95); cout<<"\n\nThe cost of painting the room is --> "< >variation; while(variation < 2 || variation > 5) { cout << "Error in variation ( 2 - 5).." << endl; cout<<"Please enter cost variation %"; cin>>variation; } Cost = cal_cost(Area, 1.5); float Cost_with_variation = vari_cal(variation) + Cost; cout << "Cost with variation --> " << Cost_with_variation << endl; } else { cout<<"\nPlease select an option between 1 and 4"; } } while(option!=4); }
ASP.NET is easier and it supports C# and VB.NET. Downside is PHP is more ubiquitous than ASP.NET. I never had a problem using ASP.NET and SQL Server.
I’m not sure what languages you’re studying but as a minor project, how about a fake stock market website which pulls live info via Yahoo to allow you to buy and sell stocks using fake money, and tells you what you would have made if it had been real money.
I did this project, and it was fun. cs50 dot net gave me the code to start from.
Languages used:
HTML
PHP
MYSQL
http://thenewboston.org/
I wouldn’t say the best, I think it’s personal opinion and many members here dislike the videos because sometimes they aren’t exactly correct. Having said that, this is how I got started with Java… It really depends on how you learn best though – I learn much better by watching videos than reading, but others swear by reading!
Once I watched the videos I just used Google and online forums (inc. StackOverflow) as and when I needed. This is a very effective way of learning, even without the videos. I started learning C# by just setting myself a project and applying my knowledge of other programming languages together with Google.
Bottom line – let’s not get into another debate about thenewboston! The best thing to do is to try the different methods of learning (i.e reading, videos, hands on) and see which one suits you the best because everyone learns differently. Then you can come back and ask for recommendations for your chosen way of learning.
Hope that helps, and makes sense.
What is your Native language? If it is English, then you need to work on that because you need to be able to communicate clearly and concisely with clients. That’s a must … none of what I just said applies if you deal with clients in another language that you have a very good command of.
That being said, computer programming is not going away any time soon. Experiment with different languages and development platforms and see what things float your boat. Once you find your niche then go after it with gusto and learn everything you can about it.
Many people are creating websites today with new tools that are available such as WordPress. There’s no shame in that. From what I can see, WordPress can create a more sophisticated site in a shorter period of time than I could coding it from scratch.
If you are REALLY good as a coder you can make money because you can do the jobs faster than the competition, allowing you to either promise faster results, or allowing you to lower the pay per job, to complete more jobs (because they will want someone who can do it for cheaper with good results), and make more money that way.
If you are only OK at programming, just know that there are others who are really good that may take the jobs from you. Keep in mind that they can’t do EVERY job, due to time restrictions, etc, so there will be jobs available, but just know that competition exists.
If you have no skills in programming, and are over the age of 20, I wouldn’t advise trying to start learning programming. The best programmers probably have been dealing with computers since they were 13 or 14, and have already had about 6 years of experience by the time they are 20, even if during some of those first 6 years they were self taught.
On the other hand, I don’t recommend trying to involve yourself into a career that you literally know nothing about, due to the fact that it pays well. You have to have a basic understanding of what “Engineering” is. Maybe try Wikipedia to see if it’s something that interests you before deciding that you want to get into a field because you’ve ‘heard’ it makes good money.
if it’s something of a dream I wouldn’t give it up so easily, just be prepared for it to take a while. But for the time being, it think it’s best to go for the safe solution. I’m in the same boat as you are, had some fun experiences programming as a kid some mumble mumble years ago. Razz I’ll soon be starting my lessons in php and I’m also getting a lot of reactions like hmm too difficult, will take you long, etc (maybe a bit territorial behaviour of some? Not you of course TCD, you’re just an ordinary a-hole!, but if it’s something you really want you’ll get there… Anyways, good luck with your endeavours!
If you would like to start programming, start with an easy language. That way you get the syntax down and can move on. I would suggest C. Once you have a handle on C you can start moving on to programming languages like Java, C++, etc. To learn these languages is a different story, as everyone learns differently. I would suggest reading books on programming, and if you are stuck with something search a quick video. My recommendations on books would be the “Head First” series.
The code itself is very messy and not really easy to understand. I think you should go back and rethink your design and requirements. Write code, iterate and experiment. Breaking down problems is the most important skill you can develop as a programmer. Simple code is maintainable, fast and far more likely to be correct than complex structures.
Let’s see what we want here;
Enter student data
Print registered students (which means we need to save it somehow)
Start from the simplest program;
First iteration
User can enter student information.
Application quits.
Second iteration
User can select to enter student information or quit application
While user has not selected quit, let user enter student information
Third iteration
User can select to enter student information or quit application (Display how many students are registered)
While user has not selected quit, let user enter student information and save to array
Note about this iteration, I’ve not made it to print the student array because it’s too big of a requirement for a single iteration. Instead I’ve made a simpler request (to display the total of registered students) which will force us to somehow save the students into an array.
Fourth iteration
User can select to enter student information, print registered students’ information or quit application (Display how many students are registered)
While user has not selected quit
if user selected to enter information let user enter student information and save to array
if user selected to print student information, for each student entry in the students array print information
And well, that’s it. Each iteration builds on the previous one (you’ll need to refactor and refine code as you go though). For example, the first iteration will not need any methods other than the main one but for the second iteration we see that we want to perform the same thing over and over again so it’s better to refactor it into another method. For the third iteration we see that we need to save our data but then how do we return all that information from our method? make a container structure (struct) for the information so we can pass it around as a single logical unit…
And one last thing, one of the most important things in your code are the names you give to everything that is used, from classes, structs and variables to methods and namespaces. Learn about camel and pascal cases or separate using underscores but make sure that everything is readable and understandable. For example, what the heck is “onef” namespace??
It’s still not as widely used as it should be. There are many benefits to using the gpu over the cpu. I did manage to figure out how to do what I trying to do before I made my post and if you’d like to PM me details on what you’re working on, I might be able to help a little. In the meantime, since you mentioned analyzing performance, here are some benchmarks:
http://code.google.com/p/engine-cuda/wiki/benchmarkVersion011
We are willing to help, but it is impossible with the information you provided… Which database? Is there some code you can show us, on how you build the program? We can’t help you otherwise.
I used CodeCademy, it’s a nice little site!
http://www.codecademy.com/
Sounds like the course I am doing at college now, even down to learning Visual Basic. Dislike that language very much.
If your main interest is websites, you want to be looking to learn HTML and PHP. I think ASP.NET is too specific personally, and PHP is a lot more widely used. The way I learnt HTML and PHP was simply by setting myself a project (even if it’s not that simple) and looking up how to do things when I needed to. I think it’s pretty much the best way to learn, especially when you have previous knowledge of VB. It’s important for you to follow links though, even if it means you spend half the day reading, because that way you’ll get to know the best and most efficient ways to do things! Question everything and befriend Stackoverflow.
Hope that helps, and good luck
* Practice coding problems.
* Make a nice website.
* Go to conferences
* Go to meetups (usually there’s some sort of user meetup for some language or software in an area every once in a while, check it out!)
* NETWORK
* NETWORK
* NETWORK
For OOP, it’s important to identify the objects. In any problem domain, there are specific items that you’ll refer to in conversations, and these often map onto objects. For example, when talking about payroll, you’ll talk about payslips, employees, raises, deductions, taxes, etc.: these may all be objects, including “payroll”. To better understand how they hang together, you have to talk about whether an object “is a” another object or “has a” another object.
Sign in to your account