TRENDING NEWS

POPULAR NEWS

How Easy To Code This Program And How Much

I really like programming, but when I see how much more I need to learn I become a little impatient. Are there some good advisements for this?

The same happens to me. Ive just started java programming 1 month ago and I get a bit overwhelmed by all there is: data structures, algorithms, design patterns, java Enterprise and web development. And I realize I'll need to master HTML/CSS/JavaScript too for the frontend, and Spring for the backend, and probably Android too, AND since Im more into OSX and iOS I need to learn Objective C and Swift, AND since Im into a a CCNA networking course I believe that I need to learn about Linux servers, and that probably means learning C to design my own linux networking applications. I have a huge path ahead, I feel anxious and passionate at the same time. I wish there was a machine like in Matrix to plug yourself and learn in a matter of seconds, but I also enjoy the process of learning so I guess I have lots of time to enjoy.

Java Programming Easy Questions?

I am taking a Visual Programming course (Java) and this is the first assignment we got. I attempted some of them, but I'm lost on a couple of them. If you dont mind, could you look over my answers and help me with the others?
I would appreciate it SO much ^_^

1.What is the output of this code sequence?
double a = 12;
System.out.println(a); 12

2.What is the output of this code sequence?
int a = 6;
System.out.println(a); 6

3.What is the output of this code sequence?
float a = 13f;
System.out.println(a); 13f

4.What is the output of this code sequence?
int a = 23 % 5;
double b = a;
System.out.println(b); 115 a
5.What is the output of this code sequence?
int a = 12 / 6 * 2;
System.out.println((double)a); 4

6.Show the output of the following statements:
System.out.println(“1” + 1);
System.out.println(“1” + 1 + 1);
System.out.println(1 + “Welcome” + 1 + 1);
System.out.println(1 + “Welcome” + ‘a’ + 1);
System.out.println(“1” + (1 + 1));

7.Write the code to declare a boolean variable named a and assign a the value false.
public class Exercise {
static void main(String[] args) {
boolean a = true;
}
}


8.Write the code to calculate the average of two int variables a and b and print the result. The average should be printed as a floating-point number.
int a = 3;
int b = 5;

9.Where is the error in this code sequence?
int a = 3.3;

10.Write a program to compute and output the volume of a cylinder having a radius of 3.2 inches and length of 6 inches, using following formulas:
area = radius * radius * PI
volume = area * length

How to code these programs in Python?

Hi, I'm having a little trouble with coding these programs for Python. Can anyone help me?

#1. A standard science experiment is to drop a ball and see how high it bounces. Once the ``bounciness'' of the ball has been determined, the ratio gives a bounciness index. For example, if a ball dropped from a height of 10 feet bounces 6 feet hight, the index is 0.6 and the total distance traveled by the ball is 16 feet after one bounce. If the ball were to continue bouncing, the distance after two bounces would be 10 ft + 6 ft + 6 ft + 3.6 ft = 25.6 ft. Note that distance traveled for each successive bounce is the distance to the floor plus 0.6 of that distance as the ball comes back up.
Write a program that lets the user enter the initial height of the ball and the number of times the ball is allowed to continue bouncing. Output should be the total distance traveled by the ball.

#2. The German mathematician Gottfried Leibniz developed the following method to approximate the value of pi:

pi/4 = 1 - 1/3 + 1/5 - 1/7 + ...

Write a program that allows the user to specify the number of iterations used in this approximation and displays the resulting value.

If you can help me, please also explain to me how you did the coding... I'm very confused. :(

Thanks so much!

How can I make money by coding and programming from home while I am in college? If there's a way, what is the best way to learn programming as a beginner?

