Beginners - March 2016 (Page 18)

Cost calculator function
 
What is wrong with this calculation? I'm trying to have it return cost 3.00 for up to 16, then from 17-20 inclusive increase by .50, then from 21-24 inclusive a...
[1 reply] : double delivery_charge (const double ounce) { const double cost = 3.... (by TheIdeasMan)
by b166er
really new to coding dice game
 
I used my first code to simply + - * / 2 numbers and this is my 2nd code :D was really curious if this is ok for an exe representing 2 dice being thrown? #in...
[4 replies] Last: Hope your class goes well, sure it will with the experience u have to ... (by b166er)
help with this code
 
guys do u know whats wrong with this code? the final answer is incorrect. #include<stdio.h> int main() { int a,b,c,d,e; printf("Enter a number: "); ...
[2 replies] Last: try using a double... double a,b,c,d,e; (by DirtyDan)
Help with output file
 
Hello, can someone please help me with my code? I have to take a input file that has a list of president names (last name middle name first name) and I have to ...
[2 replies] Last: Oh, okay thank you very much! (by Supershock01)
classes
 
Why won't my code display the student id? I think I know why, but how could i fix it to show the id? - thank you! #include<iostream> #include<iomanip...
[2 replies] Last: the setall function is supposed to initialize the class members. than... (by joshuatz)
cin >> n doesn't work
 
Hi, I am working my way through Bjarne Stroustrup's Programming Principles and Practice Using C++. An exercise in Chapter 5 asks you to get some numbers ...
[4 replies] Last: Thank you, Moschops! The program works now! ^_^ (by verdastelo)
Ofstream not changing target file
 
I wrote this function to sort an array of library books by their book type (an int from 1-4) and to print out the members of the array in ascending order by boo...
[1 reply] : I would check the status of bookWriter after the open() call to make s... (by koothkeeper)
Pointer Example: Some Problems Part 2
 
So heres my program: #include<iostream> #include<ctype.h> #include<string.h> /* Program to search for a given character inside a string and to p...
[2 replies] Last: http://stackoverflow.com/questions/1744665/need-help-with-getline #i... (by Bdanielz)
I want to make program with a GUI
 
I want to make a program of calculating bending allowance for sheet metal. I have made it in code blocks, but I don't know how to put it in GUI can anybod...
[1 reply] : You could look into using a graphics API or library. You might look in... (by CGunn86)
Check if an array elements exist in the another array
 
Hi, I have two arrays like this: A={ 1, 3, 7} B={ 4, 5, 2, 3, 8,7,1} In C++, I want to check whether all elements of the array A exist in the array B or not? ...
[11 replies] Last: Remove the system("pause"); altogether. There is no sane reason to h... (by keskiverto)
C++ iterator, function not running
 
133:40: error: \u2018remove\u2019 declared as function returning a function (typename vector <T>::iterator ix, T n) this is the error i get and i can't se...
[3 replies] Last: Of course. Within your class definition (lines 5-24) you do declare (... (by keskiverto)
what is problem? i don't know ...
 
Write your question here. #include <iostream> #include <string> #include <fstream> #include <vector> const int N = 4; using namespace std; class oc...
[2 replies] Last: main problem: int main(){ vector<ocean> x(N); // This actually cre... (by tipaye)
C++14 Question about auto
 
Looking over some of the new stuff in C++14 I notice you can use "auto" for the return type of a function. I've messed with it a bit but it just feels weird. Ma...
[1 reply] : I agree. I prefer writing the return type explicitly. It makes it much... (by Peter87)
by Shadyx
Need help with the correct use of "IF"
 
Hi guys, I'm pretty new and a I would like to ask 2 little things about my first program ever. So I wrote this simple code, and the 2 things I would like to as...
[6 replies] Last: Thanks to all who helped, marking the topic as solved. (by Shadyx)
Pointer Example: Some problems
 
Hey guys,so ive my school exams next week and I was practising pointers in my computer.Heres what the program is supposed to do:- Program to search for a giv...
[6 replies] Last: No,could you write the code in here,the site is too slow for me to loa... (by MaBunny)
Problem in isalnum
 
Whenever I use isalnum, it returns non-zero for an alphabet , but returns zero for an integer.Why??
[3 replies] Last: What about a string A string contains a series of characters. Each c... (by Chervil)
Day of week calculator off by 1 day
 
One of my class assignments is to create a program that calculates the day of the week by first calculating the Julian day number, adding one and doing a % 7 op...
[2 replies] Last: What day of the week was Julian day zero? The answer to that question... (by dhayden)
Template class Linked List
 
Hello, I am making a linked list class as a template class, but it is the first time that I am using template classes. I am getting these 32 errors: Schweregra...
[1 reply] : just had to put the functions into the .h files (by AmazingBKaiser)
by csnook
Reversing the String
 
This is a friend function that takes a char* and a string and concatenates them. In my case this returns them appended in the wrong order. S7 is defined as Fun...
[4 replies] Last: It actually looks like your assignment operator is working incorrectly... (by GRex2595)
by Zulu93
Cpp 2D struct Array
 
okay.. i made a struct that with 3 data types (1) string charName (2) float CharHealth (3) int charExp. the program is then supposed to read a file with infor...
[3 replies] Last: Your struct charData can hold the complete line so there is no need fo... (by Thomas1965)
March 2016 Pages: 1... 1617181920... 47
  Archived months: [feb2016] [apr2016]

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