Tagged Questions

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

-3
votes
0answers
20 views

Implementing Insertion Sort Using 3 Stacks. (Segmentation Fault - Core Dump) [on hold]

I'm getting a Segmentation Fault - Core Dump during runtime. EDIT: Added Input and Output below. ...
-1
votes
0answers
14 views

method to receive wholesale cost and markup % as arguments and return retail price c# [closed]

I typed out this code for homework and it works. However, the method part is incorrect. The method should receive 2 values (wholesale price and markup percentage) from the form as arguments and return ...
3
votes
2answers
119 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 ...
5
votes
2answers
90 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
88 views

Counting Words in Files - MATLAB style

Note: this question may seem quite large, but the code to review is actually quite short For my Matlab class I'm taking, I was given the task to write a function ...
2
votes
2answers
71 views

Make a dict class from scratch in Python

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

Database assignment with MySQL and Swing

I have completed this assignment from Stanford CS108 on MySQL and Swing (it's part B). And it would be wonderful if someone could point out my week spots in code and overall design. I have uploaded ...
2
votes
4answers
280 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
18 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
67 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
452 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
333 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
92 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
140 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
533 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
79 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
176 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
107 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 ...
17
votes
4answers
993 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
172 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 ...
16
votes
4answers
4k views

If she floats then she is not a witch like we thought

Continuing my C++ saga, this is the third project for my CS1 class: Buoyancy is the ability of an object to float. Archimedes' principle states that the buoyant force is equal to the weight of ...
2
votes
1answer
100 views

Binary HeapSort and Ternary HeapSort implementation

This is my take on binary and ternary heapsort implementation for a university assignment. The code works but I wonder if there are any mistakes or things to improve. ...
1
vote
2answers
175 views

Fractions in Java [closed]

Part I-IV recommend code changes as mentioned in link 1, for the initial code given at link 2. Can you please review the code changes for Part I-IV? Part I: Constructors (1 point) Modify the ...
6
votes
3answers
584 views

Lemonade stand menu program

This is an assignment given in my C++ programming class. I have one main menu with four other menus branching out from it. I would like to make my code as clutter-free as I can, so please review ...
15
votes
4answers
2k views

Living off of chocolate

This is the second project for my CS1 class, this time I'm actually getting it reviewed before I submit it ;) The Harris-Benedict equation estimates the number ...
9
votes
3answers
532 views

Checking for palindromes using dynamic memory allocation

This is a homework assignment, but it's already done and it's not for a grade; it's meant as a refresher for the rest of the course. I've never done anything with dynamic memory allocation in C ...
5
votes
3answers
239 views

Classes for acquiring employee information

I'm looking for a review on the following classes and the comments I applied (class assignment): ...
4
votes
2answers
1k views

Infix to Postfix Converter Program

This is my homework. Kindly help me check it? The instructions are: Implement an infix expression to postfix expression converter. You are to implement the infix to postfix algorithm presented ...
10
votes
5answers
951 views

Caesar cipher cracker

How can I refactor this with less code? This is homework and is cracking a Caesar cipher-text using frequency distribution. I have completed the assignment but would like it to be cleaner. ...
1
vote
1answer
70 views

Verify assembly code implementation [closed]

This is part of an assignment. I believe it forms a while loop which looks like my pseudocode below, but I'm not sure I'm interpreting it completely correctly. ...
8
votes
2answers
363 views

Finding the longest Collatz sequence cycle

I wrote a program to calculate Collatz sequences for initial numbers between 1 and a given integer i, then find the one with the largest cycle length. My code is ...
12
votes
5answers
1k views

Yahtzee game (using arrays and object classes)

As part of an assignment for my intro Java class (please bear with my beginner skill set), I'm working on a program for which a Die object class is used to play a Yahtzee game. An overview of the ...
6
votes
1answer
125 views

Text Analysis web page

For a homework assignment, I made a web page that has a text area. The user inputs some text, hits the analyse button, and the output is supposed to be a list of the frequency of words of a given ...
5
votes
2answers
464 views

A Sudoku game made from Google's Dart language

This is my first real web project and I have never touched JavaScript (barely touched CSS), so I just skipped that and went to dart for fun. Here's a live demo The code for the dart file is down ...
7
votes
3answers
742 views

Depth First Traversal of a Graph

I am learning how to implement a basic undirected graph and perform a depth first traversal. Please critique my code for correctness, best practices, security, and any other comments that may be ...
3
votes
2answers
659 views

Pascal triangle algorithm is good but fails

I have created a function which returns the number that corresponds to the given row and column from the pascal triangle. I have used the formula for this: n! / r! * (r-n)! The code: ...
1
vote
1answer
62 views

Determine how many bits are in a floating point value [closed]

I'm writing a program which determines how many bits are in a floating point value (this will be run on Unix). ...
4
votes
1answer
211 views

Winning Loop Connect 4

I am writing a fully functional single player Connect 4 game. I am working on the second player and the while loop that tells the player who won. GUI ...
5
votes
2answers
2k views

User input and reading contents of file

For full disclosure: this is an assignment for my programming class and I just want tips or advice on some of the code. Assignment details just for background information purposes: Write a ...
1
vote
1answer
892 views

Bank ATM program in Python

For homework, I have to code a program in Python that effectively simulates a bank ATM. ...
7
votes
4answers
510 views

Basic Calculator

I'm in a beginner JavaScript class and I feel like I have a pretty good grasp on all the intro material. All of my homework assignments work but they seem longer than they have to be, especially my ...
6
votes
2answers
2k views

Pass an array of numbers into a method that's overloaded

I'm doing my homework and it says to write a test program that prompts the user to enter ten double values, invokes this method, and displays the average value. I was able to get this program working ...
7
votes
2answers
148 views

Dictionary brute force on DES encrypted passwords

For a school project I am tasked to decrypt DES passwords. I have sample code provided below and I want to know if this is the best method. Also should I code in error handling for the dictionary ...
3
votes
2answers
123 views

Adding/Removing Colors to Lists

I would like the program to ask the user if they want to add a color. If they say yes, then ask what color to add. Then after that happens, once the program would ask if you want to, run it again. If ...
10
votes
4answers
727 views

Suggestions for a Dungeons and Dragons-like game

This game is similar to a Dungeons and Dragons game. How could I improve the efficiency of the program? For example, where can I add functions, records etc? This is for a school Controlled ...
7
votes
2answers
382 views

Search procedure to find inputted DWORD in MASM Array

Is there any way to make this more efficient? ...
4
votes
2answers
921 views

Using threads to find max in array

I really do not have access to anyone, outside of professors, that is highly knowledgeable about Java so I figured I would post my stuff here to further my knowledge and improve my coding. This is ...
6
votes
1answer
163 views

Finite Automaton for a Typing Game

I'm creating a game that implements a finite automaton and I don't know if I'm doing it right. Any advice? Game class ...