Beginners - November 2015 (Page 4)

error from ifstream string into class.
 
Write your question here. I am taking computer science course in uni, and this is my first year, and my prof gave us assignment to simulate soccer program, a...
[3 replies] Last: I am trying to make team data with txt file and trying to ifstream in... (by closed account 48T7M4Gy)
What am i doing wrong here?
 
I just wanted to try to use the if statement in a program so I though of putting 4 different calculating programs into one and the user would have the choice of...
[17 replies] Last: Well so far far we have been learjijg about cout and cin in school I j... (by Cplusminusplus)
Please help me with dice roll program
 
Hello, I'm new to c++ and I have this problem. 1) to read all the results of throw from a file called "YahtzeIn.txt" which your program should expected to f...
[8 replies] Last: #include <iostream> #include <fstream> using std::cout; using std::c... (by closed account 48T7M4Gy)
by Cat32
Help with overloaded operators
 
I am so stuck. Any assistance will result in my undying gratitude. Unfortunately, I don't have much else to offer. Here are the instructions for my assignmen...
[5 replies] Last: One thing you could do is to add a friend function to define the << ... (by Chervil)
output format
 
how do i decrease the digits of a number or round it down to a specific number of digits? for example.... int n; cin >> n; cout << n << endl; ...
[2 replies] Last: int is entered but what if i want the value to be no more than 7 dig... (by closed account 48T7M4Gy)
Fill vector with different class
 
Hey guys, i have this problem in my programe: I want to create a vector something like vector <animal> a; where the class animal is abstract. So i don't know ...
[17 replies] Last: If this is a chess board, shouldn't there just be 32 pieces? The ches... (by andywestken)
Need help with algorithim for finding and printing prime numbers in an arra
 
The issue I'm having is I am having trouble writing the code to find prime numbers in an array. The assignment requires us to open a data file and then our prog...
[5 replies] Last: This is another good source and effective pseudocode https://en.wikipe... (by closed account 48T7M4Gy)
Please help.
 
I cannot write the whole code as it is very long. I will try to just summarise it and explain the problem. My code is a computational code. The main program (...
[no replies]
Creating n number of if/switch statements during run time?
 
For instance, the user enters in a number, for example 5, and it is stored into a int variable n. Now I want to make a menu where it will display 5 options and ...
[1 reply] : Make a switch case. And depending on what the user enters, 1-5. call a... (by TarikNeaj)
C++
 
\Write a c++ program that initially takes an integer value from the user as the loop’s limit. It means that the loop will execute the same times as the input ...
[2 replies] Last: Hi shadow64, You have to do your own assignment. People are willing t... (by teez)
plz help me for this code
 
Write your question here. Write a c++ program that initially takes an integer value from the user as the loop’s limit. It means that the loop will execute th...
[6 replies] Last: thanks chicafeo for your kind suggestion i already write the code its ... (by ali1986)
troubleshooting with classes, it compiles with no errors but something in logic must not be ritght
 
hello, I changed these struct words to classes and not sure what the problem is because it compiles without errors,some guidance on my mistakes is well apprecia...
[1 reply] : Hi, What is your specific problem? I had some unused variable warnin... (by TheIdeasMan)
Boolean value not being updated in print loop
 
Im writing a code for a class and it involves using classes and a boolean value to display a (-) if the fraction is negative. The input function is correct but ...
[3 replies] Last: Sorry for the duplicating of posts, but still whenever I enter any nu... (by brawdyll)
Binary conversion
 
I am trying to figure out how to convert a number to binary. I am running into the problem where it either goes into an infinite loop or it only does one conver...
[4 replies] Last: // invariant: result is within ULLONG_MAX unsigned long long to_binar... (by JLBorges)
Using if Else
 
Can Someone help me pls :( i need this kind of output Seasons of the year Input a number: 2 February is WINTER Happy Valentine’s Day Input a nu...
[4 replies] Last: you put a { in front of your if statement and it needs to be after. (by SamuelAdams)
Need help with arrays!!!
 
I am trying to store values from the user into an array and then display them it seems really simple and I do not know why it is not working. I can store the va...
[no replies]
Declaration not allowed here
 
#include<iomanip.h> #include<dos.h> #include<iostream.h> #include<stdlib.h> #include<stdio.h> #include<process.h> #include<fstream.h> #include<conio.h> ...
[no replies]
Learning while loop
 
This is very helpful, but I was curious is there a way to use this piece of code in such a way e.g. i only want the program to accept 100, 101, and 102 anythin...
[6 replies] Last: hi nameishi, I ended up using that style, was curious if there was a... (by teez)
6! "Factorial of six"
 
Hello guys, I have a slight difficulty finding the most efficient way to represent 6! "factorial of six", here is my feeble attempt to come up with a code, p...
[5 replies] Last: @Kemort, -Thank you ! I will! (by Roxanne Sofia)
GUI Builder
 
I know some basic C++ and have heard that building a GUI is very hard in c++. I know css and was wondering if there is a way to use this and integrate into a, f...
[2 replies] Last: Visual Studio is good too as are some others. Obviously VS is a Window... (by closed account 48T7M4Gy)
November 2015 Pages: 123456... 53
  Archived months: [oct2015] [dec2015]

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