Homework means the question is requesting help with school homework. This lets potential answerers know that they SHOULD guide the student in solving the problem, and SHOULD NOT simply show the complete answer.

learn more… | top users | synonyms

0
votes
0answers
28 views

Beginners C++ file stream homework [on hold]

The assignment is to make a program that allows would prompt the user to locate a .txt file, convert it to an encrypted mess, create an output file of said mess named "encrypt.txt", then have the ...
6
votes
5answers
453 views

Simple technology quiz

This is my first program that uses more than just boring ol' if/else statements - I made a whole 246 line game that's still a ...
4
votes
2answers
174 views

Hex Editor in C

I had a homework assignment to create a simple hex editor that reads binary files as well as write integers to it. However I enhanced it a bit. Homework is already submitted, but that doesn't mean ...
3
votes
3answers
106 views

Multiple for loops in Sudoku solver

I have an assignment for writing a Sudoku solver and have achieved the functionality required but a lot of the code is "ugly" and I'm wanting to simplify it but unsure how to. ...
8
votes
2answers
212 views

Unit Tests for a Fraction Class

As my first Java homework, I wrote a class to handle fractions. This Fraction class implements basic operations for the fractions (addition, subtraction, ...
2
votes
2answers
59 views

Building Data abstraction for line segments using “type abstraction”

Below is the given exercise: Exercise 5: Segments Consider the problem of representing line segments in a plane. Each segment is represented as a pair of points: a starting point and an ...
1
vote
1answer
45 views

Building Data abstraction for line segments using “objects”

I follow this definition of "object":...
12
votes
1answer
135 views

Chack miy spellang pleez

For my CS2 project, I am supposed to implement a spell-checker. It is supposed to follow the following: Prompt the user for the name of the file containing the dictionary of correctly ...
1
vote
0answers
37 views

HDD Based AVL Tree

For class I have to write a program that reads (plaintext) numbers from a file, and inserts them into an AVL tree stored in another (binary) file. I cannot have more than about 10 nodes in memory at ...
3
votes
0answers
81 views

Building an efficient bubble sort function

I've been asked to create a bubble sort function that checks whether the array has been filled sorted before all passes are complete, thereby avoiding unnecessary passes. This is to involve ...
5
votes
3answers
186 views

“Set” your expectations low for this ADT

For my third assignment in CS2, I was given the following: A set is a special bag that does not allow duplicates. Specify each operation for a set of objects by stating its purpose, by ...
3
votes
1answer
42 views

Perceptron algorithm

This is the Perceptron algorithm, I wrote this implementation with my friend. It gets the job done, but it's quite dirty, perhaps one of you stylish hackers might help me beautify this beast. This ...
14
votes
4answers
1k views

Smart as a bag of rocks

For my second project in CS2, I was given the following assignment: Implement a new ADT called a bag with receipts. The specification for the class of bag with receipts differs from a ...
2
votes
0answers
34 views

Search/sort/create functionality, implements bubblesort and sequential search

I've moved my main() to the bottom of the code block in order to fit it all in one class for this submission. If there is a better way to do it? ...
8
votes
2answers
176 views

Symmetric Square

I was given an assignment to ensure that a list was symmetric. I built it in a way that worked and it passed the tests. But I wanted to see if it could've been written more efficiently and still ...
3
votes
4answers
100 views

Concatenate two arrays generated randomly

I have written the code to concatenate two arrays . Please let me know of any loopholes in the written code. ...
6
votes
3answers
305 views

Optimizing this Knight's Tour

My assignment in CS was to make a knight's tour application that could solve the problem from any starting position. I had just finished the code so excuse the lack of deeply descriptive comments. My ...
3
votes
2answers
284 views

Shuffle the elements of the array randomly

I have written the code to shuffle the elements of the array. Please let me know of any loopholes in the written code. ...
11
votes
4answers
1k views

To understand what recursion is, you must first understand recursion

This is the second assignment for my CS2 course: Write a recursive C++ function writeLine() that writes a character repeatedly to form a line of n ...
7
votes
3answers
564 views

RPN calculator in C

I had to write a RPN calculator in C as one of my homework problems, but if someone could critique my code and suggest any improvements, that would be fantastic! I haven't added any overflow errors or ...
6
votes
3answers
491 views

Harvard CS50 Problem Set 1: greedy change-making algorithm

The goal of this code is to take dollar or cents input from the user and give out minimum number of coins needed to pay that between quarters, dimes, nickels and pennies. If this code can be ...
10
votes
4answers
675 views

Knowledge is power

Resurrecting my C++ saga, I was given this project for my CS2 class: This problem considers several ways to compute \$ x^n \$ for some \$ n \ge 0 \$. Write an iterative function ...
-1
votes
2answers
89 views

Cycles of pointers

I'm really inexperienced with cycles, so I want to make this code shorter. As far as I know, I've made a recursive cycle. ...
1
vote
1answer
117 views

Calculating Payroll

I have written the code as best that I know how but I am unsure that the questions asked are being fulfilled. Any advice to improve this code would really help me. Question Asked: Create a new ...
10
votes
2answers
1k views

It's almost Friday, right?

This is my final post for my CS1 saga. Mostly all I had to do was just "class-ify" my past project in this post. Here are the requirements: Make all data members private and use constructors, ...
11
votes
3answers
502 views

Predicting the next pseudorandom value

The archived material for the Stanford University course on cryptography at coursera.org includes a problem where you have to predict the next output of a weak PRG. It can be briefly restated as ...
7
votes
4answers
151 views

Test a number for primality and return smallest divisor different from 1 if it’s is composite

In this exercise we were asked to test a number for primality and print the results. Additionally – in the case the number is composite – the smallest divisor different from 1 should be printed out. ...
7
votes
2answers
357 views

Counting Fermat witnesses and liars

We were asked to implement a program that calculates the number of Fermat witnesses and liars for odd numbers greater 1. This involves Fermat’s little theorem. Fermat’s little is used to identify ...
4
votes
3answers
699 views

Rounding and formatting hours, minutes, seconds as HH:MM AM/PM

I have a program which is supposed to convert standard time to traditional time. (e.g: 15:24:31 = 3:25PM [rounded seconds]) I would like for someone to error check my code for me as well as give me ...
10
votes
5answers
794 views

Entering two integers and returning a decimal fraction

After a couple of small programs in Python we are now asked to do some basic stuff in Java. I don't really know where to start to improve this and whether it's even necessary. This is an exercise, so ...
5
votes
3answers
2k views

Count occurrence of words in a .txt file

I'm taking an intro to programming class and although I've learned some things I didn't know before (I've been using Python for about 1.5 years) I feel like I've not progressed much in writing ...
6
votes
2answers
255 views

