As of May 31, 2023, we have updated our Code of Conduct.

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
2 answers
697 views

Plotting in Python

This is a Part2 to this question where the task was to plot the data that I got from my time measurements. I've never worked with Jupyter Notebooks (ipynb) since ...
The Compile-Time Comedian's user avatar
4 votes
3 answers
921 views

O(NlogN) sorting algorithms in C++

The following code is my lab which focused on implementing any 3 known sorting algorithms out there. Since the professor gave us a choice to pick any of them and compare their execution time I chose <...
The Compile-Time Comedian's user avatar
3 votes
2 answers
102 views

Covid Data Base Hash Map in C++

This is a follow up question to Date Checking in C++ I have these two function prototypes: void CovidDB::add_covid_data(std::string const COVID_FILE) ...
The Compile-Time Comedian's user avatar
6 votes
1 answer
128 views

Crossword puzzle app

I was hoping someone could give me any tips or advice on this program I wrote for my high school class. The point of the program is to create a workable crossword puzzle in the console. If it works ...
Sean Riley's user avatar
4 votes
1 answer
93 views

Perform a permutation on an array in MIPS assembly

I’m currently studying computer science at university and I’d been tasked with writing a MIPS assembly program that performs a permutation on an array. I’m asking here because my code actually worked ...
schuelermine's user avatar
1 vote
2 answers
82 views

Python code that checks the valid phrases in input string

Determine if all the phrases are found within the input string. If they're all found (using distance as a measure of leeway) return True. Else False. Example: input = 'can i go to the bathroom in the ...
Rohit  Sthapit's user avatar
2 votes
1 answer
161 views

Intrusive smart pointer implementation

I have homework in college to implement intrusive smart pointers. ...
Edziju's user avatar
  • 299
6 votes
4 answers
3k views

Printing a Hollow Butterfly pattern

I am a beginner to Java and have studied up to loops only. After loops lecture above pattern was given to print as homework. I have successfully managed to print this pattern with following code: <...
Strange Alchemist's user avatar
5 votes
2 answers
751 views

Rock Paper Scissors, Player vs Computer

I was given for homework to make a rock paper scissor game where I input my choice as a string either: "@" for rock, "[]" for paper or "X" for scissors. The computer ...
pi4aga's user avatar
  • 53
2 votes
2 answers
110 views

Algorithm that prints day, when submitted date

