Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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

2
votes
1answer
53 views

Finding recessions in US GDP data using pandas

For an assignment, I am identifying the first quarter of the 2008 recession in the United States. The Excel data I'm using can be downloaded here: gdplev.xls. How can I improve this pandas code to ...
0
votes
1answer
56 views

Adding <li> items dynamically to a to-do list

For a homework assignment, I have to create a "TO-DO" list, which will add a list item to the unordered list dynamically using JavaScript. The input element is also added using JavaScript, having to ...
0
votes
2answers
52 views

JavaScript DOM Implementation

I'm supposed to create a website that adds multiple forms to the page, is responsive and checks if the inputs are valid (validation is not important, just needs to show some attempt at regex). Below ...
1
vote
2answers
86 views

Calculating the minimum and maximum of a byte array [closed]

I've been working with binary files with this last assignment and part of it was to determine the maximum and minimum byte. Initially this was 2 functions but a bonus portion was to make them into 1 ...
8
votes
1answer
76 views

My malloc() in C using mmap()

My latest school project was to implement malloc(), free(), realloc() and ...
4
votes
1answer
61 views

Drawing consecutive rectangles with an algorithm

I have an assignment to draw rectangles that get larger and larger each time I draw them. Just like shown below. I've labeled them TL = Top Left, TR = Top Right, BL = Bottom Left, BR = Bottom Right. ...
1
vote
1answer
49 views

Keypress output to screen

For a school project, I had to make a keylistener that would output whatever you typed to the screen. A JFrame would be initialized to have the focus required for the listener to work. It uses delete ...
3
votes
1answer
66 views

Maze navigator AI

I developed a maze navigator in Java for a project for my school. It works fine, and it gets through the maze just fine. The program prints to the screen each time it loops through the maze to set the ...
2
votes
1answer
56 views

Looping through file finding sequences

For an assignment, I had to loop through a text file, and report any positions that a user entered sequence was found. Is there any way I can make this code more efficient, because it seems like I'm ...
1
vote
1answer
55 views

Draw checker board

For an assignment, I had to draw a checkers board, with blue and red checkers, in python. What I have works, but I'm wondering if there's a more elegant and/or efficient way to accomplish this feat? ...
5
votes
2answers
474 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 ...
2
votes
2answers
85 views

Calculating tips

I am enrolled in an online JavaScript course and one of our coding challenges was presented as follows: John and his family went on a holiday and went to 3 different restaurants. The bills were $...
3
votes
2answers
135 views

Simple C# calculator

I'm doing a simple calc for my school. The code looks okay to me, but I'm not sure if there is something to improve, but probably there is always something to improve. Any ideas how to make it look ...
4
votes
2answers
141 views

General Knowledge quiz

I have made a General Knowledge quiz in python as a project from my school ...
5
votes
2answers
367 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 ...
1
vote
1answer
101 views

Python 3.6 Dice Histogram: Using random.seed effectively

I am not 100% sure that I am using the random.seed correctly for this assignment, or if there is a more efficient way to write the code. Any feedback is appreciated. Assignment Description: Simulate ...
1
vote
2answers
205 views

Quiz programme for GCSE

I made a quiz programme for my GCSE Computer Science NEA. I just want to make sure it is OK to submit. There are also 5 files: Usernames, Passwords, Song Names, Artist Names and High Scores. Any ...
-1
votes
1answer
130 views

Compound interest calculator homework [closed]

I am a beginner at coding Java and am having a tough time understanding what is wrong with this code. This is an assignment I had posted about earlier and I also went to a Java tutor at my school for ...
2
votes
2answers
65 views

Simple console based car array

I have recently started coding in Java and I had to do this assignment in college. Develop a menu driven application called TestCarPartc that allows the user to ...
2
votes
2answers
92 views

Integer to Roman Numerals (1 - 2999)

