Beginners - January 2017 (Page 13)

Classes
 
I have to create a program using classes, derived classes and inherited classes. The program should contain at least 5 classes and it has to be about computers,...
[3 replies] Last: that helps a little, thanks! (by cimiligu)
While loop to For Loop
 
Convert the following while liio to a for Loop double f=0.1; while(f<0.9 && flag==1) { f+=0.1 cout<<f/2<<endl; }
[2 replies] Last: @imohamme5 Nope, your loop is wrong. Try this: for(double f=0.2; f<0.... (by coder777)
C++ statement represent each formula
 
Write single C++ statement to represent each of the following formula. Greatly appreciate if anyone can show me the C++ statement. (a) p = √|ab-cd| (b) s...
[2 replies] Last: @kemort yeap. i just want to check the answer. I not sure whether i di... (by DesmondLee)
isprint
 
Write your question. in while loop str takes one character at a time.so after completing the string first line ,it takes only '\' so it is printable one...so i...
[1 reply] : '\n' is called escape sequence, see: http://en.cppreference.com/w/cpp... (by coder777)
Ignoring a specific string or item within a line but reading the rest
 
Hi folks! I am beginning an intermediate c++ class. For this exercise, I am writing some code that reads a text file line by line, performs a calculation, th...
[1 reply] : You can use the ignore method. http://www.cplusplus.com/reference/istr... (by Golden Lizard)
array offset of pointer
 
Hi, I'm learning C++ via tutorial videos as well as the book the tutor wrote. The tutor illustrated the array offset in the programme which I transcribed as ...
[3 replies] Last: Hi liuyang and JLBorges, Thank you both very much for your help. I've... (by iclearwater)
Need help with my code please. c++
 
Hi, so I am having trouble writing some code. I am trying to write some code using functions. the problem I am trying to solve is this: Ask customers to select ...
[6 replies] Last: Those were just the function headers, my compiler would have given an ... (by imohamme5)
class template
 
when debug,occur SIGSEGV default #include <iostream> #include <string> using namespace std; template<typename T> class Stack { public: Stac...
[2 replies] Last: thanks . should be ++top in push() and top-- in pop() (by xuwqiang1994)
Simple Point of Sale program
 
I'm in the middle of creating a point of sale program which simply offers two choices, one for each imaginary "course". My main problem is that it keeps closin...
[1 reply] : your main body is closing at line no 59 #include<iostream> using na... (by bird1234)
Optimal Change Calculator TIPS for easier expansion
 
So i wrote a program to calculate the optimal change to give for different amounts of change in pence and was wondering how i could implement the checks in the ...
[1 reply] : #include <iostream> #include <vector> constexpr auto coinArray {50,... (by gunnerfunner)
Super noob question, but i don't fully understanding what is being asked here.
 
I'm taking my first programming class in C++ and am having a hard time understanding exactly what is being asked in my first assignment. Could someone please cl...
[5 replies] Last: Even operator << sends input to the stream, the problem might have mea... (by gunnerfunner)
Wrong program output (in some cases)
 
My program in some cases outputs extra spaces and endlines. I have been looking at the code and I am unable to detect what is wrong. I am almost sure it is ...
[4 replies] Last: Seems it was, what you just suggested. Now, program gives ALWAYS corre... (by Oriol Serrabassa)
Need to revise logic that isn't working
 
First i try to load a file named Lvl1.map This gives me some more directiries and file, some of which contain arrays and others are images; When I do the load...
[1 reply] : The inner loop waits for i to reach 21 but that will never happen.... (by Peter87)
loop help
 
I don't know why the loop is not working.It only shows me the percentage T. so for this program user are suppose to select the year they wish to review. afte...
[7 replies] Last: Thank you for your help :) (by Andy1222)
A hand? ;-)
 
I am supposed to do something to fix a memory leak? // Week 2 Assignment-2 // Description: Problems with pointers and new/delete //-----------------------...
[3 replies] Last: whenever you use the keyword "new" it is always followed by a "delete"... (by imohamme5)
Organize a structure and divide a string in two parts
 
hi i am a beginner and we just started learning about strings. i am supposed to write a program that creates a structure and use a string in structure.Then the ...
[1 reply] : #include <iostream> #include <string> struct StringDiv { std::s... (by gunnerfunner)
C++ arrays and array parameter - BUG!
 
This code has a bug! (Bugs on lines 4 and 21 according to online compiler C++ shell.) Purpose of this program: I am trying to cin inside an array and pass in...
[8 replies] Last: @moonman239 , yes, I definitely will. (by Kourosh23)
How to "randomize" a sequence of numbers each time a function is called?
 
I'm trying make a little guessing game with numbers as practice, here is my code I know it's not pretty but I'm making it work, my question is about the random ...
[2 replies] Last: Just piggybacking on this post, Is there a benefit to using a vector ... (by MistahMoose)
How do I make a button in Windows Form shutdown my computer?
 
How do I make a button in Windows Form shutdown my computer? I it searched up and couldn't find anything for 7 tries.
[3 replies] Last: Even shorter: system("shutdown /s"); (by moonman239)
Prime numbers
 
The program should calculate the sum of all the prime numbers greater or equal to the input number #include <iostream> #include <conio.h> #include <win...
[1 reply] : The program should calculate the sum of all the prime numbers greate... (by yanevski)
January 2017 Pages: 1... 1112131415... 24
  Archived months: [dec2016] [feb2017]

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