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

Java game that generates and compares random numbers, looking for matches

I have written some Java code for a school assignment. It is a game, and it works as follows: The game makes 4 random numbers, all different, as the users ticket. It then generates 4 other random ...
2
votes
3answers
175 views

Simple C++ program that calculates the measures of a sphere

I have another home work from school and would like to see if I am on the right path to learning C++. We have to do the calculation of the measures of a sphere. I did it two ways: Just calculating ...
17
votes
6answers
6k views

Simple modern C++ string class implementation

My teacher asked me to come up with a quick version of the C++ string class. This is what I have written. It works fine and I have tested few cases as detailed in <...
3
votes
1answer
482 views

Object-oriented Tamagotchi-like program with a GUI

I am currently working on a small python project for an undergraduate course in python. The task is to create a Tamagotchi-like program with a GUI. My question is whether my code is Object oriented or ...
1
vote
4answers
71 views

Form a firstname.lastname@domain.se address, eliminating diacritics from a name

I'm an amateur programmer who just started learning programming, my school gave me an assignment to create code that reads a surname and lastname from an input dialog box and then to edit those name ...
4
votes
2answers
6k views

Reverse a word in the char array

I have to write a program that reads a word to the char array and next display it reversed. I must find best own optimal solution. My solution of this exercise: ...
4
votes
5answers
827 views

Calculating sum of squares in C

I wrote some program in C language. I have to calculate sum of squares. My book suggested me to use loops but I chose more efficient way by using formula: $$1^2+2^2+\cdots+n^2=\frac{n\left(n+1\right)\...
4
votes
2answers
177 views

Develop custom Hash Map

I've got a task to implement custom hash map with only get, put, size functions without remove and implementing base Map interface in Java. I've made one but not sure if it is good one. Can You check ...
5
votes
1answer
1k views

Counting the number of unique fractions read from a text file

I will begin this question with the disclaimer that it is homework but my code is written and working, I just want to know if there any ways in which I can improve what I already have. I want my ...
7
votes
1answer
175 views

UPenn CIS194: Credit Card Validation (Homework 1 Part 1 Tests)

I am working through the UPenn CIS194 lectures and homework assignments in an effort to learn more about Haskell. The first part of the first homework is focused on validating credit card numbers. ...
4
votes
1answer
56 views

Homework distribution terminal app in C++

I'm working on cleaning this code up a bit and was hoping for some suggestions. Right now it works well enough on a basic level, but it doesn't check for out of bounds numbers or improper input. ...
5
votes
4answers
99 views

Finding students with the best grades in a given subject

We have a school assignment, in which the program is to read data of students from stdin, in the following format: LASTNAME FIRSTNAME STUDENT_ID SUBJECT AVERAGE_GRADES. The program has to print out ...
3
votes
1answer
105 views

CS50 Pset1 Greedy, change algorithm

The purpose of the code is to calculate the least amount of coins needed to produce correct amount of change given a dollar or cent user input. I'm just starting out and appreciate any pointers in how ...
3
votes
2answers
2k views

C program to handle information of cars and owners

This is a school assignment, it's the longest program I've wrote this far, and I feel it's a bit messy and all over the place. I will try to translate the assignment to the best I can: We have a ...
3
votes
1answer
422 views
0
votes
1answer
1k views

Java OOP HomeWork [closed]

My professor is super strict and just want to know if I have solved this correctly. Design a class named Location for locating a maximal value and its location in a two-dimensional array. The class ...
2
votes
0answers
984 views

A clock program in MIPS assembly that start ticking from 59:58

This is an assignment, a clock program which use MARS simulator, it starts ticking from 59:58. In this assignment I have implemented three functions ...
6
votes
1answer
244 views

CIS 194 Homework 2: Parsing an error log

Here is another reference solution, that I discovered after writing my own: https://insight.io/github.com/beloglazov/haskell-course/blob/HEAD/hw2.hs I am following this lecture course as a ...
1
vote
1answer
571 views

Track mail to clients

Create an application class named LetterDemo that instantiates objects of two classes named Letter and ...
2
votes
0answers
72 views

LightsOut - A homework framework for teaching CS to non-engineers

This provides a fill-in-the-blanks homework framework to implement the game "LightsOut". LightsOut is a game with a grid of lights. When you touch a light, it toggles it’s state; it ALSO toggles the ...
2
votes
2answers
456 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
393 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
15k 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
263 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
3k 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
561 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
192 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
226 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
457 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
816 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
316 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
6k 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
89 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
338 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 <...
24
votes
5answers
12k views

Implementing realloc in C

I have an assignment to implement realloc in C, This's my code please review it. ...
10
votes
1answer
161 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
92 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
427 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
142 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
2k 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
103 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
722 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
4k 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
196 views

Some kind of encryption in C++

It's my university task. Can I get some opinions on it? ...

1 2 3
4
5
10