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,...
Jan 18, 2017 at 4:35pm
[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; }
Jan 18, 2017 at 3:38pm
[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...
Jan 18, 2017 at 1:46pm
[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...
Jan 18, 2017 at 10:12am
[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...
Jan 18, 2017 at 9:02am
[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 ...
Jan 18, 2017 at 7:09am
[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 ...
Jan 18, 2017 at 7:01am
[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...
Jan 18, 2017 at 6:31am
[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...
Jan 18, 2017 at 6:16am
[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 ...
Jan 18, 2017 at 2:46am
[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...
Jan 18, 2017 at 2:22am
[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 ...
Jan 18, 2017 at 12:57am
[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...
Jan 18, 2017 at 12:51am
[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...
Jan 17, 2017 at 11:41pm
[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 //-----------------------...
Jan 17, 2017 at 9:09pm
[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 ...
Jan 17, 2017 at 8:00pm
[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...
Jan 17, 2017 at 7:21pm
[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 ...
Jan 17, 2017 at 6:48pm
[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.
Jan 17, 2017 at 6:25pm
[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...
Jan 17, 2017 at 4:12pm
[1 reply] : The program should calculate the sum of all the prime numbers greate... (by closed account 3CD9z8AR)
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.
Registered users can post in this forum.