This is a homework assignment. Convert an integer (1 - 2999) to roman numerals. I was wondering if I could make my code more efficient. The way I have it set up is that I take the digits of the input (...
3
votes
1answer
82 views

Given a list of words, remove the shorter word of every pair

This is not a "please do my homework" question. I solved a problem two ways and would like to know which solution is better; better being defined by better readability, lower complexity and lower ...
0
votes
1answer
125 views

Yet another vending machine

I recently got a homework assignment from my C++ teacher. The verbatim assignment was this: Write a program that simulates a vending machine. A customer selects and item for purchase and inserts a ...
0
votes
1answer
43 views

Collate a growing number of String arrays and search through them [closed]

These string arrays are used to classify whether the incoming feed/message is a driver feed or team feed. ...
15
votes
2answers
1k views

Dungeon Crawl game for the terminal

I am learning C++ and I attempted to do one exercise I found: Dungeon Crawl. The goal of this game is to reach the treasure by moving your character along the board. The exercise asks not to use ...
3
votes
1answer
59 views

Dividing an arbitrary dollar amount into the fewest bills and coins

I am taking a class in mobile application development this fall. I have finished my first assignment of creating a class to divide an arbitrary dollar amount into the minimum number of bills and coins....
1
vote
1answer
498 views

Count occurrences of a specific sequence in a list of many numbers [closed]

The script will work through each number from 0 - 10. aList=[3,5,... over 10k numbers ...,2,2,6] Let’s say, for example: ...
2
votes
0answers
45 views

Regression on Pandas DataFrame

I am working on the following assignment and I am a bit lost: Build a regression model that will predict the rating score of each product based on attributes which correspond to some very common ...
0
votes
0answers
35 views

Nested cross-validation

This is a homework assignment to implement nested cross validation. It seems to work fine (sometimes). The imports are inside the class and some methods are static, because this code needs to be in ...
2
votes
1answer
849 views

Vehicle inventory program

First time posting here, let me apologize ahead of time if this is not the correct format.. Anyway, I am new to programming and I am working on a school assignment to design a vehicle inventory system ...
3
votes
2answers
640 views

Snake Game in C++ using OOP

I am currently a student and I have an assignment in my OOP C++ course where I need to create a snake game using these specific requirements. I added some features into snake to fit these requirements ...
6
votes
3answers
546 views

C++ code to read, sort, and write data

I had written code in C++ to create transformation filters to get input, sort (custom_sorting and existing sorting routine) and write the output to stdin and file. When I presented it to my teacher, ...
7
votes
1answer
139 views

Avoid incoming meteors

I'm visiting a functional programming course at my university which has a small project for examination. The language we are using is clojure and the contents of the lecture have mostly been about it'...
6
votes
2answers
593 views

Generate array with random numbers and search for an element in it

This is a school project I've written. It works, but I feel it could be done better. The program generate an array of 1'000 random numbers, and searches for a number typed into console, and displays ...
3
votes
2answers
87 views

Stack implementation in C

I have to solve an exercise from ANSI C book: Add the commands to print the top elements of the stack without popping, to duplicate it, and to swap the top two elements. Add a command to clear ...
0
votes
2answers
106 views

Secret hangman homework

Recently I was given homework to make a hangman game, where I wrote the below. How can I refactor this to use classes? ...
4
votes
2answers
97 views

K&R C book - exercise 3.3

I have an exercise in my ANSI C book: 3.3. Write a function expand(s1,s2) that expands shorthand notations like a-z in the ...
0
votes
1answer
103 views

Java exercise: String processing and type conversion

The exercise is from a Java-course in which I'm enrolled. The classes Book and APIResponseParser were provided by the instructor. For Book I had to add just a few getter- and setter-methods. For ...
1
vote
2answers
660 views

GPA calculator, implemented for a course

This is from a Java course which I'm taking. The class StudentUtil, including method-declarations and comments, was provided by the instructor. I just had to finish ...
7
votes
3answers
2k views

Convert binary string to decimal number

I'm finishing the book C Primer Plus by Stephen Prata and I wrote as a part of the homework program to convert binary string to decimal number: ...
7
votes
1answer
105 views

Multi-layer perceptron program is super slow

I'm writing a multi-layer perceptron from scratch and I think it's way slower than it should be. the culprit seems to be my compute_gradients-function, which ...
4
votes
2answers
591 views

Calculate with fractions

This program is a solution to homework given by our professor. So I want my program to be the most beautiful program ever written. Therefore I want to know where I could improve the quality of the ...
6
votes
4answers
413 views

Spell-checking application in C++

This is my current coursework for university where I am to write a spell checking application and compile using C++11. I have a dictionary file that is read into the program automatically and stored ...
1
vote
0answers
145 views

java - A* search algorithm

I'm having trouble with my homework implementing A* search algorithm in java, I'm given the graph, origin and destination, I had to follow some specific tasks in the homework so the code might be a ...
3
votes
1answer
99 views
3
votes
2answers
135 views

Checking for win on a wrap-around Connect 6 board

I have a method, that checks win conditions on a "Torus" board, which is a board without any borders. This means that if you place 4 diagonal stones on the top left, and 2 diagonal stones in the ...
1
vote
2answers
4k views

Circular Queue Implementation Using Array in java

Here is my code of Array Implementation of Queue in java. ...
2
votes
0answers
104 views

CIS 194 - UPenn Haskell Course (2013) - Homework 4 - Tree Folding

I have been self studying the UPenn Haskell course, and I am unable to get feedback/grading on the assignments complete. This specific portion that I am having concerns with asks to write a function <...
4
votes
1answer
628 views

Guess user number between 0 and 100 (Binary Search)

I am at the beginning of learning python and one of my homeworks (in chapter regarding loops) where to write a code that would guess user number between 1 - 100. I believe I used algorithm called ...
17
votes
3answers
4k views

Python code that sorts books

I am currently a student just starting to learn python and I need help improving my code for a school assignment. I've already written the code for the program, just need suggestions on how to improve ...
7
votes
3answers
99 views

Splitting a rectangular chocolate bar

I'm having trouble with my school homework. I have a chocolate bar that consists of either black, white or black&white (mixed) squares. I'm supposed to divide it in two groups, one that has only ...