So, you don’t even know the first thing about programming and you’re wondering how you can make money doing it? A person who has just graduated college with a computer science degree (a four year program) is considered a junior level developer by any employer. They generally will be given very clear instruction on well-defined, small tasks until they prove that they have the ability to do more.You might be able to find freelance work on the net that will pay a small amount (maybe as much as a few hundred dollars for a fairly complex program.) Even so, unless you happen to get lucky and turn out to have a talent for programming, you are at least as likely to screw up badly as you are to succeed.Programming seems like an easy thing to do. There are bootcamps and all promising that after a few weeks or months of learning, you’ll be ready to be a web developer. Yeah, sure. Of small, simple projects that don’t ask for anything even the remotest bit sophisticated. It isn’t that easy.Go ahead and try to teach yourself programming. Start with some introductory tutorials on programming in your language of choice to get enough of the basic ideas that you can feel like you might be able to start writing your own program. Come up with a project, a program that you’d like to create and use, and try to implement it. When you get stuck, look for tutorials, examples, code snippets, answers, whatever you can find that addresses your issue or similar issues, and figure out how to start moving forward again. If you do use other people’s code, make every effort to understand it - even if that means going back to it several times as your skills improve. If you are going to be delivering it to a client, you’d better understand how it works or it is bound to come back and bite you.Test and debug your code. Find more experienced developers to review your code and incorporate their feedback - which may be go back to the drawing board and start over because your code just doesn’t measure up.Let friends and family try your program and incorporate their feedback; add new features, modify existing ones. Again, you may have to start over.What I’ve described here is the equivalent of the development cycle for a product. To make money at programming, especially from home, you’re going to need to be able to do it all. Plus sell yourself and your abilities to others.

Simple C++ Money Program?

I have built this money program in C++ that is supposed to figure out how much money is left on a loan. Unfortunately, I can't get it to compile. Can someone help? Thanks. Here's my source code:

For the main document main.cpp:

#include
#include
#include "money.h"

using namespace std;
using namespace SVH.Money;

int main()
{
int loan;
int payperyear;
int payperpayment;
int apr;
int years;
cout << "Enter your loan amount: ";
cin >> loan;
cout << "\n";
cout << "Enter the number of payments a year: ";
cin >> payperyear;
cout << "\n";
cout << "Enter the amount you pay every payment: ";
cin >> payperpayment;
cout << "\n";
cout << "Enter your APR: ";
cin >> apr;
cout << "\n";
cout << "Enter the number of years you have payed for it: ";
cin >> years;
system("cls");
int money = LoanBalance (loan, payperyear, payperpayment, apr, years);
cout << "The money you still owe is ";
cout << money << ".\n";
system("PAUSE");
return 0;
}

For the header file money.h:

//Created by me
//Convenient Money Equations

