TRENDING NEWS

POPULAR NEWS

I Have $1000 To Spend For School What Should I Get That Helps Me And Other Students In Programming

Help writing program to find the 1000th prime number(Python code)(beginner experience)?

So I've been taking MIT opencourseware for computer science as I know nothing about computer science and programming though want to as a possible college option. I've come to the 2nd problem set assignment and it wants me to write a program to find the 1000th prime number(using what I've learned about control flow and iteration *still hazy on those terms*). I finally managed to figure out writing a program to figure out if a number is prime but am still lost on how to FIND a prime number using what I know. And from what I've looked up, all the coding is either more advanced than I KNOW at this point or is put in different words and keywords I don't quite understand. So I was hoping someone could help me by guiding me through this using basic coding language that is relatable/alike to the variables and keywords I am using and know, as I will show underneath here, and help me figure out what to do by learning what I want to do in plain english first and then translating that into code. Go easy on me, computer programming feels like going from algebra 1 straight into calculus so far. Anyways, heres my code for computing if a number is prime:
x=7
x*=1.0
prime=True
for d in range(2,int(x)):
....if x/d==int(x/d):
......prime=False
if prime==False:
....print x, "is composite"
else:
.... print x, "is prime"

I need help with Java prgraming?

I'm taking a basic java programming class in school. I'm forced to take it for my degree even though I will never use programming in the real world. That aside, I need to know of a website where I can type in what I'm trying to do and find the best possible answer in java programming. The problem I have right now is on an out of class practice assignment. I won't see my teacher until after the practice assignment is due. The Program is a multiplier, that reads a four digit positive integer from the user and prints out the product of its digits. Example: Enter an integer between 1000 and 9999: user enters 3421.

The output should be: The product of the digits of 3421 is 3 * 4 * 2 * 1 which equals 24.

I am using Netbeans IDE 7.3.1 to write the program.
Here is what I have written so far.

import java.util.Scanner;

public class Multiplier {


public static void main(String[] args) {

int a, b, c, d, total;
Scanner scan = new Scanner (System.in);

System.out.print ("Please enter a integer between 1000 and 9999"
+ " (ie:1234): ");

a = scan.nextInt(1);
b = scan.nextInt(2);
c = scan.nextInt(3);
d = scan.nextInt(4);

total = (a)*(b)*(c)*(d);

System.out.println("The product of the digits of: " + (a) + (b) + (c)
+ (d) + " is " + total);
}

}


Here is the error message I get when I run the program.

Please enter a integer between 1000 and 9999 (ie:1234): 2 4 5 6
Exception in thread "main" java.util.InputMismatchException: radix 1 less than Character.MIN_RADIX
at java.util.Scanner.nextInt(Scanner.java:2...
at Multiplier.main(Multiplier.java:28)
Java Result: 1
BUILD SUCCESSFUL (total time: 7 seconds)


Thanks for your guidance. I have more work to do that is why I'm looking for a site to help a person who doesn't think like a program learn to program.

C++ programming problem? serious help!?

A high school has 1000 students and 1000 lockers, one locker for each
student. On the first day of school, the principal plays the following game:
She asks the first student to go and open all the lockers. She then asks the
second student to go and close all the even-numbered lockers. The third
student is asked to check every third locker. If it is open, the student closes
it; if it is closed, the student opens it. The fourth student is asked to check
every fourth locker. If it is open, the student closes it; if it is closed, the
student opens it. The remaining students continue this game. In general, the
nth student checks every nth locker. If the locker is open, the student closes
it; if it is closed, the student opens it. After all the students have taken their
turn, some of the lockers are open and some are closed. Write a program
that prompts the user to enter the number of lockers in a school. After the
game is over, the program outputs the number of lockers that are opened.
Test run your program for the following inputs: 1000, 5000, 10000. Do
you see any pattern developing?
(Hint: Consider locker number 100. This locker is visited by student
numbers 1, 2, 4, 5, 10, 20, 25, 50, and 100. These are the positive divisors
of 100. Similarly, locker number 30 is visited by student numbers 1, 2, 3, 5,
6, 10, 15, and 30. Notice that if the number of positive divisors of a locker
number is odd, then at the end of the game, the locker is opened. If the
number of positive divisors of a locker number is even, then at the end of
the game, the locker is closed.)

Linear Programming - in major need of help!?

first define your variables
let x = number of buses
let y = number of vans

Minimize
z = 1100x + 80y

subject to:
x, y >= 0
72x + 9y >= 720
7x + y <= 77

graph your lines, shade your solution sets, find the corner points of the feasible region. Substitute the corner points (x, y) in your Minimize equation of 1100x + 80y
the corner point with the least amount is your solution

(10, 0) = $11,000 for 720 students, 70 adults
(11, 0) = $12,100 for 792 students, 77 adults
(3, 56) = $7,780 for 720 students and 77 adults

3 buses
56 vans
for $7,780

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.

A few thoughts on this.  The Mythical Man-Month and the COCOMO estimating system were both based on the idea that in a large, involved project--the kind that takes five years--the productivity is about 10 lines of code per engineer per day.  Everybody thought that was an absurdly low number, but when they crunched the statistics, it's 8 to 12 per day and there it is, an average of 10.Now, when you're actually heads down programming you can approach much higher numbers, especially if you've got an editor like Emacs that you can practically program into being a secretary or junior programmer.  I guess without such helps I've done as many as 863 in one day (just a little bit OCD there).I'm curious as to why you're interested--is it from an estimating perspective before doing the work, or as a programmer performance measurement after the fact?Lines of code is a pretty poor measure compared to function points for estimating.  You are the most productive using the highest level language you can possibly use for the task, and it makes many less lines to accomplish the same number of function points in a sufficiently high level language.As a measure of programmer performance, I recall a great story about Apple implementing "lines of code" as a measurement of productivity during the development of the Lisa.  They gave the programmers a form to fill out to indicate how many lines of code they had written that week.  Bill Atkinson had performed optimizations on QuickDraw that saved about 2000 lines of code, so he submitted the form with "-2000."Here is a diagram indicating how higher level languages accomplish more function points with less lines of code.  The languages are all pretty old here but this is even more true today.

PLEASE HELP I HAVE SCHOOL IN 15 MINS (MATH INEQUALITIES)?

I DONT KNOW HOW TO MAKE THREE INEQUALITIES OF THIS WORD PROBLEM PLEEEASEE HEEELLLPPP I HAVE SCHOOL IN 15 mins

A travel agent has to fly 1000 people and 35,000 kg or baggage from Hong Kong to shanghai. Two types of aircraft are available: A which takes 100 people and 2000kg or baggage or B which takes 60 people and 3000kg of baggage. He can use no more than 60 aircrafts altogether. Write down three inequalities which must be satisfied if he uses x of A and y of B.

How long would it take an average person with no programming background to become a full-stack developer? I want to be proficient in both the front-end and back-end technologies. I have a very basic understanding of HTML, and I'm learning CSS.

From almost  zero , within 6 months of starting learning JAVA, I made this app : Wow Music Player (Audio) - Android Apps on Google Play.It could have been only 3-4 months if I would be working only on this app. Also I am working on back-end( on Pyramid framework which is based on python) in my start up : School management made easy  (ERP site : Sign in - Edufits ).So the short answer is  : in 6-8 months, you can be a decent developer (with skill set 4 to 6/10 in selected platform and languages). This is enough to get you a good job. It'll take another 1-2yrs (I am guessing, looking at my friends) to become a really good developer (skill set 7-8/10). Thereon journey is never-ending with gradual increase and shifts.Now a brief summary of my journey :I am B.Arch  pass out and had no (except basic html and little C++ of schooldays) programming knowledge till Jan '15.I started learning JAVA and learned it for 1 month(basic ). Then in Feb and March, I interned in a startup as android developer and started learning android. I started making music player app as learning project. Stack overflow remained my ultimate guide. I also kept learning JAVA concepts as and when required (basic algorithms and data structure).From May onwards , We  (me and friends ) started preparing an ERP software for schools/ education institutions. I worked on server-end (under complete guidance of my friend) for 2 months.Now I have started working on app development of for our ERP( not working on backend anymore). Also now I am handling sales of our product (basically I am learning it, as all three of us don't have such background)So given 9-10 hrs/day, I think 6 months is a decent time to learn anything upto a decent level (including programming).cheers!

Is it a requirement to have a high school diploma or GED to get a grant?

Or does it just depend on the what grant you need? I'm going to need an agriculture grant and I was just wondering if you need a GED or high school diploma to apply for one. Don't tell me to google it because I have 1000 times and it doesn't tell you anything. I'm kinda sure you don't because I know some farmers who there is no way they have a GED nor a high school diploma.

Thank you so much!

TRENDING NEWS