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
7
votes
1answer
2k views

Producer Consumer in C

I'm doing multithreading at university and we've been asked to implement the producer consumer problem in C. My code compiles and produces the right result. From debugging it, it seems to be waiting ...
2
votes
2answers
1k views

Booking system for shows

Kindly accept my apologies as Java is something my mind cannot digest no matter what I do. At the moment I have an assignment and have written a piece of code and have used Constructor (I think so) ...
3
votes
2answers
1k views

TCP client and server supporting six simple commands

For a class, I was given an assignment to code a simple TCP connection between a server and a client. Once the TCP handshake is done, the client sends inquiries to the server. It's a 2 second ...
6
votes
1answer
2k views

8086/DOS assembly keyboard I=input, data loss in registers

I am working on a project for class, and it works as required by the rubric, though I am wondering if there is a slightly better way to implement a few things. I was docked a few points for an ...
2
votes
1answer
7k views

DFS and BFS search for 8-puzzle

I implemented the DFS and BFS. Please offer improvements. ...
7
votes
3answers
488 views

Prolog parser written in Haskell

I am writing a very simple Prolog intepreter in Haskell. It's a class assignment and I really want to do it right. I was able to (quite quickly) write a parser for the language. Today I borrowed a ...
3
votes
1answer
739 views

“Destroy the Asteroid” Game

I made this game for my computer science class. Here is my professor's requirements: Write a Processing program that draws a triangle in the middle of the window. Rotate the triangle when ...
2
votes
0answers
3k views

Roman numeral converter project

I have a project that is due for my Intro to Java course which requires me to translate the number range of 1 - 3999 into Roman numeral form. If the number I pick is 0 it will end my program, anything ...
4
votes
4answers
9k views

Morse code translator in C#

I'm writing a Morse code translator for homework in C#. It takes an input from the user and returns the Morse code version of their input. I understand that this code may look horrible, so how could I ...
2
votes
2answers
145 views

My spaceship is slow to explode after being hit by the asteroid

I am making a game for my computer science class. My professor's requirements are: Write a Processing program that draws a triangle in the middle of the window. Rotate the triangle when the left and ...
2
votes
3answers
159 views

Mortgage calculator for homework

I needed to create a mortgage calculator for an intro to CS class. As part of the assignment, with an interest rate of 6% needs to change to 7% after 3 years hence that ...
7
votes
3answers
10k views

Creating a chess board

One of my assignments was to create a chessboard. In this assignment I could not use an array, or a form of list or what not. Below is my code for the creation of the chessboard: ...
2
votes
1answer
495 views

Sampling with weighted probabilities

In an exam question I need to output some numbers self.random_nums with a certain probability self.probabilities: I have ...
-3
votes
2answers
2k views

Display calendar using a loop

Desired output: Can I get an shorter version of this code? My instructor just wants me to figure it out my self. ...
2
votes
2answers
640 views

Extracting price statistics from a CSV file

I got the following task to solve: ...
5
votes
2answers
215 views

“I'm Listening”

For this next assignment, my job was to create a GUI with a button that changes text and color when clicked, and a slider that updates a label (with a TitledBorder) ...
1
vote
2answers
11k views

Tic-Tac-Toe game in JavaScript/HTML/CSS

I need help with a question my teacher wants us to do by tomorrow. I would love for you to try to help me out with this. The following functions must be implemented: A function that initializes all ...
2
votes
1answer
734 views

Functional Scrabble Word Score

Homework: Write a function to score a scrabble word. values is a global dict formatted as values = {'a': 1, 'b': 3,...} The ...
13
votes
5answers
4k views

Enter my Matrix

Here is my next Java assignment: create a Matrix class that can add and multiply two matrices together. I was given some code as a skeleton and then fleshed it out ...
6
votes
3answers
672 views

Loading tab-separated tweet data into an array

I'm working on this school project and was wondering if there was any way of storing this information better, faster, more professionally. I'm also restricted to only using an array; don't ask me we ...
5
votes
2answers
791 views

Reverse an integer, find the absolute difference, then reverse again

For one of my university assignments, we were asked to take an unsigned int, reverse its digits, find the absolute difference between the original and reversed, ...
8
votes
2answers
708 views

Bridge, We've Got a Problemo

Now that we can move across the bridge, it's time to finally set up the problem so that it can be solved. A reminder of what the assignment is: Welcome to the Bridge Crossing Problem. Person Pn ...
4
votes
1answer
569 views

Displaying a randomly sized array as a table