namespace SVH.Money
{
int CInterest (int Deposit, int Rate, int TInterestCompounded, int YearsInvested)
{
//Equation from http://math2.org/math/general/interest.h...
int FutureValue;
FutureValue = Deposit*(1 + Rate/TInterestCompounded)^(Rate*YearsInv...
return FutureValue;
}

int LoanBalance (int Loan, int PaymentsPerYear, int PaidPerPayment, int APR, int Years)
{
//Equation from http://math2.org/math/general/interest.h...
int Balance;
int TempVal = SVH.Money.CInterest (Loan, APR, PaymentsPerYear, Years);
int TempValTwo = (1+APR/PaymentsPerYear);
Balance = TempVal-PaidPerPayment*(TempValTwo^(Paym...
return Balance;
}
}

Java programmers ! Simple help?

class a{public static void main(String[]b){float c=1000;while(c<9969){float e=(c*0.065f);System.out.print("\nCurrent balance: "+c+"\nInterest: "+e+"\nDeposit: 100\nNew balance: "+(c+=100+e));}}}



The above 194-character solution compiles and runs without errors on my machine. I can't think of any obvious way to make the source code smaller, other than reducing the length of the string literals. Note that I can't guarantee that the CLASS file will be as small as possible, I'm only measuring the length of the source code.

How much programming can I learn in one year studying 1-2 hours a day on average?

I honestly don't understand the answer that says "a lot".To me, the answer is easy: Zero.You learn zero programming by study. It's not the Cyrillic alphabet. It's not the resistor colour code. It's not the Lord's Prayer.There's very little to study in this field, which is why so many of us (myself included) like it so much. I took up programming because I hated studying.Now, if you replace "studying" with "programming", then it's a different story. The answer in that case, of course, is "about eight".I'm joking -- there's no way to measure programming knowledge that can answer to a "how much" question. But if you program every day for a year, there's pretty much no way you will not become a very respectable programmer.Also, if you can keep it up for a year, it means you're passionate about it, which is pretty much a prerequisite because it can get so damn frustrating. And, if you're passionate about it, you won't stop every day after sixty minutes, I guarantee that.

How many hours does a successful programmer code per day?

How about none.  Success sometimes has very little to do with the amount of code you write.  In fact I would argue that the majority of a programmers work exists outside of writing the code and actually planning what will be coded.  For every hour I spend planning it can be hours if not days taken away from 'coding'.  This is where architecture and engineering really come into play.  If you are a code monkey well then maybe writing endless hours of the same old code with the same ways of thinking will make you a success.However I rarely attribute my success to the amount of time I've spent - which by now is far past 10,000 hours.  (416.6~ days of my life - that's nothing!)  What I attribute my success to are the books that I've studied, the articles I've read, and the research I've performed before ever sitting down to write a single line.My approach is that of the classic masters which is to study and understand over knowing and doing.  It is easy to know but difficult to understand.  Once you have understood put it into practice.Study how to be the best at the craft, put that study into practice, and then it won't matter if you spent 1 hour coding a day or 24 because your knowledge is there and you're capable of doing what you set out to do efficiently and effectively.Stating all of this - if you study and do not put what you have studied into action it will be all for naught.  However you should not go into any of this blind and believe that racking up hours at the keyboard will translate to your goals.

How long would it take an average programmer to write 1000 lines of code? For argument's sake, the lines of code make up a moderately advanced 2D game.

Moderate to advanced 2D game? If little thought goes into that I'd probably make 1000 lines in a day, but the game would still be far from complete - I'd probably end up with some 10k+ code over several weeks with a game that's not particularly good and very inefficient. Not to mention lots of that code would never actually get called and be totally wasted.If I take my time about it, and think things through properly, I could possibly get that game done in a week or two and could conceivably even use less lines than 1000 to do it. The game would also be a lot faster, more involving and less buggy than the 10's of 1000's of lined game.So ... even using your stated example shows that this question has no answer. Actually if both programs do the same thing, then the one with less code might have taken longer to write - simply because it's "more thoughtful code".It's what I refer to as "boilerplate vs idiomatic" (nonsensical if you take the "true" meanings of those words)  ... and seldom do you find that any program of reasonable complexity uses only the one or the other. You tend to have mixes of those types of code throughout for various reasons. Very many times I'd write some 100 line function one day only to go replace it with a 10-liner tomorrow because I thought about it and came up with a "much better way". So the usual tendency (especially if writing imperative code and even more especially in C-like languages) is actually to start off by writing a lot of lines (perhaps between 1000 to 3000 a day or even much more if any re-use is taken into account) then starting to actually reduce those lines in the following days by replacing them with much shorter versions.And if you then take testing and debugging into account that "lines of code" idea (even the convoluted nonsensical approximation above) is totally blown out of the water. Since just debugging could take many times longer than it took to actually write the code. Not to mention, this phase also applies lots of code changes - sometimes also reducing line count.So actually a much more "interesting" question might be: "How many lines of code do you remove/replace per day?"

What is the easiest mobile app programming language to learn for creating iOS applications?

If you want something easy, I’d suggest finding a new career path. Programming is an ever changing field that requires constant learning and adaptation to new languages and technologies.However, if you are willing to put in the time and effort, I think your best bet is going to be learning Swift. Swift is the native iOS programming language that Apple has created for use with iOS devices. I hesitate to say it’s the “easiest” because programming is not really an easy thing to get a hold of, not to mention that ‘easy’ can be subjective. That being said, if you are already programming in other languages, Swift will probably be easier to adapt to as it has become much simpler than its predecessor – Objective-C. X-code is also a great IDE to use when programming in Swift.As others have mentioned, you could learn Java, PHP, or some other language but I think you will find much more difficulty in adapting those programs to work as seamlessly on iOS devices. Apple created Swift and X-code as an environment to create apps for their devices so naturally they work very well together. Granted you cannot take your knowledge of Swift over to android or other platforms like you can Java but if you want to work in iOS there is nothing better.Another thing to note, Swift programmer salaries tend to trend a little higher than that of other languages. See the difference below:Java Salary in United States– $89.1k/yearSwift Salary in United States– $93.6k/yearThese salaries were pulled from YouWorth. YouWorth is a free mobile app for both iOS and Android that tracks programmer salary data. Not only am I a champion for the product, but I use it myself. The app allows anyone to import LinkedIn skills and track their job market value over time. I'm also notified if there is a change in the skills being watched.

TRENDING NEWS