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
3
votes
2answers
603 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
301 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 ...
6
votes
2answers
948 views

General Knowledge quiz

I have made a General Knowledge quiz in python as a project from my school ...
6
votes
2answers
3k 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
934 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 ...
5
votes
2answers
10k 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
793 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
685 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
227 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
197 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 ...
1
vote
1answer
425 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
47 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. ...
22
votes
2answers
3k 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
92 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
2k 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
85 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
55 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
4k 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
5k 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
888 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
157 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
4k 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
209 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
129 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
289 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
398 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
3k 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 ...
8
votes
3answers
7k 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: ...
8
votes
1answer
188 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
3k 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
3k 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
406 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
265 views

“Code Breaker” in JavaScript

...
2
votes
2answers
178 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 ...
3
votes
2answers
11k views

Circular Queue Implementation Using Array in java

Here is my code of Array Implementation of Queue in java. ...
2
votes
0answers
167 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 <...
5
votes
2answers
3k 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
5k 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
199 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 ...
6
votes
2answers
590 views

C code, rewritten to use a Person struct without pointers

I'm new to C and I have been assigned the task of converting some code that uses structs with pointers to code that doesn't use pointers. I would be interested to know if the code I have written is '...
2
votes
2answers
108 views

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

I have following homework exercise from lecture "Variables, references and pointers": Write the function set (...) so that the following code works correctly: ...
2
votes
1answer
93 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); ...
3
votes
1answer
2k views

Make a smart move in a connect-4 program

An assignment this past semester was to write functions such that the following C program would run: ...
3
votes
1answer
2k views

Optimizing Needleman-Wunsch algorithm in Java

For a class assignment, I was required to implement the Needleman-Wunsch algorithm in Java. I have already completed the assignment but I was wondering if there were any algorithmic (or even syntactic)...
2
votes
2answers
1k views

Phone Book Program in C++ - Final Follow Up

I hope I am not going against any rules on this site. This is my last follow up question, and I believe I am ready to turn this code in. (It is a homework assignment and I am required to use linked ...
0
votes
2answers
1k views

Data structure to count occurrences of words

I have some code for a assignment where the main marks are awarded based on efficiency. The program uses a given wordgenerator which generates random words and adds them to a user-made data structure. ...
7
votes
2answers
1k views

Simple Battleship written in Python

I would appreciate feedback on my first Battleship game written in Python for my intro to programming class. Here is the code, the only thing in here is that I use a clear screen function from one of ...
3
votes
1answer
1k views

Phone Book Program in C++ - Follow Up

This is a follow up to this question. I have taken the suggestions given to me and implemented them in my code, as well as moving towards adding more features to the program. I am unfortunately ...
3
votes
1answer
1k views

Singly linked list for a marble game

I have an assignment in programming using Java, which is about a marble game. When you're entering a marble the marble has a color and a value. When there's 4 of the same color in a row it will be "...
6
votes
2answers
16k 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 ...

1 2
3
4 5
11