Beginners - March 2018 (Page 5)

Tutorial recommendation
 
Hey, guys! New here. I come from the world of competitive programming and web development. The programming language I know best is JavaScript, and I'd like to l...
[12 replies] Last: OK, I get it. I am asking wrong questions. No, just not asking in a... (by closed account E0p9LyTq)
by jojfjo
constructors containing files
 
Im confused on creating a constructor. I need to make a constructor that takes in 1 string argument, a string file name the file has about 30 prices of so...
[3 replies] Last: The file contains 30 data values. Date, price. You are to write a con... (by Repeater)
series computing using loops (1,2)
 
Hey guys can someone please explain me how I can do this C++ program. I dont need a code I just want someone to explain me how is the working for this question...
[21 replies] Last: Hi @sairaashraf17 Just one final pair of braces { } .... { ... (by lastchance)
2d array how to split string into characters
 
how to split strings in 2d array and also accept white spaces. for example if i typed in input: the <- it will split it into |t| |h| |e| and will be placed in...
[3 replies] Last: I agree with lastchance. A 1D array is much eaiser. If you see a strin... (by Thomas1965)
Basic Encryption
 
I am making a basic encryption program for strings and it wont encrypt the first character. any ideas, I've been looking at it for a while and can't find it. m...
[4 replies] Last: so i thought i could upgrade your code somehow: #include <iostream>... (by closed account SECMoG1T)
Loop to output (5) random numbers:
 
#include <iostream> #include <string> #include <cstdlib> #include <ctime> using namespace std; int main() { // Start srand(time(0)); int c = rand()%...
[5 replies] Last: [quote=Handy Andy]The question is should it be a do/while, for or whil... (by icy1)
by zapshe
Quick question About "for" functions
 
I recently used a for statement for a code that calculates the distance of an object every second after dropping it from a given height. The for function is sho...
[3 replies] Last: I was wondering about the difference between A and C. But it's fine no... (by zapshe)
How to limit the number of user input
 
I want to make the user can only guess 10 times after that they win without guessing the number 5. What should I add? #include <iostream> int main(){ int n...
[5 replies] Last: Hello BeginnerOnProgram, Line 18 is set up correctly, but "count" is ... (by Handy Andy)
largest value of 2nd row in 2d array
 
Hello, my code needs to find largest value of 2nd row in 2d array. Everything works fine untill the column number is 5. What's wrong in the code? for exampe if ...
[1 reply] : Your code did not build on my computer because the array needed const ... (by Manga)
Array
 
Hello, I was working on this code and I'm having some trouble. Please help. What I have to do: Write a program that shows a menu in a loop with these follo...
[2 replies] Last: Hello shortyvivian, When I compiled the program the first error "expr... (by Handy Andy)
array
 
Create a 2-d array containing the scores of 4 athletes in last 6 events. Read the values from the user. Compute following a. Highest score in 4th match b. Ave...
[1 reply] : Nice little exercise. Here's a starting point, assumes that score is a... (by Thomas1965)
by zapshe
C++ Cross-platform Windows/Mac?
 
So I've been hearing several things, and I'm assuming the answer lies somewhere in the middle. I've been coding in C++ on Windows, but I heard that to have it r...
[9 replies] Last: "stdafx.h" is only for visual studio, right? NO, imagine the followi... (by Thomas1965)
Decimal cutting off when calculating median of even numbers
 
When I try to find the median of an even amount of numbers, the decimal is being cut off of the answer. I'm sure I'm just overlooking something simple. Any help...
[5 replies] Last: float getMedian(int getStudents, int* setMovies) { return 0.5 * ( ... (by lastchance)
debug for struct array
 
I am having problems with debug sections, please help #include <iostream> #include <string> #include <iomanip> using namespace std; struct DIV { fl...
[1 reply] : Line 30: You cannot print div_info directly. Try something like c... (by coder777)
by ar2007
file .txt
 
Hello everybody. I wrote a program to extract a text file, process it, and then rewrite it in another text file. the program has always worked well, but in th...
[4 replies] Last: I will try to explain myself better. the problem is that even if impos... (by ar2007)
by MKKUER
Code Improvement
 
I've crafted myself a single - player Battleship game, but I need ways to improve it. So it's both more readable, manageable, and efficient. This codes display...
[2 replies] Last: using classes: 3 files {game.h, game.cpp, main.cpp} ///game.h #ifn... (by closed account SECMoG1T)
How to handle when there is no mode?
 
I am having a little trouble with my mode function. I need to add something so that if none of the numbers occur more than once, it will print "There is no mode...
[2 replies] Last: There is never "no mode", @stormbot. It would lead to hopeless inconsi... (by lastchance)
Prime Numbers
 
An integer greater than 1 is a prime number if it does not have a divisor that is greater than 1 and less than itself. For examples, 2,3,5,7,11,13,17 are al...
[3 replies] Last: If it works for everyone else but you're asking for help, I'm going to... (by zaphraud)
Problems setting up IDE
 
Hello, I'm having some issues setting up Code Blocks. https://imgur.com/a/IKHNP First issue is the screen resolution, it looks horrible. I tried looking...
[9 replies] Last: Did you download the Code Blocks with a compiler or without one? Assum... (by Ganado)
loops
 
(The formula for converting a temperature from Fahrenheit to Celsius is C=5/9(F-32) Where F is the Fahrenheit temperature and C is the Celsius temperature. Wr...
[3 replies] Last: thank you for verifying <3 (by garza07)
March 2018 Pages: 1... 34567... 29
  Archived months: [feb2018] [apr2018]

This is an archived page. To post a new message, go to the current page.