Converting fractions to mixed numbers

I've been making a program for an assignment that converts fractions to mixed numbers, and I'm done, but I was wondering if I could simplify it in any way, since it seems quite complicated right now. ...
9
votes
1answer
341 views

Counting Words in Files - MATLAB style

For my Matlab class I'm taking, I was given the task to write a function ReadAndCountWords that takes in the name of a text file (specifically from this zip file) ...
2
votes
2answers
95 views

Make a dict class from scratch in Python

Here's the API my teacher assigned: and here is what I came up with: ...
2
votes
2answers
166 views

Database assignment with MySQL and Swing

I have completed this assignment from Stanford CS108 on MySQL and Swing (it's part B). It would be wonderful if someone could point out my weak spots in the code and overall design. I have uploaded ...
2
votes
4answers
539 views

Calculate employee wage

This is for a class assignment. The objective is to write a program that will take in user input for employee information and print the wage based on hours worked. Please review my code. ...
14
votes
3answers
3k views

Is it Friday yet?

This is the first program that I have written in my C++ saga that I actually think is useful. The description for this assignment is kinda long and mundane though: Write a program that inputs a ...
1
vote
0answers
26 views

Filter by a transformed list, then untransform the result

Both exercises have a common pattern of "filter by a transformed list, then untransform the result". See skip and localMaxima. ...
3
votes
1answer
116 views

Applying scalar multiplication to matrix

This is one of my first programs in C. Please review and help me improve it. I create a matrix and apply scalar multiplication on it. Then I print the result. ...
2
votes
2answers
733 views

Simple TakeOut Menu

This is for my intro level C++ class. This is the assignment: Write a program that displays a takeout menu from which a user can place an order. The program begins by displaying the menu and ...
2
votes
4answers
3k views

Output digits of a number

This is a simple C++ program I had to write for class. It prompts the user to input an integer and then outputs both the individual digits of the number and the sum of the digits. How do I improve ...
2
votes
2answers
330 views

User input for student grades is too verbose

I need some help with this beginner C++ program (it's an assignment). How can I use a single variable and make the program get the six inputs I need instead of using a variable for each input? ...
7
votes
2answers
143 views

Compute the number of molecules

I would like my program to be reviewed. I had to write a simple program that calculates the number of molecules in a hydrocarbon. 1 carbon atom has 12 AMU. 1 hydrogen atom has 1 AMU. ...
7
votes
3answers
554 views

Computing the average of several numbers

I am learning C++. This is a simple program I had to write for class. Is there anything I should fix? ...
17
votes
3answers
2k views

Isn't this Interest-ing?

This is the fifth project in my CS1 class. It's a bit more drab than my past projects, so my titles are getting worse unfortunately. :( Write a program that ...
1
vote
1answer
663 views

Doubly circular linked list implementation with successive update in O(1)

For the queries mentioned in link in 3 parts, the first two parts have been addressed, as mentioned below: Part I (6 points) list/DList.java contains a skeleton of a doubly-linked list class. Fill ...
4
votes
3answers
388 views

Dollar value of coins and calculating interest compounded annually

I've made this program to do a few integer calculations. Do the methods for converting the numbers look good? Do you have any other basic tips? ...
7
votes
4answers
119 views

Forming output of lines based on input

I have homework, in which I get number of cases and then four numbers. Each number tells how many rows there are in each column For example: 2 2 3 3 should be ...
18
votes
4answers
1k views

The Term-inator: Pi edition

The fourth project, continuing my C++ saga with terrible post names. :P An approximate value of pi can be calculated using the series given below: $$ \pi ...
15
votes
2answers
186 views

Interprocess Communication in a Farmer-Worker setup

The following code is my first C program I have made for an university assignment about Interprocess Communication. This involved creating a parent process, the farmer, and then creating a certain ...