Beginners - November 2020 (Page 7)

Averaging Grades
 
Hey guys if somebody shortens this code. I think is too long for me. #include <iostream> #include <cmath> using namespace std; int main() { float F...
[3 replies] Last: #include <iostream> #include <vector> using namespace std; struct Bo... (by lastchance)
User controlled loop not working
 
So I am developing a program that asks the user if he/she wants to buy tickets to a concert. If the user types "B" the program asks the user to enter how many t...
[2 replies] Last: look at what dutch says then look at lines 30 & 36. Also look where yo... (by CodeGoggles)
2D Histogram
 
I need to plot the logistics map using a 2D histogram. My r will vary from 1 to 4. I have used Gnuplot before, but I don't see a 2d histogram option. An...
[6 replies] Last: First of all, that is amazing. Thank you. To be honest, I have no id... (by agnt1831)
Help with a Blackjack Project
 
Hey Guys! I was hoping to get some help a project that is due soon. Basically I just need to turn convert these 2 classes into linked lists. I'm short on time s...
[1 reply] : a linked list looks like this: class data { int i; double d; ... (by jonnin)
Header hell
 
I was following a tutorial and found myself in header hell, so I did what I always do; I defined a master header and put the master in every file or header I ha...
[2 replies] Last: a 'master' header file is fine in some situations, esp for a large fil... (by jonnin)
issue with virtual string function
 
Hi, I have been learning a lot of different c++ lately and trying to make a small program to test out different stuff. But I am facing an issue with a virtual s...
[3 replies] Last: That is a constructor member intializer list , initializes the data m... (by deleted account xyzzy)
for loop overwriting itself for an array.
 
I have to write a program that prints out the reversed alphabet without vowels. Then it has to read an input number, and print the letter it corresponds to. Th...
[3 replies] Last: this is so much clearer now! thank you so much. (by irene 127)
by lychee
How to read 4x4 2D-array from file
 
I am doing Branch and Bound.I want to read 4x4 integers from file How do I do this,here is what i tried but it seems wrong with my output My txt file i...
[6 replies] Last: @seeplus Yes I did see it the code is for reading file and it works a... (by lychee)
Trying to get the Numbers to input and do the calculation correctly
 
The equation isn't coming outright. It keeps telling me 11% in my our program. I'm brand new to C++ so I know I must be doing something simple wrong. But I just...
[9 replies] Last: Andy, Thank you for the information and the help. I will take it all ... (by heart1210)
Help!
 
I wrote a code but I have not to result. 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SE...
[11 replies] Last: #include <iostream> int main() { char str {}; std::cin >> str; ... (by seeplus)
swap two parts of a string
 
Q: " given a string. obtain another one by swapping the parts of the first one after the first entry of space" so i guess it's like this: input: basketball is ...
[6 replies] Last: Thank you all so much for helping me, really appreciate it :) (by laura fidarova)
Help with this task
 
I can't understand this task: for two square matrices, create a third matrix, the elements of which should be equal to the product of the elements of the corre...
[4 replies] Last: #include <iostream> #include <valarray> #include <string> using names... (by lastchance)
Please correct my code
 
I always get 5 7 7 but should get the maximum numbers from each column. Please correct my code. #include<ctime> #include<iostream> #include <cstdlib> usin...
[3 replies] Last: #include<ctime> #include<iostream> #include <cstdlib> using namespace... (by againtry)
by dada51
I'm stuck with a very simple problem
 
Hi, I'm trying to learn how to code in C++. I have to create a simple program that will generate the multiplication table (from 1 to 10) of a given number en...
[10 replies] Last: A couple minutes ago I didn't have a clue about what you meant by "cod... (by dada51)
"Undefined reference to" Error
 
I am writing a program and need to store values from a text file. I am trying to store the data from the structure into a vector. When I compile however, I rece...
[1 reply] : Note the discrepancy: void load(vector<record> &allEmployees, ifstr... (by dutch)
Check my code, please!
 
Somewhere there is an error in the result constantly 2 is deduced. I can't find her. Or offer your vision for solving this task: determine whether a given squar...
[4 replies] Last: seepluc, thank you for your help. You have helped to solve many proble... (by chebyrek)
why I didn't get my desire input?
 
Hello, I'm a beginner and I need to do a task about using functions. I already made the code as below, however, after it sums up all the number that I input, i...
[12 replies] Last: You don't need to worry about passing by reference for now. You just... (by MikeyBoy)
Swap lines in matrix
 
hi, so the question says "move the bottom line to the top and all the other ones dowm" so i'm assuming if i were to have: 1 2 3 4 5 i'd need it to be like: 5...
[5 replies] Last: thank you soooo much for the 193934th time!) (by laura fidarova)
by yvez
Printing string array in For loop seems to print memory location, how to fix this?
 
I watched a tutorial on youtube on how to use for loop in c++ but the tutorial didn't show how to print string array using for loop. So I tried this but it just...
[2 replies] Last: Oh! thanks it worked now (by yvez)
why my function didn't working?
 
Hye, I am a beginner and I just started my C++ course in my university. I'm currently working on my functions' homework. It was an easy task, however, after I u...
[5 replies] Last: thank you for your advice :D really appreciated that! ^_^ (by Violetzz)
November 2020 Pages: 1... 56789... 14
  Archived months: [oct2020] [dec2020]

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