The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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
2
votes
2answers
352 views

Instantiate and display a ClassifiedAd

Create an application named TestNewspaperAd that instantiates and displays a ClassifiedAd object. A ...
4
votes
1answer
65 views

Swing UI for a Virtual LaunchPad

I'm currently coding for a school project. I'm planning on creating a virtual and simple Launchpad. Here's the first part of my code which treats the graphical interface. I know it's not well ...
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,...
1
vote
2answers
1k views

Program that reads a string from the keyboard and tests whether it contains a valid date

I know this task could be done in more practical ways, but the professor only want us to solve it with the "if" statement. I tested and it meets the condition for each task, but I still feel this code ...
8
votes
3answers
11k views

Python class to implement a list with a size limit

I am currently working through a python course about objected oriented programming. I was given this first assignment to work on: Create a simple class, MaxSizeList, that acts a little bit like a ...
3
votes
1answer
226 views

Student project that calculates the return on an investment

This is a simple student project that calculates the return on an investment with a given investment amount, number of years invested, and annual interest rate. I know this is pretty basic, but I'm ...
5
votes
1answer
2k views

Connect Four class project

I am in a computer coding class and we have to make a project for Java. Is there any way we can better our existing connect four code? ...
5
votes
2answers
4k views

Adding two Integers in an Array

I was wondering if I could get a second look at my program before I turn it in. The job was to code a program in java that adds two integers to an array gather the sum while displaying the integers ...
1
vote
0answers
495 views

getDayOfTheWeek function, without using built-in date libraries

I have an assignment to create a method to retrieve the proper day of the week for any given date, without using the Java calendar. After countless hours of trying to implement the algorithm in the ...
6
votes
2answers
189 views

Denoise an image under extreme time pressure

I'm working on a real-time, embedded system image processing application for my group engineering capstone in undergrad. I'm receiving data at 60FPS, and have to isolate and detect the location of a ...
0
votes
1answer
214 views

Adding two extremely large numbers using a custom data structure

I have an implementation to add 2 extremely large numbers, greater than the ceiling provided by long, e.g. 1238913893838383813813813813838... I created a LinkedList ...
4
votes
1answer
4k views

Login program in Python

I wrote this login program as part of my project for school. Should I use my implementation of a login program, or is there some standardized patterns of login programs, like the ones in encryption ...
1
vote
5answers
371 views

Three Cards Monte game

I have written the following code for the Three Cards Monte game. It works as expected and returns the required output. However when I tried to turn it in to the teacher, he keeps saying its too ...
3
votes
2answers
651 views

Order line reversing (reversing line order)

I'm a student learning to code in C. I had to make a program for class to reverse lines of input from the keyboard (not character wise, but reverse the order of the lines input). The program is ...
3
votes
2answers
285 views

Finding perfect numbers

My teacher wants me to find all the perfect numbers between 2 and 1000 and must use: for loops % operator to determine if a ...
4
votes
1answer
5k views

Print all possible subsets of an array

I solved the problem to print all possible subsets of an array. I just want to know a better approach or anything different I could have done. Question: Print all possible subsets of an array. My ...
2
votes
1answer
88 views

How could I shorten my code in this old graded homework?

I have this old graded homework, I am looking how to improve the or shorten the code, I have some lines with over 200 chars. ...
7
votes
3answers
332 views

Homework / toy program - character matching

Given a string A = "Hello world" and another string B = "wor", I have to print ("TRUE" or "FALSE") whether the characters in <...
22
votes
5answers
10k views

Implementing realloc in C

I have an assignment to implement realloc in C, This's my code please review it. ...
10
votes
1answer
148 views

Game of 15 - A* search

I would be really thankful for review of this homework. I'm trying to write better code in terms of readability and design patterns. This program solves the classic 15 slider puzzle with A* search. ...
2
votes
1answer
82 views

The fastest “find”er of them all?

For part of a project, I was given this directive: The find command will use the directory (dirent) function calls, but will require you to start at a directory and then determine if a file is ...
5
votes
1answer
394 views

Search a file (simple grep clone)

For part of a project, I was given this directive: The grep command will take an exact string and an exact filename as the 2 arguments and you will need to search through the filename for the ...
6
votes
1answer
140 views

List directories (with information)

For part of a project, I was given this directive: The “ls” command will require you to use directory functions to list out what the filenames are in the directory. Functions required to make a ...
2
votes
2answers
1k views

Read in file, and then compute class mean, median, max, min, class averages & update file

The application is designed to read in class results of individual students from a single text file, and then manipulate the data to give information such as class mean, median, max, min, individual ...
3
votes
2answers
77 views

Information about a nightclub in semantic HTML

Could anybody have a look at my HTML code and tell if it's build upon the correct semantic way using the right tags, and not using unnecessary divs? I'm still not sure if there any divs in my code ...
4
votes
2answers
101 views

Red light, green light… kinda

For an assignment I had to create a client and a server that communicate over a well known FIFO. The server is required to use three threads to serve the client, managed by a semaphore. The code was ...
3
votes
3answers
656 views

