Beginners - May 2019 (Page 14)

by Bopaki
C++ moving an element from Front of a queue to Back
 
here is my code for the function: int move_to_rear(int Item) { linkedQueueType<int> myQueue; const Item first = myQueue.front(); //getting the f...
[4 replies] Last: > Why isn't move_to_rear a member function? ¿why should it? it can be... (by ne555)
by spd
display the index number of an array
 
I am trying to get the salesman number to output so I can identify the salesman who sold the most cars. I assumed I would be able to output the element of the ...
[2 replies] Last: Thank you! I appreciate the quick response and help! (by spd)
Return value of overloaded assignment operator
 
Hello, when learning C++ I've been using a MyClass& return value when overloading the assignment operator for a class MyClass. But why are we doing this? Cons...
[3 replies] Last: Indeed. PS. You are not systematic: Dataset::Dataset(int N) : N{N}... (by keskiverto)
by wkAlex
Exception thrown
 
I was trying to make an array picking random from another array, but it throws an exception, I wonder why, here is my code: class mastermind { private: s...
[2 replies] Last: void setColor() { const int NCOLORS = sizeof(color) / sizeof( co... (by JLBorges)
Singly Linked List, Deleting, and Destructors
 
Please Note: This is for a homework assignment, however it was due ~3 weeks ago and I'm only doing it for the learning aspect. I'm learning about Singly link...
[5 replies] Last: [quote=jlb]Well those two books you listed do have Kindle versions if ... (by PiggiesGoSqueal)
interpolation
 
i want to write a program that interpolates.i have to read the txt file that contain two columns ,the angle column and the amplitude column.this columns have h...
[10 replies] Last: Hello osteen91, Your use of code tags is improving, but you do not ha... (by Handy Andy)
by mpvick
c++ maze game assignment help (1,2)
 
So essentially we've been assigned to complete finish out game.cpp file based on a few other header files. The issue i have is that while i can make the charact...
[25 replies] Last: yeh the doors lead nowhere the game is complete when all doors are ope... (by mpvick)
Makefile
 
Hello, I have a makefile and I need to work with a library ginac. using namespace GiNaC; I compile a simple file with g++ file.cpp -lginac but know I have sev...
[6 replies] Last: Rama *rama also, you are missing a semicolon (;) at the end of the l... (by ne555)
by suprax
Calculation of Median [Where is the Problem]?
 
Hey guys, i'm sitting the last 2 days on this code and i just can't find the problem. I want to calculate the median. #include <iostream> #include <...
[4 replies] Last: I get it slowly. For example: if i have four values: " 7 8 9 10". To... (by suprax)
program that implements a small information system for a gas station
 
I need to write a program that implements a small information system for a gas station. with an array with Type of petrol, price and article number.The program...
[8 replies] Last: Thanks, but consider that find_by_articnumber() is in fact not really ... (by nuderobmonkey)
by Pecvx
Basic question regarding exception handling
 
Does it make any sense to have a throw statement in a function without a catch? I found it in a solution set, but I'm getting "terminating with uncaught excepti...
[5 replies] Last: Another version that leverages throwing the number passed into the fun... (by George P)
A fish like Tuna (1,2)
 
Heyy is there something a syntax i can use for this Im using function... thenn let say the program inside the function was done ,what syntax can i use to go...
[36 replies] Last: @Repeater, Good point. Andy (by Handy Andy)
Why the output is like this2?
 
Hello, I have such code and I am trying to understand why the output looks like this. Here is the output: A.f:1 B.f:1 A.f:-5 A.f:3 Exc A.f:3 I think that...
[5 replies] Last: Thank you very much. (by Onfould63)
C++ minutes conversion to hours
 
Hello, something isn't right and I don't see it. ************************************************ Two cars A and B leave an intersection at the same time. Ca...
[6 replies] Last: you just spoke Chinese to me Chinese is the new English ;) Back to t... (by MikeStgt)
Calculator with order of operations
 
Hey so I wrote a calculator program where you can write an expression and the program solves it. For a long time I've wondered how to make a program like thi...
[2 replies] Last: so I wrote a calculator program You may take a CAS like https://red... (by MikeStgt)
Problem with Exception thrown due to Overflow of number
 
Ok I am making a program which will display the sum of all the indexes of an array. However, if the sum exceeds the max value of int or goes below the minimum v...
[6 replies] Last: > how can I possibly detect an error if a number bigger than INT MAX i... (by JLBorges)
Factorial of large number
 
i want to get factorial of a number as large number as 10^6 with modulo 10^9+7. i also have the test case with t upto 10^5 and factorial of a number n upto 10^...
[5 replies] Last: A bignum library will have routines optimized to do stuff modulo some ... (by Duthomhas)
How do i make my function in my player class for game of hearts work without being a pointer?
 
I was assigned to make a game of hearts where there is an array of 4 people and each people has a hand of 13 cards. Currently, when dealing trying to deal cards...
[1 reply] : you can copy cards, of course. card hand ; hand = somecard; //overlo... (by jonnin)
by myruuh
newbie stuck
 
so this is my first semester taking c++ and I am stuck with this assignment. I am stuck in the deactivate account and setting account in the format "xxxxx-xx...
[3 replies] Last: Hello myruuh, As I look over what you have you are missing the header... (by Handy Andy)
Need assistance with assignment!
 
I'm fairly new to programming and I was given an assignment: Define a pharmacy type class containing fields - unique name (up to 40 characters), purpose (up ...
[10 replies] Last: I can't say it much better than that... start coding and see where you... (by jonnin)
May 2019 Pages: 1... 1213141516
  Archived months: [apr2019] [jun2019]

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