I would love to know your opinion about this algorithm that we wrote in class. I was thinking about how I can optimize it (in terms of size of code/complexity) without using library functions (...
Adrian Rudy Dacka's user avatar
6 votes
2 answers
485 views

Function that returns a sequence of numbers [x: sqrt(x_(n-1)^3)] given a start value and a max value

I'd love to get a review of my code, which I've already submitted as homework. I'd like some guidance as to how to write it more DRY-ly: I wrote the whole round, <...
Suman Datta's user avatar
2 votes
1 answer
60 views

ArrayPractice with shifting arrays, generate new arrays populated with even numbers, and more

This is from my second homework assignment in my Data Structures class (in which we use Java), we were simply given the task of filling out the functions shown below (they were empty before) and I was ...
Jackson Kirkpatrick's user avatar
6 votes
4 answers
703 views

CS50 pset1: credit card classification and checksum validation

I wrote the following code for the cs50 pset1 credit and it passes all the checks. However, I think that it is too long (specially the last part) and would like to improve it. I would be very grateful,...
Anastasiia's user avatar
2 votes
1 answer
275 views

Calculating Spearman Correlation from scratch

Over the week, I was assigned to create a function in a Jupyter notebook that satisfies the Spearman Correlation formula without the use of any packages e.g. Numpy, Pandas. Below are the rules of the ...
JdoubleL's user avatar
1 vote
4 answers
276 views

Beginner Python program assignment: calculate the total number of bugs collected in a week using a while loop

Beginning of program assignment has a bug collector input the amount of bugs collected each day of the week then outputs the total number of bugs in a print statement. My professor has forbid us from ...
user avatar
7 votes
4 answers
202 views

Sum and bubble-sort student scores

I am a beginner in C language. I studied all night and did my assignment. But I wonder if there is a more efficient way. The original structure is this. ...
cozy_hn's user avatar
  • 71
2 votes
2 answers
172 views

3 dimensional python battleship game

I have an assignment in a python course. We were instructed to make a 3D Battleships game for 2 players on the same computer. I've written a code that works, according to the assignment instructions, ...
Uri Bertocchi's user avatar
2 votes
1 answer
62 views

Changing the attributes of a file

I wrote a program that changes the attributes of a file. How can I make the program more efficient? Please find program problems. How can I improve the program? ...
Dave's user avatar
  • 51
11 votes
3 answers
1k views

Toggle 2 LEDs using a timer XMEGA-A3BU Xplained

I’m currently taking an online embedded programming course. This was our 4th programming assignment. The device is Microchip(Atmel) XMEGA-A3BU Xplained Development Kit, Mfr. Part Number: ATXMEGAA3BU-...
pacmaninbw's user avatar
  • 22.4k
4 votes
1 answer
2k views

Create and view a family tree

I have an assignment due Friday to make a family tree. Started to code in January. My reviews from the teacher for this code was that the use of pointers was horrendous and it wasn't OOP enough. This ...
Shayeza's user avatar
  • 43
4 votes
1 answer
157 views

Case-insensitive sort in C

I wrote a sorting program so that if the optional argument -i is present then the sorting should be done without taking into account lowercase / uppercase letters. ...
Mike's user avatar
  • 299
3 votes
2 answers
96 views

change file attributes on a Linux file system with chattr

I am reading the book The Linux Programming Interface and I have reached the exercise in which the implementation of the chattr command in C is required. I would ...
Dave's user avatar
  • 51
4 votes
3 answers
313 views

Analyzing baby name data in CSV files

First time using code review. I am still a student so there will be a lot to be desired. Basically as part of the homework we are told what methods to create (Method names are given with their ...
NotReallyOliverTwist's user avatar
2 votes
1 answer
307 views

Implementation of an algorithm to calculate a check digit for a five-digit number

I'm a newbie in programming, just started about 6 months ago and just finding my way around in C# (clean) code. This is the toy task we have received from our teacher. This is what it should do: New ...
miles's user avatar
  • 23
4 votes
4 answers
359 views

Making a list of length X with each cell being a list of length Y

My teacher gave us an assignment to write a function that gets as arguments an x and a y. It returns a list which is of length <...
WalaWizon's user avatar
2 votes
2 answers
1k views

Input validation that verifies a boolean assignment using a Boolean object

Taking online college course and I'm new to Java. We just learned about input validation. I've used input validation pretty comfortably for strings, ints, and whatnot. But I had to validate a boolean ...
Ryan Jones's user avatar
3 votes
1 answer
363 views

ATM Console Program with Java

I am a freshman Computer Engineering student. Variable names are pretty straightforward; I believe it would be easy to understand. Program explanation: First you have to create an account and deposit ...
Yigit148's user avatar
0 votes
2 answers
128 views

Searchable database with Java and SQL

What does the code do? Albeit unfinished (it does work, it's just not complete yet), the code creates a database (members.db) where telephone numbers, IDs, and ...
telometto's user avatar
  • 119
1 vote
1 answer
142 views

Simple school bank project in C++

What is your opinion on this simple school project exercising OOP in C++? ...
milanHrabos's user avatar
2 votes
1 answer
642 views

Java implementation of Employee class hierarchy

We were tasked to do this assignment where there is the base class employee and two derived class part-time and full-time employees. Here is what I came up with: ...
kairodesu's user avatar
1 vote
1 answer
233 views

Java implementation of Yahtzee

I'm trying to implement the game of Yahtzee in java. This is for a project at my university so I tried to be as clean and to use the best code practices as possible. The part in particular that I ...
Andrea Zasa's user avatar
2 votes
2 answers
1k views

A monthly expenses calculator for an assignment

I've been working on this project for a day. Any feedback on the code would be appreciated. The code is for an assignment. The main concern I have with the project is that I'm not using abstract ...
Umsugi's user avatar
  • 25
1 vote
1 answer
96 views

Python module to generate context for Django template using data requested from API

As part of a university assignment, I have been tasked with populating and rendering a provided Django template with COVID-19-related quarantine data retrieved from a government API. To challenge ...
atiabbz's user avatar
  • 15
1 vote
2 answers
99 views

It is considered a daemon if it runs in the background - creating a daemon in C

I created a daemon that creates a fifo file with a default name, then is been blocked waiting for messages on that fifo. When an interactive process writes data to that fifo, the daemon wakes up and ...
Mark's user avatar
  • 449
2 votes
1 answer
232 views

program that implements the `mkdir` command

I wrote a program that creates a directory, similar to the mkdir command. My question is, is this implementation correct? What else could I improve or what problems ...
Mark's user avatar
  • 449
1 vote
1 answer
149 views

What are the issues with implementing the Shortest Job First algorithm?

I wrote a program that implements the Shortest Job First (SJF) scheduling algorithm. The total number of processes is read directly from the standard input, following that for each process to specify ...
Mark's user avatar
  • 449
0 votes
1 answer
279 views

Round Robin algorithm implementation

I wrote a program that implements the Round Robin planning algorithm. The total number of processes is read directly from the input standard, and for each process the arrival time and execution time ...
Mark's user avatar
  • 449
5 votes
1 answer
423 views

Space Invaders clone for a college project

Edit: the project was submitted, and I got a good grade! :D I am finishing up a project for my computer science class. The project is a space invaders clone that uses the JavaFX library to provide ...
puppeteer's user avatar
3 votes
1 answer
931 views

Generate and display usernames

Everything currently works exactly as requested by the instructor, I've included as much possible commented documentation as I can think of to make it easier for people to see what the required ...
SnazzyJoe's user avatar
1 vote
1 answer
574 views

Evaluating infix expression with brackets

My assignment was to write a function that computes the value of an expression written in infix notation. We assume that we are using the four classical arithmetic operations +, -, * and / and that ...
TheUselessProgrammer4's user avatar
3 votes
1 answer
870 views

Monte Carlo Simulation of 7 Card Stud Poker

I've completed this as part of an online programming course (in which code review is supposed to be done by fellow learners, but it's been a very long time and none of them have reviewed this), and ...
John's user avatar
  • 33
4 votes
2 answers
767 views

Read bills from a bills.csv file

I wrote the following code to read out a bill from a file and then putting it into a bills-list. The bill contains: "company", "customer", Year, Month, Day, Amount, "credit/...
huibuh715's user avatar
1 vote
1 answer
266 views

Python Fasta Parser using dictionaries without using BioPython or other external libraries

I am writing my own parser for fasta format. I can't use Biopython or anything else, because it's a part of an assigment and our teacher wants us to try to do it manually. For now, I have done this: <...
CitronWorld's user avatar
2 votes
2 answers
144 views

Java BMI Calculator [closed]

I'm learning java this week. Please reviews my code for BMI calculator using java, need some your feedback. Thanks before! This Assignment: My code ...
lokaloka's user avatar
1 vote
2 answers
194 views

Generate a string that is not present in a list

For a college assignment, I was tasked with the following (excerpt from provided code file): Find one string of characters that is not present in the list. You are provided a function that loads the ...
Linny's user avatar
  • 9,832
7 votes
1 answer
129 views

Output number densities in model atmosphere of the Sun

I have completed my Python project which calculates and outputs the number densities of dozens of different species (over 11 chemical elements total) in a model atmosphere of the Sun. The code reads ...
Woj's user avatar
  • 191
2 votes
2 answers
392 views

Print a Connect 4 board

I am required to code (as part of a 3-question assignment) a variable-size connect 4 board with a standard size of 6x7, with a minimum size of 2x2 and a maximum of 20x20. The professor said that he ...
Hannah K's user avatar
4 votes
3 answers
535 views

FIFO array/queue

I'm new to programming and was tasked with programming a generic circular FIFO queue, without using anything but an underlying array and self-programmed methods. I still don't know how to approach ...
deutschistschwer's user avatar
2 votes
1 answer
772 views

Create a Time class - OOP in Python

Create a Time class. Time is on my side Specification Basic attributes: hour, minute, second and day (default is 0), + getters, + setters (using a decorator) If ...
KermitTheFrog's user avatar
2 votes
1 answer
371 views

Python Text-Based Hangman Game

I have just written a hangman game in Python for a school project. It reads in a list of words from a text file, and graphics from another text file. For each word, the program asks keeps asking for ...
stadepalli's user avatar

1
2 3 4 5
12