Guess three random numbers in order

We were given a homework assignment to create a C++ program that generates 3 different random numbers each time and the user is supposed to guess the three of them AND in order. I already achieved ...
2
votes
1answer
3k views

Swapping the diagonals of a matrix [closed]

I am required to write a simple matrix program and swap the diagonal. Given the input 1 2 3 4 5 6 7 8 9 After swapping the diagonal it should be ...
4
votes
2answers
2k views

Console Ultimate Tic Tac Toe game

Last week I wrote a C++ program on Ultimate Tic Tac Toe. The issue was that the program was a bit lengthy (~230 lines) and it is needed to be around 150 lines. I absolutely am not asking you to go ...
1
vote
1answer
194 views

Some kind of encryption in C++

It's my university task. Can I get some opinions on it? ...
7
votes
3answers
1k views

Generating Pythagorean triples below an upper bound

I've got an assigment where I have to print all the Pythagorean triples smaller than a given n. Even though I could print them directly in ...
4
votes
2answers
2k views

Using C++ to check if string s is subsequence of string t

The problem I want to solve is very simple: Given a string s and a string t, check if s is subsequence of t. there is only lower case English letters in both s and t. t is potentially a very long (...
1
vote
1answer
549 views

Integer sum program

This is a little assignment I am working on. I am a beginner Java programmer and would love some advice on how to improve this code. For more context, here are the assignment details: Create a ...
4
votes
3answers
66 views

Burning logs - really simple text game

What I have I am a bit advanced PHP developer, but now I'm going to college where we are learning Ruby. We got the first homework and I did it. But I wanna make great code - so I looked for standards ...
3
votes
1answer
41 views

Filetype backup script

This was one of my assignments in which I had to create a backup script that will individually compress all files (of an arbitrary number) of file-types (indicated by their .extension). Example: <...
10
votes
2answers
254 views

mini-(Docker)-shell

I was given an assignment to write a mini-shell: To write your own shell, you will need to start with a C program that will prompt the user for input and accept in a number of arguments from a ...
8
votes
2answers
5k views

What's the optimal 'pythonic' way to make dot product of two lists of numbers?

I just filled in the first assignment on course which involves learning Python. The assignment was to make vector class which supports scalar multiplication through operator overloading. The ...
2
votes
3answers
976 views

Java Brute-Force Algorithms Homework

I'm taking an algorithms class this semester and this homework seemed pretty easy. Easy usually means something is wrong. Not always, though. Through testing, this application successfully answered ...
10
votes
1answer
440 views

Harry Potter's Family Tree Database

As an assignment for a class, I have made a small Harry Potter family tree in Prolog. It compiles into a self-contained executable that can be run straight from the command line on Linux machines. ...
1
vote
1answer
118 views

Logical contradiction type definitions

(Homework alert) Working my way through "The Haskell Road...", not sure about my solution to exercise 2.15 on page 48 of the second edition: A propositional contradiction is a formula that yields ...
7
votes
3answers
7k views

Using a greedy algorithm to find the best path in a 2D array

I'm a student and this is one of my assignments. My professor basically confirmed that my code is correct but all he grades on is if I finished the assignment correctly but not the coding style. I ...
3
votes
0answers
141 views

Movie Knowledgebase

I have had an assignment to construct a movie knowledgebase and ten specified queries in Prolog. This is my first ever Prolog program, so I would appreciate any pointers toward how I could improve. ...
5
votes
1answer
430 views

Snake game school project using Pygame

I am making a snake game and I'm almost done but I want to make my code more organized so people can understand so how to do it. ...
5
votes
1answer
1k views

Drink machine using structs homework assignment

Here's the school assignment I did: Problem 1. Write a program that simulates a soft drink machine. The program should use a structure Beverage that stores the following data: Drink ...
1
vote
3answers
24k views

Writing numbers into a file [closed]

I'm taking my first ever CS class and I have an assignment due Friday. I just wanted someone to check my code. Instructions: Write a program that: gets the name of a text file of numbers ...
7
votes
2answers
1k views

Homework to display a square and calculate tips

Here's a simple school assignment I did: Problem 1: Write a program that asks the user for a positive integer no greater than 15. The program should then display a square on the screen using ...
7
votes
2answers
5k views

Reading a line ending with a newline character from a file descriptor

I'm implementing a function that behaves like getline() which reads a line from file descriptor and returns the results without ...
1
vote
4answers
167 views

Program to display array elements in the ascending order of number of factors each element has

Input: 1000 23 100 26 32 Output: 23 26 32 100 1000 Since 23 has '2' factors and 26 has '4' factors and 32 has '6' ...
5
votes
2answers
3k views

itoa base function in C

This is a function that converts an integer value to a null-terminated string using the specified base and stores the result in a char array that I must allocate (...
4
votes
2answers
85 views

Processing trip route table in C

In fact, this is a group assignment for our C programming lesson, but seeking help from others is not considered cheating. The goal of the following code is to: Sort the data in ...