This program creates an integer array with a random size of 5-50 elements (inclusive). It then fills the array with random numbers between 0 - 100 (inclusive). The interesting part comes when I then ...
7
votes
2answers
159 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 ...
18
votes
7answers
4k views

Sudoku solution without the use of classes

A Sudoku puzzle is a 9 × 9 grid with some numbers between 1 and 9 in it, that has to be filled in so that every row, every column, and each of the nine 3 × 3 blocks contain all ...
8
votes
1answer
124 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 ...
2
votes
3answers
1k views

Interplanetary weight calculator

I have been using this site for a couple of years for great answers and a ton of help. I wrote this program for my class project due 1/23. I am just wondering what you would recommend me changing or ...
7
votes
3answers
10k views

Check if 2 arrays have (exactly) the same elements recursively

I've been given a homework assignment to make a function to check whether 2 given arrays with the same given size have exactly the same set of elements. My function seems to be working but I feel ...
30
votes
6answers
3k views

To 'this' or not to 'this'?

I was given a homework and I have 2 solutions: one that uses this and other one that doesn't. I tested both solutions on jsPerf but sometimes it says the version ...
10
votes
2answers
394 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 ...
2
votes
3answers
33k views

Removing punctuation and lowercasing a string

I am very fresh to python. As part of an assignment, I've written the following code to remove punctuation from a string and convert it to lowercase. ...
1
vote
0answers
1k views

Dice rolling swipe Android app

So I've got an Android app where if you swipe in a particular direction (UP, DOWN, RIGHT, LEFT), the dice move in that direction using TranslateAnimation. This is ...
4
votes
2answers
784 views

DNA base pair match counter

So my code is done it outputs exactly what it needs to I'm just wondering if it is possible to make this code a lot more simple using objects. If so could someone tell me what I would need member-wise ...
2
votes
1answer
55 views

Printing polynomials

I am taking a class on ruby and our assignment is to take user input and print out a polynomial. Wondering if I can get any feedback to how to improve my code. ...
4
votes
2answers
13k views

Hexadecimal number to decimal conversion

I am a semi-beginner in C++ and I have a project in C++ to convert a hexadecimal integer into decimal equivalent, but I extended it and now this program can also convert a fractional part. Logic I ...
4
votes
1answer
604 views

Deitel Java exercise 6.30: Number-guessing game

I missed points for putting implementation in the driver class, rather than having the driver class only make call methods in other classes. I'm not sure how to move the implementation outside of the ...
3
votes
3answers
2k views

State flowers and birds

This runs as is, but I'm looking for an alternative way to write it. ...
1
vote
1answer
403 views

UPenn CIS 194 Homework 4: Higher-order programming

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. ...
3
votes
1answer
346 views

UPenn CIS 194 Homework 3: Code golf

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. ...
4
votes
1answer
488 views

UPenn CIS 194 Homework 2: Log file parsing

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. ...
4
votes
2answers
567 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. ...
6
votes
2answers
1k views

2D array to draw a letter 'F'

This is my code to print letter 'F' with nested loop 2d array. Are there changes that could be made in it to make it look better or more efficient? ...
6
votes
2answers
3k views

Three-in-a-row board game

I don't truly understand how OOP works and It's stopping me from creating good programs! Below I have a program that will check to see if there are 3 tiles from a gridview in a row. Here's a ...
2
votes
3answers
660 views

Music collection with lyric songs and instrumental pieces

I have problems with dealing with derived classes that inherit from the same base class. I have 2 types of songs: Songs with lyrics that have: Title, Tags (sad, happy etc.), lyrics (one line), ...
1
vote
0answers
47 views

Removing JLabels by pressing JButtons which disable if in excess

The goal of this code is to move some JLabels from (JLabel[] pileone) off a JFrame when a ...
3
votes
2answers
525 views

IntArray implementation [closed]

I need to write an IntArray implementation for college. I'm wondering if my code could be better and if it is efficient. In the header file are the methods listed ...
4
votes
1answer
132 views

GUI SQL interface for select insert and remove

This is my final project for my second Java class! I would like to get some feedback on it to see where and what I can improve. There are five class files: ...
-5
votes
1answer
3k views

Prompting the user for a product number and quantity [closed]

Write a Java application that prompts the user for pairs of inputs of a product number (1,2,3,4,5) and quantity of units sold (any integer)? Use a switch ...
-2
votes
2answers
647 views

Manipulating strings and character positions

Write a program that manipulates two strings. The program inputs two strings (string1 and string2) and a character (...
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'...