Questions requesting help with school homework. This tag lets potential answerers know that they should GUIDE the student in solving the problem, rather than showing a complete solution. CAUTION: Before posting, consider that classmates may be tempted to reuse code from your post. (Read the tag wiki....
8
votes
6answers
4k views
Sum of all primes under 2 million
I have this assignment to write the optimized space and time code for finding the sum of all primes under 2 million. I'm using the following function to check if each number is prime:
...
8
votes
1answer
606 views
Java application for finding permutations efficiently
I am an eighth grader with a school project of creating and application in Java that returns the total permutations of two given numbers. It needs to be light and efficient, for later deployment on a ...
23
votes
3answers
4k views
Is it Friday yet?
This is the first program that I have written in my C++ saga that I actually think is useful. The description for this assignment is kinda long and mundane though:
Write a program that inputs a ...
10
votes
1answer
34k views
Java multi-thread file server and client
My task was to build a multi-thread file server and a client that can upload or download a named file over sockets. It is assumed that the client will finish after its operation and there is no need ...
3
votes
1answer
12k views
Bank ATM program in Python
For homework, I have to code a program in Python that effectively simulates a bank ATM.
...
15
votes
2answers
949 views
Is this C++ quicksort program okay?
I wrote a quicksort program in C++.
Is it okay to implement it this way?
Am I using pointers correctly?
Is my style okay?
Any ideas to speed it up or save memory?
...
8
votes
2answers
306 views
Scoring and grading answers against an answer key
This is for a university assignment (don't worry the code is in working order), and while I could hand it in as-is and receive full marks I feel like there is probably a more efficient and better way ...
20
votes
5answers
2k views
Reading and writing data for Caesar cipher
I am struggling with commenting and variable naming. My teacher says my comments need to be more explanatory and explicit. He says my variable names are also sometimes confusing. I was just wondering ...
12
votes
6answers
13k views
Does my Rock Paper Scissors game look good?
I'm doing some homework and am just curious if everything I've done looks good and/or if you'd suggest I modify something to keep with "javaese."
...
6
votes
4answers
823 views
Converting an integer into the written form
For my homework assignment I have to create a class which converts an integer between 0 and 9999 into the written form. For example, 713 would be written as "seven ...
10
votes
2answers
1k views
Guess a random number between a selected interval
My project for my class is to create a Java-based game where the user must enter a number between 1-20 and a number between 250 and 300. The computer randomly chooses a number between those 2 numbers. ...
8
votes
1answer
108 views
I think my Bridge's foundation is too fragile
I've just started a new class learning Java, and since it's been a long time since I've programmed in it I thought I'd put up my first project to get back in the swing of things. Here is my first ...
6
votes
3answers
821 views
Geometry Calculations - Cube, Sphere, and Tetrahedron
This is the first code I've written. It's for an intro to Java course. Could you look over it and let me know of things I could improve before handing it in?
For reference, I've also provided what I'...
6
votes
3answers
804 views
Optimizing this Knight's Tour
My assignment in CS was to make a knight's tour application that could solve the problem from any starting position. I had just finished the code so excuse the lack of deeply descriptive comments. My ...
6
votes
2answers
138 views
Moving across my (sturdier?) Bridge
Building on top of the classes in this question of mine, I've made this class to support the moving of the entities for my given assignment:
Welcome to the Bridge Crossing Problem. Person Pn can ...
3
votes
2answers
876 views
Print largest two integers from a stream
I'm writing a program for my intro to comp sci course where I'm supposed to prompt the user to enter a stream of integers, and then return the largest two. We were given the hint to use a scanner and ...
1
vote
2answers
392 views
UPenn CIS 194 Homework 1: Validating credit card numbers
I am working through UPenn CIS 194: Introduction to Haskell (Spring 2013). Since I am not able to take the course for real I am asking for CR (feedback) as it could be from teacher in that course.
...