Linked Questions

66
votes
8answers
8k views

Open, write and close a file

I have a small 10-liner function that writes some data to a file using an std::ofstream. I did not explicitly call .close() at ...
15
votes
5answers
3k views

One program using three functions to compare two double-precision numbers

I am currently learning C++ though Bjarne Stroustrup book Programming Principles and Practices using C++. Going through the drills, I am trying to purposefully write efficient and readable code (good ...
15
votes
3answers
25k views

Salt generation in C#

I have designed a small method to generate a salt for a password. All this does is create a random salt and does nothing to add it to the password. I have a few questions regarding my very simple ...
10
votes
3answers
222 views

Writing a program to read a maximum of 99 elements in an iteration from a list

I want to read a list of elements and pass a maximum of 99 elements to a function for some logical operations. I have tried this with an array as an example and this code was successful in achieving ...
5
votes
5answers
11k views

Checking if a given string is in alphabetical order

I wrote this function to check if a given string is in alphabetic order. How can I improve? ...
6
votes
7answers
5k views

Speech Synthesis to showcase how various voices sound with System.Speech.Synthesis

I was wondering if you would be willing to give me some suggestions on shortening this code. I feel as if the amount of if statements I have is a bit much. ...
5
votes
2answers
6k views

Read binary serial data and parse integers

I'm reading serial data in binary format from a stream, and I'm not happy with how I extract the data because it takes so much operations to extract the binary data from a simple line of binary data. ...
7
votes
3answers
3k views

Word separator and Pig Latin program - final edit

This is an updated version of my previous Java program that asks the user for a sentence and then separates the words and then converts the sentence into Pig Latin. My previous program was working, ...
6
votes
4answers
708 views

Educational website using ASP.NET webforms

Our team is developing an educational website using ASP.NET webforms. We designed DAL & BAL classes and now I have some questions: Are DAL & BAL designed well? Would it be better using ORM (...
4
votes
2answers
53k views

Connect Four game in Java

I was wondering if you guys could point out any mistakes I've made in this program, and how to improve the code. It's a simple console-based Connect Four game. You use 0-5 to place your piece in the ...
3
votes
4answers
2k views

Product Manager managing product listings and prices

For school we have to develop a product manager. The basic task is to add new products. A product has a name and a price. I know the one or other class is currently pretty empty but its planned to ...
5
votes
4answers
7k views

Simple BMI calculator in Java

A similar question must have been asked a thousand times, but for the life of me I can't figure this out. I am new to Java and I want to create a programme that asks a user for his or her height and ...
8
votes
5answers
428 views

Custom networked remote manager

I've spent my fair share of time criticizing other people's code on this site; but I'm finding out I'm kind of a hypocrite. Almost everything I've written so far has been some program whipped together ...
8
votes
1answer
4k views

Basic JavaScript template engine using replace, match and RegExp

To practice with regular expressions, I wrote this basic template engine in JavaScript in addition to a simple test case to make sure it works correctly. I am wondering if there is any improvements I ...
3
votes
3answers
9k views

Search in a 2D array to find if there is a row or a column that contains the word “error” in every cell of that row or column

Search in a 2D array to check if there is a column or a row in the 2D Array thats contains all the word “error”, if yes return the index of that row or column else return 0; Exception: if the row ...

15 30 50 per page