Questions tagged [homework]

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.)

Filter by
Sorted by
Tagged with
6
votes
2answers
8k views

Phone Book Program in C++

I am starting out a school project to build a phone book program in C++. It stores contacts in a linked list. This currently does not have all the validations I would like to implement, and is all in ...
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: ...
27
votes
4answers
6k 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 ...
8
votes
1answer
746 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 ...
6
votes
2answers
1k views

2 player dice game, where even total gains points and odd total loses points NEA task computer science

This is a game for two users who roll 2 dice 5 times. If the total of dice is even the player gains 10 points if it is odd, they lose 5. If there it is a draw after five rounds then the both users ...
4
votes
2answers
571 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. ...
10
votes
1answer
48k 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 ...
6
votes
1answer
51k 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
1k 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? ...
10
votes
2answers
399 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 ...
6
votes
2answers
3k views

Two-player dice game for NEA task computer science (Updated)

This is a game for two users who roll 2 dice 5 times. If the total of dice is even the player gains 10 points; if it is odd, they lose 5. If there is a draw after five rounds then both users will ...
22
votes
5answers
4k 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
16k 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
1k 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 ...
3
votes
1answer
74 views

Get all possible subsets from a set of distinct integers using OOP

An assignment at school required me to write a program for this task: Create a class and define two methods in the class. Method ...
11
votes
1answer
383 views

Vector implementation, which received unhelpful negative feedback from professor

I've just finished a homework assignment to implement a simple Vector class. -Kindly ignore the following two paragraphs if you don't want to read someone whining about their professor Yadda, yadda,...
10
votes
2answers
2k 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
125 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 ...
7
votes
2answers
164 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 ...
6
votes
3answers
2k 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
1k 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 ...
5
votes
2answers
111 views

C++ linked list iterator implementation

I'm a first year computer engineering student and would appreciate feedback on some code. I've created a linked-list with an iterator to be able to range for loops like: ...
3
votes
2answers
954 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 ...
2
votes
1answer
41 views

Variables, references and pointers - Write the function zero (…) so that the following code works correctly

I have following homework exercise from lecture "Variables, references and pointers": Write the function zero (...) so that the following code works correctly: int x = 3; zero(x); ...