Beginners - February 2017 (Page 30)

Area of a Triangle
 
Hi guys, I'm quite new to C++, just taking my first course now in University. I have this assignment where I have to write a program where the user inputs th...
[4 replies] Last: I only tried one triangle, but it gave the same area as computed by ot... (by lastchance)
helppppp with string
 
i wrote a following program to convert alphabets in string with length 100 this way lowercase alphabets should convert to uppercase alphabets and reverse ...
[4 replies] Last: You can use isupper(), islower(), toupper() and tolower() to do this: ... (by dhayden)
Taylor Series Expansion: cos(x) range issue
 
I have been able to compile with g++ and run this code for a range of degree values -95<x<95, but any degree value outside of this range enters an infinite nan ...
[4 replies] Last: Ah yes, this makes the error more obvious. I will give it another shot... (by Mrjoe10)
how do calculating the avg?
 
How do i calculate the avg i got and divide by the number of students that read from a file? without asking the user how many students? also lining data same co...
[5 replies] Last: hey I wanted to send you a message but it didnt allow me. The questio... (by sesslit805)
Hex editor
 
Hi. I've got a project to do but can't get through with some things. My program so far takes a binary number converts it to dec and then from dec to hex a...
[17 replies] Last: It works as it should now. argv file name argv -d destionation argv... (by kubanm3)
Area of a Shape
 
So I wrote my code out and when i compile it, it says that calcArea is not declared. Can somebody help explain the problem? /********************************...
[2 replies] Last: Line 5: calcArea() is undefined. Because calcArea() follows main, you... (by AbstractionAnon)
Palindromes
 
My program is supposed to print all numbers smaller than user-inputted number 'n' which are palindromes. It compiles, but when I input a number into n, it doesn...
[2 replies] Last: Line 5: m is an uninitialized (garbage) variable. Line 11: You're o... (by AbstractionAnon)
vector as a pointer using struct C++
 
Personal contribution. Can a vector act as a pointer ? The answer is yes, look at the first and last code (int the reply section). #include <i...
[11 replies] Last: Oh yes, I mean using a pointer that exists in a struct, and then point... (by Kourosh23)
Passing an object with long lifetime
 
Is there a way to make sure that you can't do this Add(Vector2(100, 100)); but instead only be able to do this Add(pos); Vector2 pos(10...
[6 replies] Last: Thank you so much. That was great ! Appreciate the help. (by Fantasy)
by pumzye
Dynamic Array and For Loop not working
 
Hello Guys My dynamic array is not picking up the number of students entered and working out maximum student score. Please advise how to fix it. #in...
[7 replies] Last: Thanks for the help, rather new to this (by seasickmama)
by Fyuran
Custom iterator issue
 
Hello, I'm currently reading up Bjarne Stroustrup, Programming principles and practice using C++ on chapter 20.7. Visual Studio 2015 won't allow me to compil...
[3 replies] Last: If you have reached chapter 20 of Stroustrup's book, having worked thr... (by JLBorges)
by shw92
Alignment Problem Output Columns
 
I'm having trouble aligning the second column (prices) on my code. cout << fixed << setprecision(2); cout << "Currency exchange:" << "\n\n"; cout << currenc...
[no replies]
undefined reference to 'timeGetTime@0'
 
I'm in trouble at finding the proper library for timeGetTime() function. When i try to run it, it give me this error: "undefined reference to 'timeGetTime@0'". ...
[11 replies] Last: Ok, thank you! (by Yoooooo)
for loops vs for each loop vectors C++
 
Personal contribution. Using for each loop is a common task when you do not want to create an index i for example inside a for loop. For each loops work as lon...
[5 replies] Last: http://en.cppreference.com/w/cpp/language/range-for http://en.cpprefe... (by TheIdeasMan)
How do I show decimals when dividing?
 
#include <iostream> using namespace std; int main() { int a, b, operation; float answer; cout << "================== Calculator ==================" ...
[7 replies] Last: Although if a and b were double to start with .... then life would b... (by gunnerfunner)
Prime Numbers C++
 
The following program checks for prime numbers except 4. 4 is not a prime number, but it says it is prime. Any idea how to fix this bug? #include <iostream...
[15 replies] Last: Actually none of last 3 programs are correct. If you run them it shoul... (by TheIdeasMan)
Using round()
 
So i have a program that calculates an equation and my result is for example a decimal number like 15.8569 but its stored into a variable like total, how do i u...
[4 replies] Last: is there anyway of doing it without iomanip, or setprecision() ive f... (by integralfx)
Login program with warning :(
 
Guys Im trying to make a login program wherein there will be a warning in each attempt and I only have to do 3 attempts. In this program I made no matter what c...
[6 replies] Last: Oh sir integralfix thank you for your help I am now able to run the pr... (by deleon123)
Compare two strings
 
I am trying to write a code that you input one persons DNA then another Person's DNA and it scores it based on matches. For example if two T's (or A's) match t...
[7 replies] Last: What type of loop would I use to do that? a for loop? Whichever loo... (by integralfx)
February 2017 Pages: 1... 2829303132... 37
  Archived months: [jan2017] [mar2017]

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