Beginners - October 2017 (Page 30)

regarding new and classes
 
class A{ A(); ~A(); virtual void printstuff(){cout << "A::printstuff" << endl; ....... }; class B: public A{ B(); ~B(); void printstuff(){cout << "B::pri...
[4 replies] Last: The constructor that takes no arguments is the default constructor. ... (by keskiverto)
Dropping a Score
 
This program is supposed to take the input of four scores, drop the lowest score and average the remaining three. The score range is (0.0 - 10.0). I have it so ...
[3 replies] Last: Hello RiggityWrecked, Thinking about the if/else if statements the or... (by Handy Andy)
by CPSC23
Issue getting loop to compile properly.
 
My instructor asked: Your job is to create a program that takes, from keyboard input: 1. The number of students in the class 2. number of points for an assi...
[1 reply] : Duplicated post: http://www.cplusplus.com/forum/general/222485/ (by Enoizat)
Something wrong with the output (binary search in an ordered array)
 
Continuation of a problem that I'm trying to solve.. I think that logically I'm about 90% of the way to a solution--but something is off... (note I left in som...
[4 replies] Last: I looked back through things and the math just didn't add up as you al... (by CapitalJeep)
How to obtain current minute?
 
Hi, everyone. I wanna ask how to obtain current minute in c++? Can someone help to show the simplest and not too complicated code? because I am still a beginner...
[7 replies] Last: Here's the gory details, @hooi1997. Please make your own mind up. htt... (by lastchance)
by div132
Could use some feedback/help with my code
 
So I was supposed to make a program that rates ski jumping. User inputs the length of the jump and the scores that 5 different referees gave him for it - and "t...
[3 replies] Last: Those comments really helped, as I thought - I wasted a lot of time th... (by div132)
comparing objects or strings
 
I was watching a video on udemy and the instructor checks to see if two strings are equal by using == ​In java they use a .equals method to compare two obj...
[11 replies] Last: > so if we write a class and make it equalityComparable we would have ... (by JLBorges)
correct change
 
Basically, I'm trying to write a basic cash register program where it tells the user the correct amount of change as well as the most efficient way of handing o...
[3 replies] Last: Do the whole thing in pennies. DOLLAR_AMOUNT = 100; QUARTER_AMOUNT =... (by Repeater)
Recursion
 
Hi I am writing a program that prompts the user to write a positive integer N and then computes S(N) = the sum from k=1 to N of H(k) and reports this values. ...
[1 reply] : I am wondering if I have to call a function Yes, you have to call a... (by AbstractionAnon)
How to do a linked list of linked lists? (1,2)
 
I am trying to figure out how I would make a linked list that contains other linked lists as the nodes. I am very new to linked lists, but I think I am beginnin...
[36 replies] Last: :) (by closed account 48T7M4Gy)
Reading Strings from a File into a Doubly Linked list
 
I am working on a program where I need to read data from a file then store each line into a doubly linked list. I then need to be able to format the strings by ...
[3 replies] Last: Just for anyone else who is looking for help with this.... This ended ... (by Metalman488)
Function's function
 
This is kind of a silly question but I came across this question and can't seem to understand how it works. int Function (unsigned int val) { if (val ...
[4 replies] Last: recursion works like calling any other function from inside a function... (by jonnin)
string stream global variables?
 
Hi guys, just wondering and this seems odd to me how come you can only use local variables with string stream and not global? how is this even possible to...
[4 replies] Last: hi guys thanks for the replies much appreciated, and yes I think I'm ... (by adam2016)
c++
 
Write your question here. Write a program that show a series of students’ grade point. Each student has 5 subjects. The program has a function readMark wi...
[2 replies] Last: can anyone help me to do this in c++??? Yep, try http://www.cplusplu... (by closed account 48T7M4Gy)
how to stop infinite loop
 
I have to submit this coding for school and when I try to submit it, it says, "program end never reached(commonly due to an infinite loop or infinite recursion)...
[3 replies] Last: Setting code out clearly and with regular use of braces and whitespace... (by closed account 48T7M4Gy)
For loops causing bad allic char* error
 
The compiler keeps giving me bad alloc errors re a char pointer that isnt in the program. Please advise #include<iostream> #include<cstring> #include<...
[4 replies] Last: Thanks for the help guys that really clarified :-) (by Gboss59)
Pausing a program
 
Is there a command in C++ to pause your program? Say I wanted to cout two things, but so as to not overload the user with info I want to stagger them by 10 seco...
[1 reply] : std::this_thread::sleep_for() http://en.cppreference.com/w/cpp/threa... (by mbozzi)
Looping through pair of integers
 
I have to write a program that loops through pairs of integers n and k, where n runs from 1 to 10 inclusive, and, for each n, k runs from 0 to n inclusive. For ...
[2 replies] Last: I'm a bit confused on the math you are attempting to do, I don't see h... (by verilog)
Need help with code pleasee
 
I am working on my machine problem for my intro to programming. I can't figure out why my code will not read the Total applicants, for both programs, at the ve...
[3 replies] Last: Hello Noobie26, Thank you for the input file. Now that everything wo... (by Handy Andy)
by Fooly
How do I find the Averages for this program?
 
Hello, I am very new to programming and I am currently taking a c++ class. The task was to Write a program that asks the user for rainfall values for each month...
[1 reply] : Are the rainfall values really words? Was the rainfall for January "U... (by keskiverto)
October 2017 Pages: 1... 282930313233
  Archived months: [sep2017] [nov2017]

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