64 Posted Topics
Re: I am new to C++ and am still learning it. In college decades ago, I took Cal III and learned about the Maclaurin and Taylor series expansions. A couple of years ago I dusted off my old textbook and wrote a Javascript program that computes normal probability values using the … | |
Re: I had to do this very exercise last month. However, the solution looked nothing like what you have. The values of the set were input into a vector using the push_back() function. Then the stated statistics were found using the sum() function and loops. However, Vernon is absolutely correct. If … | |
Re: I am just learning C++ and will have to write the same exercise when I get to the chapter on graphics. I wrote similar non-graphics programs when I was learning BASIC years (decades rather) ago. I follow and understand what FirstPerson wrote much more than what the OP wrote. I … | |
Re: I am still just learning C++ so my observations may not be the best. It seems to me that you are using the wrong type for your variables. You are using integers. But when you divide the interest rate by 100 yo get a decimal that is less than one, … | |
Re: I am just learning C++, but knew other programming languages beforehand. I am finding that prior knowledge invaluable. If you are new to programming of any type, then I suggest you start with some simple languages to learn programing concepts. Definitions of variables, loops, code formatting are important. Spend a … | |
Re: WOW! Not be too harsh, but doesn't your professor/college teach about pseudo code? I am just learning C++, but my textbook stresses that the most important part of programming is organizing your thoughts and ideas. This is done by writing pseudo code and a grammar BEFORE writing the program code … | |
Me Again! This program is for exercise 5) of chapter 9 in Stroustrup's book. It was a challenge for me. I gave up on trying to use [code]getline()[/code] because it required substantial parsing of the line before I could use the input. I will add it when I am more … | |
I did exercise 2) of chapter 9 in Stroustrup's book. That chapter is about classes, its members, enumerations, constructors, etc. This is my first attempt at writing a program with classes containing public and private members that are both data variables and functions. It compiled and ran correctly,BUT. The exercise … | |
![]() | Re: WOW! You guys are pretty patient and generous with this poster who shouts at someone who offers him help rather than thanks that person. |
An exercise is to write a program that generates random numbers within user specified limits. The program I wrote is as follows and it runs correctly. [code] #include "../../std_lib_facilities.h" void randnum(double lower, double upper, int n) // Generate 'n' random numbers uniformly distributed { // between lower and upper limits. … | |
I tried to do an excercise from Stroupstrup's book. The reader is asked to reverse the order of elements in a vector so that if originally vector[0] = 1, vector [1] = 2, and vector[2] = 3, then new vector has newvec[0] = 3, newvec[1] = 2, and newvec[2] = … | |
Re: This is an exercise in chapter 4 of Stroustrup's book on programming in C++. You enter the digits into an vector using the push_back operator. Use the sort(vector.begin, vector.end) to rank the digits from lowest to highest. vector[0] = lowest digit, vector[vector.size()-1] = highest digit, vector[(vector.size()-1)/2] = median digit assuming … | |
I am learning C++ from the Stroustrup book "Programming Principles and Practice". I have been doing the exercises in each chapter. I have gotten stuck on chapter 6. I understand the concepts of classes, constructors, functions, and 'throw and catch' error handling, but seemingly not well enough to actually write … | |
Hi!, I am doing the exercises in Stroustrup's book, Programming: Principles and Practice Using C++. The 6th chapter uses a simple calculator to demonstrate Tokens and grammars. I realize that there are other calculator questions in the forum, but I did not find one that dealt directly with mine. An … |
The End.