Beginners - October 2019 (Page 12)

Help with vectors
 
So today, I decided to learn vectors. Nothing much. Learned how to read data from file to a vector and all basic vectors functions. So then, I decided to practi...
[11 replies] Last: const means constant, a value that cannot be assigned a new value: con... (by jonnin)
Const Reference vs. Reference, Member Function Overloading.
 
If I have the following class: class Dog { int age; string name; public: Dog() { age = 3; name = "Dumb dog";}; void setAge(const int&...
[2 replies] Last: Weird, you're right. const int& is triggered by r value. Maybe I just ... (by TreeTicket)
Queue empty or not
 
So my friend is saying to write : if (front == - 1 || front > rear) { cout<<"Queue Underflow " } to check the queue is empty or not! But do...
[1 reply] : Your question is very light on details. Details you need to tell us s... (by deleted account xyzzy)
I'm having a spot of trouble with structs inside a class.
 
Hi, I'm trying to create two structs that hold ints and doubles, respectively, and put them both inside a class. Furthermore, I want a vector of each struct ...
[4 replies] Last: Okay, that clears up everything. Thank you. (by jjordan33)
Pig Latin Translator
 
Can someone help me on where to start with this prompt?? I know I'll need strings, a loop, and some if statements but if someone could get the code started for ...
[6 replies] Last: Write a translate() function that applies just the first rule. Once t... (by dhayden)
Variable or field declared void
 
Disclaimer that I've never worked with files before, so there's probably a lot more issues in this code than the void error. I can't even get the program to com...
[3 replies] Last: There is too much compile time and logic errors in your code, almost e... (by malibor)
Need guidance on how to make a rectangle be printed with two characters
 
Hi, I have this one assignment I am working on and I am a bit stuck here I have to make a rectangle do this with user input: Side size = 1 +-+ | | ...
[4 replies] Last: Thank you so much I understood where I went wrong :) (by Depressed)
Help with Do While loops
 
So honestly I thought I was right on this one, but apparently I'm not. I have to make a Do while loop that will output the sum of the square of the even numbers...
[2 replies] Last: I got it working after fiddling around and realizing I'm just stupid t... (by Bunny101)
I need help understanding while and do while...
 
Ive got a assignment that requires us to do multiple things with two user inputted integers. I'm a little stuck on the third part and was wondering if anyone co...
[3 replies] Last: Thank you!!! it had to be in while which is why I was struggling so mu... (by Bunny101)
by vysero
Pinch to zoom
 
Hey guys, so I am trying to fix this pinch to zoom without actually being able to test it right now... I know, it's ridiculous. Currently, my laptop's touch scr...
[1 reply] : I have not been able to test it yet but I believe the problem was actu... (by vysero)
Help with output file
 
Hello! I need to output my code to a separate file but I'm not sure how to do so. This is what I am supposed to do: Call all the functions defined to generat...
[4 replies] Last: Hello theforgottenone4, PLEASE ALWAYS USE CODE TAGS (the <> formatti... (by Handy Andy)
Pointers and Dynamic Array Help
 
So I'm supposed to write a function in class called ArrayList. Two of the functions have to deal with finding the first element of the container. One is just a ...
[2 replies] Last: what is this going to be. you can put a list in an array/vector rathe... (by jonnin)
What is the best way to manipulate objects within other objects?
 
Hello, I have an object of class BankAccount which has an object of class Person, which has an object of class Date. Here is a simple version of what I have. ...
[2 replies] Last: The name and birth date of a person never change, once you created it.... (by jonnin)
by Tru
cmake command for "additional dependencies"
 
Hello all. When I use cmake with VS 2019 there is no project properties menu to set the additional dependencies. I think I should do it using cmake commands ...
[no replies]
help having input and output displayed on same line
 
Write your question here. Hello, I am working on a hw assignment where I need to convert a phone number with a phrase into all numbers. I have the program runn...
[4 replies] Last: that does look like a lot, and more advanced than the point we are at ... (by theghost)
by obeeey
How to print this pattern?
 
Hi, my aim is to print this pattern: o---- -o--- --o-- ---o- ----o where n=5 is a side length of the square, x=3 is how many times this square has to...
[2 replies] Last: Wow, thank you so much, you really saved my evening. I completely forg... (by obeeey)
Outputting Sorted Data and Reset GPA
 
I'm currently writing a program where it'll display the student records in 4 columns(ID, first name, last name, and GPA), sort their records in ascending order,...
[6 replies] Last: I still recommend doing it first without pointers and then, if really ... (by lastchance)
Overloading the () Operator?
 
I'd like an instance of my struct to be created as such: Timer() as opposed to Timer foo; My struct is below. struct Timer { ...
[3 replies] Last: It's probably worth mentioning: The rule in C++ is that if something ... (by Ganado)
Strange Number Output in std::cout
 
I'm trying to print array elements to the console via std::cout. Most of the numbers output normally, but there are some in which a strange behaivour seems to...
[4 replies] Last: You can change the precision and format of std::cout Great, thanks.... (by calioranged)
How do I make my selection statement not run in the loop after I put my sentinel to quit on my age input
 
//Finding smallest number in a series of user input of numbers #include <iostream> #include <cmath> using namespace std; int main() { //Main inter...
[1 reply] : After getting the value ( cin>> age ) you need to check to see if it i... (by Duthomhas)
October 2019 Pages: 1... 1011121314... 18
  Archived months: [sep2019] [nov2019]

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