64 Posted Topics

Member Avatar for cdh1944

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 …

Member Avatar for Stefano Mtangoo
0
170
Member Avatar for aviavyne

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 …

Member Avatar for mike_2000_17
0
295
Member Avatar for umairqureshi_6

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 …

Member Avatar for umairqureshi_6
0
518
Member Avatar for eduard77

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, …

Member Avatar for eduard77
0
233
Member Avatar for Panda.

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 …

Member Avatar for Nathaniel10
0
108
Member Avatar for notmasteryet

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 …

Member Avatar for Fbody
0
357
Member Avatar for Nathaniel10

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 …

Member Avatar for mrnutty
0
131
Member Avatar for Nathaniel10

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 …

Member Avatar for Nathaniel10
0
91
Member Avatar for Jackk123

WOW! You guys are pretty patient and generous with this poster who shouts at someone who offers him help rather than thanks that person.

Member Avatar for mrnutty
0
108
Member Avatar for Nathaniel10

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. …

Member Avatar for mrnutty
0
183
Member Avatar for Nathaniel10

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] = …

Member Avatar for Nathaniel10
0
194
Member Avatar for kazkikay12

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 …

Member Avatar for Nathaniel10
0
118
Member Avatar for Nathaniel10

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 …

Member Avatar for Nathaniel10
2
141
Member Avatar for Nathaniel10

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 …

0
40

The End.